Re: [PHP-DB] executing system commands
Get a look at the PHP manual on www.php.net or mirror, annoted version, command : system, there is a good example. regards B. le jeu 25-10-2001 à 12:46, Ric Manalac a écrit : hi, i'm a newbiew php developer. i'm trying to execute a system command in one of my php scripts. what i would like to do is to create a directory. my code goes like this: // chunk of code starts here $directory = generate_sessionid(); $command = mkdir /home/httpd/html/miroku/downloads/$directory; system($command, $dirsuccess); // chunk of code ends here generate_sessionid() is a function that generates a string that contains 16 random integers (0-9). i want to use that random string as the name of the directory that i'm creating. i checked php3.ini if safe mode is on but it is set to Off. thanks in advance! regards, ric -- == Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient,or an employee or agent responsible for delivering this to the intended recipient,you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] executing system commands
hi, i'm a newbiew php developer. i'm trying to execute a system command in one of my php scripts. what i would like to do is to create a directory. my code goes like this: // chunk of code starts here $directory = generate_sessionid(); $command = mkdir /home/httpd/html/miroku/downloads/$directory; system($command, $dirsuccess); // chunk of code ends here generate_sessionid() is a function that generates a string that contains 16 random integers (0-9). i want to use that random string as the name of the directory that i'm creating. i checked php3.ini if safe mode is on but it is set to Off. thanks in advance! regards, ric -- == Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient,or an employee or agent responsible for delivering this to the intended recipient,you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] executing system commands
Does your web-host permit you to execute system commands? For system security, most will not. -Original Message- From: Ric Manalac [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 5:46 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] executing system commands hi, i'm a newbiew php developer. i'm trying to execute a system command in one of my php scripts. what i would like to do is to create a directory. my code goes like this: // chunk of code starts here $directory = generate_sessionid(); $command = mkdir /home/httpd/html/miroku/downloads/$directory; system($command, $dirsuccess); // chunk of code ends here generate_sessionid() is a function that generates a string that contains 16 random integers (0-9). i want to use that random string as the name of the directory that i'm creating. i checked php3.ini if safe mode is on but it is set to Off. thanks in advance! regards, ric -- == Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient,or an employee or agent responsible for delivering this to the intended recipient,you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] executing system commands
Try to avoid system commands whenever you can and instead use PHP functions when they're available. In this case, you can use the following function mkdir: http://www.php.net/manual/en/function.mkdir.php What is the problem you're having with that system command? The most frequent problems stem from lack of permissions in a directory that you're trying to manipulate. i.e. You try to add a file to a directory, but it gets rejected mysteriously - the most likely cause is that the directory is owned by someone else and you don't have write permissions. The other frequent problem stems from not defining the path to a command, i.e. system(mycommand); instead of system(/usr/bin/mycommand); Hope this helps if you're having problems. - Jonathan -Original Message- From: Ric Manalac [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 3:46 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] executing system commands hi, i'm a newbiew php developer. i'm trying to execute a system command in one of my php scripts. what i would like to do is to create a directory. my code goes like this: // chunk of code starts here $directory = generate_sessionid(); $command = mkdir /home/httpd/html/miroku/downloads/$directory; system($command, $dirsuccess); // chunk of code ends here generate_sessionid() is a function that generates a string that contains 16 random integers (0-9). i want to use that random string as the name of the directory that i'm creating. i checked php3.ini if safe mode is on but it is set to Off. thanks in advance! regards, ric -- == Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient,or an employee or agent responsible for delivering this to the intended recipient,you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]