Function To List Drives
Is there a PHP command to list the drives of the Server.
Or should I check each letter from a...z if it exists?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How Do You Retrive Drives And Net Work Connections?
I want to retrieve a list of all the drives (HD, CD-ROM, Removable, etc) and also network connections/mappings and shares connected to the computer which is Windows XP. I am trying to avoid using FileSystemObject if possible. Is there anyway of doing this with PHP extensions? My other thought would be to use exec() or a Java applet.
Fopen With Unmapped Novell Drives?
I need to do is when a user clicks on a link I need to check if the link is valid and if it isn't then redirect to another link. Under normal circumstances this would be easy enough to do with fopen(), however here's where it gets messy. The link isn't a standard URL it's a link to a shared Novell drive (for example href="\Novell_Servershare_dirfile.ext) . Does anyone know how to do this with fopen or any function? All I really need to know is if I can reach that file so that I can link to that file, otherwise try the backup server and path. I have to do this because the files must be on the Novell servers, however the servers themselves may go down in the future during planned upgrades. If anyone has any input I'd appreciate it. Also, I guess if it's possible to check the Novell server via a linux shell command that might be a workaround, but I'd prefer not to have to do that.
Can PHP Script Read From Mounted Drives?
I have a PHP script which is triggered via an .htaccess file utilizing AddHandler and Action commands. The script has worked perfectly up till recently when I moved most of our web content to a separate RAID server. PHP includes work for pulling in any page located under my web folder (htdocs). However, if I try to pull in a file from a mounted drive (folder sitting outside the web folder, mapped to a completely different hard disk), nothing happens. This mapped folder (‘ /content ‘) is a mounted alias that points to the raid server drive. The permissions on the ‘/content’ folder itself, the folder contents and the test script all match those of the web servers Apache process. To isolate the problem, I wrote a script to read the contents of the mounted drive directory. If I run the script from a shell, it will read the mounded drive directory. However, if I run that same script using a browser from the web folder, it will not read the directory. Would anyone recommend a different approach? Are there built in web server or PHP restrictions that will not allow me to read from a folder so close to /root?
How To Find The Free Disk Space On The Network Drives
I need to find the free drive space on the network machines. Looked in to the PHP functions and found that there is only one function 'disk_free_space'. But its written that the function cannot be used to find the free disk space on the network drives.
Function List With Associated Extension
I want to create an application that will scan a series of .php files, look the functions availiable in them, and display which extensions it is using (don't know how to avoid user made conflicted name functions). Is there a table which has the name of the extension and the functions included in the particular extension..? Is there a way that I can get a new list if an extension upgrades and adds new functions..? And what about PEAR..? I don't really know how it works, but I think it adds some functions too. Can I do the same with the php extensions..?
ASP2PHP Function List Reference
PHP so I thought I would make a Reference List of some of the functions. Below is what I have so far. ASP Functions PHP Functions ==================== =============== Left(str,length) substr(str,start,length) Right(str,length) substr(str,start,length) Mid(str,start,stop) substr(str,start,length) Len(str) strlen(str) Trim(str) trim(str) LTrim(str) ltrim(str) RTrim(str) rtrim(str) UCase(str) strtoupper(str) LCase(str) strtolower(str) InStr(str,value) ---DON'T KNOW---
List Weeks Of Year Using Calendar Function
I've been asked to design a small site which contains a page with a list of dates to show a visitor if accommodation (running from Saturday - Friday) is booked or available. Something like this: 2007 2nd Jan - 8th Jan - Available 9th Jan - 15th Jan - Available 16th Jan - 22nd Jan - Booked 23rd Jan - 29th Jan - Available 5th Feb - 11th Feb - Available 12th Feb - 17th Feb - Available etc, etc I'd like to dynamically create the list of dates using the php calendar functions and a mysql database so that each row (52 in total?) could be flagged 'booked' or 'available' allowing easy updating using a back end form. Ideally the page showing the list would have a link taking the visitor to another page showing the following year's dates. Each list would always show a year to view and always run from Jan to Dec.
Calling A Php Function From A Form Selection List
I have a function that will read records from the database and populate an area of my webpage based on a value selected from a list box. I have got it to work fine if the user hits a submit button but I was wondering if it possible to perform the function dynamically each time the user changes the value in the list box.
List Contents Of A Folder, Make List Of Links
Does anyone know how I can write a script that: - reads in all the files in a particular directory - displays the file names in a html list and makes a link of them: <ul> <li><a href="filelocation1">filename 1</li> <li><a href="filelocation2">filename 1</li> <li><a href="filelocation3">filename 1</li> </ul> etc.? So basically it creates a list of links with the contents in that directory, so you can download them from there.
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not. What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings. SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = Ƈ') ORDER BY msgno DESC LIMIT 100 What I'm getting, though is a list that looks like this: mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary. If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1. mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 2214 msgno: 0412141622 msglist: 1 mbxno: 2189 msgno: 0412141408 msglist: 1 mbxno: 0000 msgno: 0412141213 msglist: 1 mbxno: 0003 msgno: 0412141213 msglist: 1 mbxno: 2265 msgno: 0412132029 msglist: 1 mbxno: 0000 msgno: 0412131950 msglist: 1 How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?
Mailing List Manager, Send To List
I'm looking for a mailing list script (php) that has a function to let users to reach out to all recipient on the list by simple send the email to a specific maillist- address. Mailman has this functionn but as a just got a webserver account I can't use mailman nor install it.
Function Inside A Class Function Dont Pass Variables...
Im using xajax class, and i just made a custom class called mantenimientos that use objects of this xajax class. Something like this: class mantenimiento { public $titulo; public $ajax_sRequestURL; function __construct($titulo,$ajax_url){ $this->titulo = $titulo; $this->ajax_sRequestURL = $ajax_url; } function exec_ajax(){ //Here i can use $this with no problem $xajax = new xajax($this->ajax_sRequestURL); $xajax->registerFunction("call_fun"); //I have to do this to have acces to the class itself when im inside a function global $mant ; $mant = $this; function call_fun(){ //next line give me access to the mantenimiento class properties. //I havent found other way of doing it. global $mant; $objResponse = new xajaxResponse(); $objResponse->addAlert('XAJAX CALLED:'.$mant->titulo); return $objResponse->getXML(); } $xajax->processRequests(); } My problem is that $mant->titulo lost it value when i im inside the funciton, but only when that value comes from other var. for example: if i do this: $mant = new mantenimiento('This is the title','index.php'); or $titulo = 'This is the title' $mant = new mantenimiento($titulo,'index.php'); When i execute the xajax_call_fun, it shows an alert box with the text "XAJAX CALLED:This is the title" but if i do something like this: $titulo = gettitulo_from_database(); or $titulo = $_POST['titulo']; The alert box show the mensaje with out the value of the $mant->titulo Im getting crazy with this....!
Function/Global Var To Return Name Of Calling Function?
I'm sure I saw this somewhere but can't remember where and can't find it now... Is there a PHP function or global variable that will return name of the calling function? I want to do this for error reporting purposes without having to hardcode the function name into my scripts. Say the function is named getFunctionName(). I want to do something like... function foo() {
Address Of Function Or A Virtual Function
Is there some way to implement something like a virtual function or have something like a user defined function ? One solution I thought might work: store a reference (address) of a function in a variable and call it later if that variable has been set ? This seems to compile OK, but produces funny results. Is this outside the scope of php ? function testfn() { .... return $result; } $myfn = &testfn; // set it too the address of the function .... if (isset($myfn)) $result = @$myfn(); // call my function
Variable Scope - Function In Function
Here's something that I can't manage to find explicitly documented. In the following snippet: function outer() { global $a; function inner() { global $a; echo $a.Ƈ<br>' } $a = 's' inner(); echo $a.ƈ<br>' } outer(); ?> If either of the globals statements is removed, the variable is not accessable within inner.
Call Function Inside Another Function
I have a function that gives me the difference between 2 dates. I also have another function which compares a couple things and uses the first function. How do I call one function from within another. Here are the 2 functions. Code:
Using List
when my form is loaded i populate a list with a database query. now when user selects a value from the list. on "onChange" another query runs and other fields on the form are populated according to the value selected by the user but at this time when page is loaded again and the fields on the form are filld. every thing goes write but the select list doesn't have the same value selected that was selected by the user...the selected list shows the default valuse selected instead. i want to know that how can we do this that when we select a value from the list and page is populated using this vale and refreshed then again i want to see the selected value in the list box not the dafault value.
Mp3 List
I can't figure why I can't list only mp3 files with this code : <?php $dir = opendir("."); while($file = readdir($dir)) { $ext = getFileExtension($file); if ($ext = "mp3") { echo "<a href=" .$file.">".$file; echo "<p>"; } } closedir($dir); function getFileExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } ?>
Buddy List
I have a community, now it´s time to upgrade and make a buddy list. Ive started wtih the file that ask´s the other member for a relation. The code looks like this PHP Code:
Problems With List()
I am having some problems with the list() function. Here is some code: <? $USERDB = fopen("users.db", "r"); while ($line = fgets ($USERDB, 4096)) { list ($name, $occupation, $favcolor) = split ("|", $line); print ("Name: $name<br>"); print ("Job: $occupation<br>"); print ("Favorite Color: $favcolor<br>"); } fclose ($USERDB); ?> And here is whats in the text file: Van Tate|Software Engineer|Green Now...when I execute the script I get this error: Warning: bad regular expression for split() in /var/www/html/v2/getusers.php on line 7.
List Constants
A little embarrassing but: is there any easy way to echo (the name and value of ) all defined constants?
Drop Down List
I want to read a directory for available files and then get the filenames and put them in a drop down list. Whatever the user will select will be the value of the variable $selected. I already found the code to read directories: Code:
Loop Through A List
I want to loop through a list and display it in a table with three columns per row, yet haven't had much luck in doing so. I was thinking if would be something like so Quote: for ($x = 0; $x < mysql_num_rows($query); $x++) { if ($x / 3) { ?> <tr> <? } ?><td> Blah </td></tr></table> Well, that's as much as I know so far.
Add Number In List
I am outputing a list of 10 values. 10, 20, 30, 40, etc I can add 15 to one of the values then reorder the values from smallest to highest but i want to update every single value and assign it values increamenting by 10 so after the update the second number of 20 and add 15 I get 10, 30, 35, 40 now i want to re output the values above as 10, 20, 30, 40
Php Mailing List
Can anyone point me to a php script that stores email addresses into a txt file? The purpose for this is for a mailing list, ideally if a user wanted to unsubscribe the email would be removed from the text file.
PHP Link List
On a page from Thredz (http://www.thredziii.com) I saw a script (it's not on anymore...cause he didn't want the script to be on his page) and I love it... It's a script that makes it possible that on a page links are sorted ALPHABETICALLY with the first letter of the "URL name"... (take a look on Thredz' site to c what I mean,K?) Then people got 2 have the abbility to fill in a small form, ON THE SAME PAGE WHERE THE LINKS ARE ON, where they fill in 2 fields; #1 = Name of the Site ($sitename) #2 = URL of the site ($url) When they fill out it form I want the PHP-script to put the information away as a link (in a *.txt-file...if possible) <A href="$url" target="_blank">"$sitename"</A><br> (something like this??? I'm not sure......) These links have to be sorted alphabetically (on the site's name,$sitename... I don't know how this works or how I have to make something like this... Could somebody please help me and give me a bit of help with it? Some explaining would be gr8 but the script written for me is the best wish I have.
Dropdown List
I have a Dropdown list with Select with 1, 2, 3, 4, after select on of them it bust to refresh the page to what you select but it don't do it. PHP Code:
Getting List Of Newsgroups Via Php
I am trying to write a PHP script that will download a list of all the newsgroups on a news server and put them into a MySQL database. I bought a $50 book that had some NNTP examples in it, but none of them show how to just download the groups, not the articles. I tried on my own for about 2 hours with no luck. If someone can point me in the right direction to download the group list using PHP, I think I can figure out how to write it to a database.
FTP List Problem
I used ftp_rawlist, not ftp_list. [color=blue] > I used ftp_list and ftp_nlist. Both of them worked when the target is Sun > or Linux machine. However, it didn't work when the destination is VXWorks > (embedded platform). The version of php I am using is 4.3.2. According[/color] to[color=blue] > my search on google that problems for ftp_list and ftp_nlist for some > platforms were fixed in 4.3. > > If I manually ftp to the VXWorks, I could use the "dir" or "ls" to see the > listing at the destination. >[/color]
List Certain Files In A Dir
I am working on a news script were my members can post what they are currently working on. I have a dir were all of there images are going to be uploaded, and I need to know if the following is possable to do. $username = the members name selected from the database $projname = the projects name selected from the database What I want to do is select only images with the filename containing the info. The filenames are like this: TheBlackshinobi_3dmountain_1.jpg TheBlackshinobi_3dmountain_2.jpg TheBlackshinobi_3dmountain_3.jpg
Php And Drop Down List
I am coding an email form on a site. A user enters their name and contact email and then selects from a drop down list to which particular email the message should be sent: User1, User2, User3. Then the user types out a message and hits submit. My problem is that I am unsure as to how to grab the selection in the drop down list and pull the selection and place it like this: "$selection@domain.com". Here is the php code:
PHP Shortand List
Is there a place where I can find a list of all the shorthand/shortcuts in PHP's syntax. IE: $_POST, $counter++, etc? Anyone know?
Getting A List Of Newsgroups With PHP
Does anybody know of a quick and dirty way that I can connect to a news server, retrieve a list of all newsgroups beginning with alt. (or comp., or blah., or wibble., doesn't really matter), and also the newsgroup descriptions, and then dump them all in an html file?
Php Mailing List
Is it possible to implement a mailing list using PHP?. I know I could maintain a list of emails addresses in a db and send mail to them through my website, but how can I get true mailing list behaviour where emails are sent to a particular address (like mailinglist@mydomain.com) and then distributed to all of the email addresses?.
While(list => Checkboxes
I wanted to print out checkboxes for those which are checked when form is being submitted. Whilst, this is my function: PHP Code:
Select List
I'm creating a form that has three select lists. The first one has two values EMAIL and SMS. What I want to do is have the two other select lists (named EMAIL and SMS) work so that if EMAIL is selected only e-mail select list can be altered and vice versa with the SMS. How can I do this? I know to use disabled in <select> -tag, but how can I check the what the value is (and the value changes) and then act acording to it?
Best Way To List Pages A - Z
I now have my emulator site up and running, no longer html but php! Even my vote script now works, thank for all your input. Now I want to have roms on my site for download, but it's a fair long list so you have to devide in sections a - z or something. Can this be done in a way to create those pages with php/mysql instead of have to write html files for every emulator roms page from a to z? If anyone have done this before I would like to here what the possibilties are.
How To Use A Value From A Pick List?
I'd like to have a form that does the following: User picks a site from a dropdown list from a MySQL db (that works - code below, thanks to all those on the web who posted code for this). Once the value is selected, a second query is run using the site as the 'where' clause and the results are displayed back to the user. mysql, php, htlm noob. I think once I get this bit, I'll be able to move forward with more interesting and complex code. ps - if this message shows up 3 times, my apologies but I've been having trouble posting. <html> <body> <?php // connect to db $db = mysql_connect("localhost"); mysql_select_db("test",$db); // build query $sitequery = "SELECT site from sitedata order by site"; // generate result set $siteresult = mysql_query($sitequery); // use results echo "Select a site from the list below: <br><br><select name='site'>"; while($siterow = mysql_fetch_array($siteresult)) echo "<option value='".$siterow["site"]."'>".$siterow["site"]."</option>"; echo "</select></td>"; ?> </body> </html>
Css List Navigation
I found a nice link about CSS liquid layout. Specially for css list navigation ....
How To List A Directory
I would like to get a list of a local directory content using php. I would be very appreciative if anybody could tell me how to do that. I loocked in the php manual but coulsn't find anything (probably I just missed it).
Problems With List..
I have a function returning smth like list($a,$b): var_dump says: list(string $a, string $b) blabla() How can use this strings now? I try: list($a, $b) = blabla(); print($a); but it's won't work returning empty string. I tried also: $result = blabla(); print $result[0]; but it also won't work. The only thing I can do is to iterate result with foreach, then it works nicely, but how should I use the result of blabla() function without foreach? I just want to get to $a and $b.
|