Executing A Program Remotely With PHP
I need to be able to make the user be able to click a button, which then launches a batch file on my computer.. But passthru() doesnt do the job anymore. And is faulty.. My computer is the server, so it'd also be nice if the command could launch it in a windowed form instead of a background process Here's my code:
View Complete Forum Thread with Replies
Related Forum Messages:
Executing A Program
I am trying to run a console application which needs to keep running even after the php script has finished executing. I also need the PID or some sort of handle I can use to kill the program at a later stage.
View Replies !
Executing A Remote Program
it involves a game server a remote database server (running PHP 4 and Mysql latest). The problem is - we have a coded plugin for the game server to run a PHP script on the remote server and save some data to the mysql. What I then need to do is send the data back by running a program with a command string on the game server via the PHP. If that nmakes sense. Code:
View Replies !
Exec Command Executing The Program In The Background
i am running xampp on my computer from apachefriends.org, it's a apache server this is the php script <html> <head> <?php exec ('notepad'); ?> </head> </html> but when i execute the php script on my computer , notepad doesnt not run i used a process viewer and discovered that notepad is running in the background and i cannot see it does anyone know how NOT to make it run in the background? i wan to see the notepad window on the apache server (my computer)
View Replies !
How Can I Include PHP Remotely?
If I have say a plain text file on a server containing 'phpinfo();' And I wanted a PHP on another server to read that string and executing it as a PHP. I saw some pages sometime ago that has a working code to implement that. I was like "Interesting. But I have no need for that....click onnnn" so I surfed away without bookmarking. Now that I need it I couldn't find that page.
View Replies !
Getting Images Remotely
I have a problem concerning the time for getimagesize remotely. I've searched with google and found here a post ( of ianevans ) on this topic whith a solution to the problem, that is, to copy the file on local machine and then try getimagesize function. $asin = "0788815709"; $url = http://images.example.com/images/P/".$asin.".01.MZZZZZZZ.jpg"; $filedata = ""; $remoteimage = fopen($url, 'rb'); if ($remoteimage) { while(!feof($remoteimage)) { $filedata.= fread($remoteimage,1024); } } fclose($remoteimage); $localimage = fopen("/tmp/".$asin.".jpg", 'wb'); fwrite($localimage,$filedata); ........................
View Replies !
PHP Source Remotely
my friend today showed me that he can look at all the sources on my server. He never was in cPanel or anything so I was wondering, how exactly he is doing. According to file promissions and my logic I don't see how he could but even when I uploaded something random it took him less then a minute to post me the entire source.
View Replies !
Using MS Access DB Remotely
My client has an EPOS system, albeit a rubbish one which runs from a ms access database. Currently, they have a report which exports current stock, they save this as a csv file, and they are able to upload to our application which parses the data. I want to make this process a whole lot more automated, so im thinking that if i could set up an odbc connection on the server. I would be able to query that database remotely, using one of the odbc libraries. If this ISNT possible, can you think of another way i might make an access database on a remote windows 2000 server available to a linux webserver? File transfer isnt an option, the database is somewhere in the region of 600 meg.
View Replies !
Using A Database Remotely
I would like to know if there is anyway to use a database from a webpage root into another diferente webpage. The thing is i have a real estate webpage and i want go provide acess of my webpages in some ressellers afilliates.
View Replies !
How To Authenticate Remotely
There is an html form on a remote site with the fields: Username, password. I can visit the website, and login successfully. However, I'm wondering if it's possible to login without visiting the website. In other words, can I create a similar form on a remote server, and do a remote POST? I've tried the following code, but it doesn't log me in. It simply returns to the login form. Code:
View Replies !
Capture Images Remotely With PHP
I am just wondering if capturing an image remotely with php is doable ? I am working on a project for my department where I need to write php code to capture an remote image and save it to a local folder/web site directory given an image's URL. Have anyone done anything like this ? If you have, do you mind share your ideas/sample code ?
View Replies !
Creating Files Remotely
I'm trying to do here is write 2 files simultaneously to both the local server and a remote server on which I have write access. In the process, however, I was stuck at how to create the file initially on the remote server. I tried using touch() which works well locally to create a blank file, but I get an error: Warning: unable to create file http://198.78.114.67/news/tech/20010718-1820.dat because No such file or directory in /home/httpd/html/makepost.php well, I take it touch() only works locally, so, any idea guys?
View Replies !
Mysql Accessed Remotely
I want to know how you can access a remote mySQL database from a php script. Also how can I connect to a remote mysql database from mysql administrator?
View Replies !
Getting Amazon Images Remotely...slow
I'm working on a script to load my database up with some product info from Amazon's AWS. As you may know, the AWS does not return dimensions with the image url. I tried using getimagesize on the remote URL, it would literally take over a minute per image. I used a script at from O'Reilly's hackbook (#477) to cache the .jpg locally and then getimagesize it. Here it is: Code:
View Replies !
Opening Text File Remotely
I need to remotely (not sure if this is the correct term) open and read a text file, then display that information in a web page. Not sure how to do this. I have tried this on a text file on the same server with no problem, but how do I access a file on a different server? Code:
View Replies !
Script Executes Differently When Triggered Remotely
I have a PHP script that is triggered by a .forward file when incoming email arrives. When triggered, the script retrieves the email using the php imap functions, processes the email, and then deletes it and empties the inbox before exiting. This setup worked fine whether the script was triggered by an incoming email or manually via shell.....
View Replies !
Locally Works/remotely Breaks? (Oracle Related?)
I'm diving into this crazy PHP thing, and I find myself a bit stuck. Locally I can get a site to work very well. However, whenever I ask a buddy of mine to test the site and I give him my IP it doesn't work. I have a form. The form checks username/password against a database and then either sends you back to the form or forwards you to the next page. Is: header("Location: http://localhost/nextpage.php"); the proper form of redirection? The issue on the not at my computer logins is in this redirect. I'm not sure what I need to send, but I was getting connection errors in the beginning which aren't showing up anymore. Then I was getting unreferenced index errors, but I put all the variables in a session and that seems to work now. And now I'm stumped because I'm not getting errors in the log.
View Replies !
And Mysql - Connect Remotely To A Mysql Database.
I am trying to connect remotely to a mysql database. here is the code: <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_myDB = "http://db195.perfora.net"; $database_myDB = "dbname"; $username_myDB = "username"; $password_myDB = "password"; $myDB = mysql_pconnect($hostname_myDB, $username_myDB, $password_myDB) or trigger_error(mysql_error(),E_USER_ERROR); ?> here is the error: Warning: mysql_pconnect(): Unknown MySQL Server Host 'db195.perfora.net' (1) in /oldhome/WWW/wingsofthedawn.org/htdocs/final/Connections/myDB.php on line 9
View Replies !
Sessions? External Program / External Program
I am trying ac ouple of days now to learn some things on SESSIONS,but I think I am not getting it very clearly. I have a PHP page tha contains a form. Users enter data in the form, which are then written in a file (the file is created at the time a user enters some data) The file is then given as an input to an external program The external program runs and gives some results which are then stored in another file (that is created when the external program finishes) What I want to do is to somehow create these files and, when the user exits from the browser, then both files that refer to this user, will be deleted. Code:
View Replies !
PHP Not Executing, IIS 6
I'm attempting to run PHP on Microsoft IIS 6.0, and the PHP will not execute. For Example: test.php: <? phpinfo(); ?> When I request http://localhost/test.php I get a blank page. When I view the source, I get: <? phpinfo(); ?> Any ideas what I am doing wrong? Any resources that could guide me through the install process? The .php extensions are setup correctly (I believe) in IIS.
View Replies !
PHP Executing Twice
I am facing very strange problem When I submit any form using 'POST' method. my script executes twice. Is this a PHP bug or some thing else. I am using PHP4.3.1, MySQL 4.0.1, Apache2.x.x in Windows 2000 professional.
View Replies !
Executing JSP In PHP
I have a form processing script in php which submits data to email and a database, that works fine. However before it does that i need to create a secure hash from a jsp file. Im at a loss as to how to do this. Would the best bet be to use SOAP or similar, and if so would anyone be able to give me any pointers, i haven't indulged in web services as yet.
View Replies !
Executing Js From Php
I'm using CURL to navigate to pages on another website. There are links on the website which I need to navigate to that are created by submitting javascript, ie: <a href="javascript:blah">. Is it possible to use curl to execute these links and return the resulting page?
View Replies !
Not Executing (sometimes)
I run a message board site that has been having technical problems lately. Today I upgraded my version of php via an apache build in cpanel (now on php 5.0.x - but that doesn't seem to matter). When I access .php files that don't rely on a database, they run. However, all the .php files that use my MySQL database don't execute and prompt my browser to download. I should mention that I tried to upgrade MySQL today too. I was using 4.0 and upgraded to 4.1.
View Replies !
Executing An SSI Within A Php File.
I have the following line in an old shtml file: <img src="http://www.domain.com/cgi-bin/logtrack/log.pl?ref=<!--#echo var="HTTP_REFERER"-->" width=1 height=1 border=0> What this does is execute log.pl with the refererer to increment a logtracking program and find out what their referer is. How would I go about porting this to php?
View Replies !
Executing Scripts...
How do I execute one .php3 script from another. Passing one or two arguments, and then receiving the output? I have tried using the exec and passthru function, with no luck.
View Replies !
Executing Chunk Of SQL
I'm attempting to write an install script, I'm using the ADODB abstraction layer with my script, with that said here is my problem. I've got a large chunk of SQL that I need to execute through PHP, so I put it in a variable like so: $db_sql = " DROP TABLE IF EXISTS im_categories; CREATE TABLE im_categories ( id tinyint(11) NOT NULL auto_increment, name varchar(100) NOT NULL, type varchar(100) NOT NULL, template varchar(200) NOT NULL default 'default', PRIMARY KEY (id) ) TYPE=MyISAM;"; Then I try to execute it using: $result = $db->Execute($db_sql) or die(vpError() . $db->ErrorMsg()); I get the following error every single time and I have no idea what is causing it, the SQL data is from a phpMyAdmin export by the way. PHP Code:
View Replies !
Ajax Not Executing Php
When a user clicks a link I have it open up a file in a div using ajax. my code is <a href="#Find" onclick="javascript:jah('Find.html','content');">Find</a><br /> Where Find.html is an html file on the server. Now when I do this everything works fine except php code is not being executed. The jah code is function jah(url,target) { // native XMLHttpRequest object document.getElementById(target).innerHTML = 'sending...' if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = function() {jahDone(target);}; req.open("GET", url, true); req.send(null); // IE/Windows ActiveX version } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = function() {jahDone(target);}; req.open("GET", url, true); req.send(); } } } function jahDone(target) { // only if req is "loaded" if (req.readyState == 4) { // only if "OK" if (req.status == 200) { results = req.responseText; document.getElementById(target).innerHTML = results; } else { document.getElementById(target).innerHTML="jah error: " + req.statusText; } } }
View Replies !
Executing Applicaitons
is there any way to execute desktop applications under a web interface using php? I need to get a non-finite amount of users to be able to execute a learning course program and use it remotely using a web interface.
View Replies !
Executing A .bat File With PHP
I have a .bat file that copies certain files across a network and I needed a way to run this file using PHP. I was looking at exec() but I was not sure exactly how to use it. I was also using pstools but could not get them to work with PHP. Can someone give me an example of how to do this or send me somewhere where I can read up on this?
View Replies !
Executing A Variable?
If a variable stores a function, could I execute the function by typing the variable alone? Or maybe by echoing it? <?php /* Set variable */ $math = round(23.89); /* Execute variable? */ $math; /* Echo variable? */ echo $math; ?>
View Replies !
Executing Php As An Application
Does anyone know of a program out there that has php bundled into it? I have ran into a few php editors that actually execute php right there on the system with only a php.ini file. So, I know there are ways to do it..I just need a direction to look in.. Any ideas?
View Replies !
Executing A PHP Function
I have a function, function output($output) { echo $output; } I have a variable, $myvar = 'This is my variable. The output is X' How do I combine the two? I've tried: $myvar = 'This is my variable. The output is' . output("this thing"); But no such luck.
View Replies !
Executing PHP In A Variable?
I'm doing a file include as: <?php $content = file_get_contents(TEMPLATEPATH . '/somefile.php'); echo $content; ?> In somefile.php, there is PHP code. How can I execute the code once $content is displayed as above?
View Replies !
Executing A Query
let's say I have this query PHP Code: SELECT data.*, art.* FROM `comic_pages` data, `artwork_picture` art WHERE data.art_id = art.uid however both comic_pages and artwork_picture contains an 'uid' field, and I need both uids. I've made up this function, but I think it's kinda hacky (and slow, taking over 6x the speed of a normal mysqli_fetch_assoc in this case) PHP Code: function db_multi_fetch_assoc ($result){ Â Â Â Â if (!is_object ($result))return false; Â Â Â Â for ($x = 0;@mysqli_field_seek($result,$x);$x++){ Â Â Â Â Â Â Â Â $field = mysqli_fetch_field ($result); Â Â Â Â Â Â Â Â $arr[$x] = $field->table.'.'.$field->name; Â Â Â Â } Â Â Â Â $data = mysqli_fetch_row ($result); Â Â Â Â Â Â Â Â for ($y=0;$y<$x;$y++)$out[$arr[$y]] = $data[$y]; Â Â Â Â return $out;
View Replies !
Executing A Php File
I'm trying to execute a php script on my linux server whenever I view a different page. So far this is what put on that page: PHP Code: <?php exec('php  /var/www/html/execute.php'); ?> I am trying to be logical with how linux executes php and the path to the file I wish to execute. But this was a best guess. So far it isn't doing anything, but I'm also getting no errors in the logs.
View Replies !
Executing Javascript From Php
I'm running a popular PHP forum on my server and wish to add a little holiday cheer to it, via javascript encoded bats that fly around your mouse pointer. Silly, yes I know, but I figured it would help me become a better programmer if I could only figure out how to execute the JS from my index.php. Can I simply cut and paste the javascript into the php somewhere and hope for the best, or is this going to be a difficult task? And, I'm using the PHPBB to run my forum. Any help would be greatly appreciated. (warning, I am sorta new at programming php).
View Replies !
Don't Stop Executing Php
There is an php function, i saw it but i can't remember it's name. When you close the page, or stop loading page, php continue generating the page. What is the name of function :/? Do you know?
View Replies !
Executing PHP In Wikimedia
Does any one have idea regarding the equivallent code for Php script in wikimedia. Presently I have developed a small application in PHP. I shud place my application in wiki. I 'googled' and 'wikied' hard to know the procedure to place my PHP script in wiki But Unable to understand nothing.
View Replies !
Get Executing File
Is it possible for php to tell the path to the file (php path, not html) that is currently executing? What I mean is, if I include() a file and in that included() file I call $_SERVER["PATH_TRANSLATED"] I get the path to the file that the include() is called in, not the path of the included() file that calls $_SERVER["PATH_TRANSLATED"].
View Replies !
Executing PHP Code With PHP
I'm making a script that will allow me to have multiple layouts and have a layout selector for the end-user. I'm attempting this with SQL and the script works with plain html, however I want to have php in the layout code from mysql and have it work but it wont work. Is it possible to do what I want to do with MySQL? Here is my code: <?php if(@include("config.php")) { $sqlconnect = mysql_connect($mysqlhost, $mysqluser, $mysqlpass); mysql_select_db($mysqldb, $sqlconnect); $grabinfo = mysql_query("SELECT * FROM xaler_info"); $info = mysql_fetch_array($grabinfo); extract($info); if($_COOKIE[layout] == "") { $code = mysql_query("SELECT * FROM xaler_layouts WHERE name='$defaultloc'"); while($source = mysql_fetch_array($code)) ..........................
View Replies !
Executing Php Statements
on my website(It is secure and only accessible to me) I have a form with a text area. I enter php statements there, such as last_modified() so I can see the result, than I click Execute. Here is where I am stuck. I need to take the post data from the textarea and execute it as php. Any idea how I can do this?
View Replies !
Executing From A Database
Store content (html and php) in a database, so far this hasn't been an issue. When I called the content from the database its displayed properly with the exception of php commands (specifically include() ). Rather then executing the include statement its printed as HTML in the source code of the document. I found one post on a PHP User Group board but the solutions provided don't seem to really work. I'm almost guessing that this is a security feature and although I'd prefer not to circumvent it, it would greatly help in what I'm trying to accomplish.
View Replies !
|