DOS Commands
the command which would allow me to run DOS commands from PHP. I am not quite sure, but I remember `or ' allowing me to run commands. Also could you tell me what this process is called so I can learn more about it on the PHP website.
View 1 Replies (Posted: 11:23 am on Sep. 12, 2005)
Sponsored Links:
Related Forum Messages:
How To Run Commands In Php
I am trying to run a matlab script.(This script you can run from the command line by command 'matlab -r scriptname'). But when I use this command inside a system or exec I don't get any output, nor does the matlab opens and executes as it does in case of command line..I am doing like: <?php echo exec(' matlab -r scriptname'); ?>
Posted: 06-16-2007, 11:34 PM
View 5 Replies!
View Related
Set Of Commands
I'm writing my own blog software, and I just want to be able to stick some commands into the body of a post and have PHP do some actions based on them. so like if my post is: Today I took a walk and I didn't see anything interesting at all. Here's a picture of me taking a walk: [][]pic¦21[][] then php would automatically replace the last line with an image #21 from my database
Posted: 3:35 am on July 17, 2005
View 1 Replies!
View Related
AT Commands
Anyone any suggestions on sending AT modem commands to a mobile phone connected via Bluetooth, primarly to send SMS. How would you get php to send these commands AT OK AT+CMGF=1 OK AT+CMGW="+85291234567" Quote:
Posted: June 1st, 2007 09:35 AM
View 1 Replies!
View Related
Commands
I have PHP 5 and users upload images while they put some info and all of these data are deleted after some period of time, but i am just afraid in case of any error some images stay there in the server. So I want to know how to check its last accessed date and creation date and any info related to date, so i regularly check and delete when expired.
Posted: 2:53 pm on Sep. 24, 2007
View 1 Replies!
View Related
Commands To Php
//# Usage: lame -b 112 original.mp3 output.mp3 lame -b 112 ("/home/rmbsite/public_html/temp/" . session_id() . ".mp3" "/home/site/public_html/temp/112_" . session_id() . ".mp3");
Posted: August 24, 2007, 11:17:15 AM
View 9 Replies!
View Related
Multiple Commands
In my PHP code, I want to execute the following two commands: use mydb; select * from mytbl; Now, I can get it work with the following statements: $SQL = "use mydb"; $result = mysql_query($SQL ); $SQL = "select * from mytbl"; $result = mysql_query($SQL ); What I really wan to do is "something" like: $SQL = "use mydb "; $SQL .= "select * from mytbl;"; $result = mysql_query($SQL ); i. e. I want to concatenate the two statement and execute the query only once. Is there a way to do this with mysql_query (or with someother function)?
Posted: July 17th, 2005 07:11 AM
View 10 Replies!
View Related
Shell Commands
Is it possible to write a script that will run commands at a command prompt? say copying some files and changing ownership on some files, like an install script?
Posted: September 1st, 2003, 01:13 AM
View 4 Replies!
View Related
PHP Shell Commands
Some php applications store database passwords into files which can be read by the user www-data. So, a malicious user which can write php scripts could read those passwords. What should I do to prevent users from viewing those passwords?
Posted: Fri, 11 Jan 2008 03:15:23 UT
View 17 Replies!
View Related
Unix And Commands
I'm currently working on the intranet site for our company and i've been asked to create a site where the status of our unix server is been displayed. at the moment all admins have their own logon using AIX (v4) and using the command topas to display the idle and other info. what i want to do is create we php script that connects to the server using a logon and executing the topas command. i then want to display the idle process (but tahts not that importaint. i'll get to that when i'm able to connect to the server.
Posted: August 14, 2007, 11:13:56 AM
View 12 Replies!
View Related
Which Session Commands Do I Need?
I have a problem and I was told to check out the sessions part in PHP. What I want to deal with is the following : I have a PHP page with a form, where the user writes some data. These data are then written into a file which is then used in a system command as input for an external program (NOTE: The data MUST be written into a file, it cannot be done elsewhise, because the external program takes a file as input). The thing is that I must somehow create a file everytime a user enters data into the form, so I must learn something on sessions I think. since I don't have a login system or something like that, but just want to create a different file each time (with the session_id being part of it, so that the file is unique), which session commands do I need?
Posted: 02-27-2006, 07:08 PM
View 1 Replies!
View Related
Using Multiple Commands
How do you use all of these commands on a single insert entry? addslashes(), stripslashes(), htmlspecialchars(), htmlentities() how would you use it on something such as this: $result = mysql_query("UPDATE products SET mainContent = '$mainContent'"); Anyone have a clue?
Posted: 05-30-2006, 06:56 PM
View 7 Replies!
View Related
Mysql Commands
I installed mysql server on my winxp platform. To make sure i'm connected to the mysql server i wrote the following command in the dos window: Quote: program filesmysqlmysql server 4.1inmysqladmin -pmypass -uroot ping and recieved the following notification: Quote: mysql is alive which means: i'm connected to mysql.
Posted: 06-04-2005, 06:18 AM
View 7 Replies!
View Related
Run System() Commands
at the moment, i use a couple of cronjobs and wget to update some bits of the site, i would like to be able to specify a manual update by calling wget from an admin page. the system() call works correctly, but i get permission denied. because, i presume, apache doesn't own the directory i am wget-ting to. i can't chown the whole directory to apache.apache, because i need access to the directory for other users, (ftp). doesn anyone know a way around this?
Posted: 12:52 pm on Feb. 15, 2004
View 1 Replies!
View Related
System Commands!
I want to execute system commands through the functions provided by PHP (like exec, system etc) In the LINUX machine in my work, everything seems to be OK, when, for example, I write system `ls`; and I print it on the screen. In my home PC on the other hand, where I have winXP and the Cygwin platform installed, none of these works. 1) Is the Cygwin platform sufficient to run system commands or must I have LINUX machine? 2) Do I need to change anything in my php.ini file in order to 'activate' the system commands?
Posted: 10:05 am on Oct. 3, 2005
View 1 Replies!
View Related
HTML Commands
I'm seeking a way to rasterize (that is convert to a raster of bits) HTML commands. My belief is that I'd do this by directing the HTML to an off-screen window or port, and then asking to get back a JPEG or other image format of the bits of that window.
Posted: 07-28-2006, 07:27 AM
View 3 Replies!
View Related
System Commands
i'm running the following php script, and where i would expect it to create a file, test.txt, it doesn't. it isn't in the directory i am exectuting the script in, nor can i do cat on it not that i would expect to, since it doesn't exist: <?php print system("ls > test.txt"); print system("cat ls.txt"); ?>
Posted: July 16th, 2005 11:05 PM
View 2 Replies!
View Related
System Commands Via Web
I am attempting to build a web form that will be used to launch the below command. However, the backslashes for the command line options are giving me a headache. The web form will have inputs for each option such as Adminuser, Adminpass, Adminhost, Adminport, CMD etc. COMMAND LINE COMMAND: ftpconfig.exe /ADMINUSER=Administrator /ADMINPASS=password /ADMINHOST=localhost /ADMINPORT=31000 /CMD= adduser /server="Server1" /user=user1 /password=user1password EXISTING PHP CODE <? PHP if (($_POST[username] == "") || ($_POST[userpasswd]== "")) { header("Location: createuser.html"); exit; else { $result = $_POST[username]; ......
Posted: 08-13-2007, 01:58 PM
View 4 Replies!
View Related
Run Shell Commands With PHP
I want to run few shell commands with PHP. I need to run lsof i :<port_no> and kill all the process running on that port number. I tried" <?php $output = shell_exec('lsof -i :8080'); print "<pre>".$output."</pre>"; ?>
Posted: 12-05-2005, 04:39 PM
View 1 Replies!
View Related
Bug In System And Exec Commands
If PHP is running via a web server, and mutiple system calls are made within the script to another script, hundreds of processes are created. Here is an example: Script 1: <?php for ($i=1; $i<=5; $i++) { system("php script2.php"); } ?> Script 2: <?php exit; ?> The effect is the same (and more difficult to stop) when the system calls are made in the background. e.g. system("php script2.php >>/dev/null 2>>/dev/null &"); system("php script2.php >/dev/null 2>&1"); I have even tried calling a shell script, which in turn calls the second PHP script (both in the background), but it still causes lots of processes. The "exec" command is also affected. At first, I thought this was a problem with either Zeus web server of Fast CGI, but I have since tried it with Apache and normal CGI with the same effect. Does anyone have any idea why this happens and whether there is any way to prevent it? I have posted a bug report to bugs.php.net (ID 14997), but so far to no avail.
Posted: January 21st, 2002, 09:27 AM
View 1 Replies!
View Related
Telnet & Run Commands Thru Http
I need do open a telnet session from a web page then pass a set 3 sets of command to it with a 5 second delay between each command the last command is to exit and close the telnet window I really need help will this I have heard it can be done by sockets but iI have not used it before.
Posted: August 22nd, 2001, 03:28 AM
View 2 Replies!
View Related
MySQL Commands With Require()
Just wondering if it is possible to run MySQL commands through a require() include file. I have a header for a page that includes some MySQL queries and such. I want to do a if/then, based on some variables, to display different headers with different MySQL commands for the same page...instead of making 10 different pages. But when I include, with require(), anything with MySQL commands, the page won't work at all. Any advice? Thanks.
Posted: July 25th, 2002, 04:08 PM
View 1 Replies!
View Related
Displaying Shell Commands
How would I display a information on my website identical to how it would look if i typed it on a shell? For example, if I type df at the shell it puts each different partion on its own line. If i do: system("df"); It all gets jammed in to one line.
Posted: May 14th, 2001, 09:57 PM
View 1 Replies!
View Related
File Upload Using Ftp Commands
Because of limitations of my provider, I am forced to use the ftp functions to upload files to my server (the permissions on the server will not allow me to load files via php). I have successfully ported the sample code from php.net to do everything BUT upload the file. I can connect. I can log in. I can change directories. But the file never uploads. As I note in the code, I have tried using ftp_put with the local filename, and I have tried using ftp_fput with the file in /tmp/php with no luck. Suggestions are welcome. Code: ( text )
Posted: July 17th, 2005 04:03 AM
View 3 Replies!
View Related
How To Execute Two Commands Within 'system'
On PHP4, I want to execute these two system commands: # cd /home/foo1/foo2 # /usr/local/php/bin/php /home/foo1/foo2/script.php If I do it via shell, it works ok. But If I do: ------- system("cd /home/foo1/foo2/", $retval); system("/usr/local/php/bin/php /home/foo1/foo2/script.php", $retval); -------- I get this error message: ----- Fatal error: main(): Failed opening required '../config/config.php' (include_path='.:/usr/local/php/lib/php') in /home/foo1/foo2/script.php on line 2 ----- This error is caused by the fact that the script is not executed in the right directory.
Posted: February 14th, 2006 04:55 PM
View 2 Replies!
View Related
Getcwd() And Opendir() Commands
Ive got this PHP gallery script that reads the folders in a directory via the 'getcwd()' command to generate a gallery. I'm trying to link this gallery into my main file, via inlucde: the index file is in the root dir, /home/firestar/public_html/ and the gallery file is in the images/gallery/ folder. Ive tried changing the opendir to different dir, but the script doesnt work unless its in the gallery folder! If that sounds a bit strange, heres the script:
Posted: 1:54 pm on Dec. 29, 2004
View 1 Replies!
View Related
Calling Commands Using EXEC
I'm trying to call the command taskkill in a script of mine. the code looks like this exec("taskkill /f /s $compname /im iexplore.exe", $output); As far as i can tell the code is doing nothing, it doesn't throw up any errors but it doesnt work either. I have tried replacing the variable $compname with the actual computer name but this dosen't work either.
Posted: November 30, 2007, 10:36:54 AM
View 4 Replies!
View Related
FFMPEG Exec() Commands
I'm relatively new to PHP and am creating a website which will take uploaded files and convert them to FLV files for quick viewing using an FLV player. It is similar to YouTube. After a successful upload I hope to first convert the video file to FLV, and then create a thumbnail from the FLV file. In my upload script, the two commands follow eachother: exec("Video to FLV Conversion"); exec("Thumbnail creation"); The video converts always, and on very small videos (below 500k) the thumbnail creation works as well... but for larger files, the thumbnail creation does not execute. But if I run only the "exec('Thumbnail creation');" after the FLV has already been converted, it creates the thumbnail. My thoughts are that the Thumbnail exec() starts before the FLV Conversion exec() is completed. Is there a way to ensure the first exec() finishes before continuing through the script? I could also try merely taking the thumbnail from the initial video file (non-FLV) and it may work fine... but I thought I'd ask here first as I've read some complications creating thumbnails from several types of video files.
Posted: July 24, 2007, 07:51:08 PM
View 1 Replies!
View Related
Executing Commands (linux)
I'm not really sure the best way to appoach this but basically i want to be able to run game server commands in a specific linux account eg. 'screen -A -m -d -S hlds_server1 ./hlds_run -game cstrike -autoupdate +servercfgfile server1.cfg &' I want to run this off a different liux account (not root) i tried using the search on the forum but want really sure what to search for so i didnt get very far. Whats the best way to go about this? can i use shell_exec() and login to my other accout and run these commands? i have tried this but couldnt figure out how to login to my other account. i would preferable like to beable to do this remotely (but atm my http server is run on the same server as the server i run my games off) so might the way to use sockets and connect through ssh port? and send the commands through that?
Posted: 5:45 am on Jan. 18, 2005
View 1 Replies!
View Related
Sh And Psql Commands From Exec()
I'm having problems with exec(). I'm trying to execute a shell script that executes psql command to dump results to a CSV file. exec('/bin/sh /path/csv.sh'); csv.sh executes /usr/local/pgsql/bin/psql -d dbname -u user -f /path/output.postgresql (output.postgresql is the file that has some queries to output the results of a select statement to an output CSV file.) while this works on my local machine (Intel Mac OS X 10.4, Apache 2.2, PHP 4.4.3) it fails to run on FreeBSD (Apache 1.3, PHP 4.4.2). it seems like the user "nobody" running the Apache Web Server is failing to run the commands using the exec() function. I'm guessing that the reason why it's failing is that the psql is asking for a password, but I cannot place the .pgpass file since nobody has no home directory. Also I haven't tried the NOPASSWD for nobody in sudoers file. I'm not sure if this is a good idea since apache can then run any sh and psql commands from exec().
Posted: 09-15-2006, 08:21 AM
View 2 Replies!
View Related
No Mysql Commands Will Works
i just installed apache 2.2 php 5 mysql 5 and when i write a php file and have any mysql commands the script like jumps right over them and ignores them this is really wierd because i have phpmyadmin installed and that is working fine with both php and mysql becuase i am reading and writeing data with it. theres got to be a setting wrong somewhere in my server or something. anyone have any ideas?
Posted: July 24, 2007, 04:13:18 PM
View 2 Replies!
View Related
Applying Three Commands To The Same String
All I'm trying to do is keep this string under 36 characters, stop all caps screaming, and then ensure the first letter of each word is uppercase. Here is the code as I figured it should look. $mail['shortsubject'] = trimtext($mail['subject'], 36) && ucfirst($mail['subject']) && strtolower($mail['subject']);
Posted: 1:16 pm on Dec. 29, 2005
View 1 Replies!
View Related
Multiple Database Commands
is it possible to send mysql a command of this sort? PHP Code: SELECT * FROM databaseone.tableone, databasetwo.tabletwo WHERE databaseone.tableone.idfield = databasetwo.tabletwo.idfield AND databasetwo.tabletwo.field = 'abc'
Posted: 03-14-2007, 06:34 AM
View 1 Replies!
View Related
|