PDA

View Full Version : Running a PHP script in CGI mode?



pmatt
08-27-2003, 02:28 AM
A friend and I are trying to set up a simple registration script for her organization. For her own reasons, she'd like to keep the signup form on its original server, and maintain the actual database here. She also prefers to use PHP, rather than Perl.

After some trial and error, I've come to find out that this isn't as easy as it looks. The tutorial I found for this (http://www.ku.edu/~acs/docs/other/cgi-with-php.shtml) says to include a line like #!/path/to/php, but a post on this forum by Joe seems to indicate that there's no standalone PHP executable here, just the support that's compiled into Apache. No matter how I try to execute this script as a CGI, I keep getting an Error 500.

So my question is, is it possible to run a PHP script as a CGI, which is called by (and gets its variables from) a form on another site? If so, how would I go about this? I'll be grateful for any help you can provide.

eugene
09-01-2003, 10:01 PM
There is no need to run it as a cgi.

Simply create your somename.php file.
Then modify the action attribute of the form on the html page on the other server:
</div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>HTML </td></tr><tr><td id='CODE'><form action="http://yourdomain.com/somename.php" method="POST"></td></tr></table><div class='postcolor'>

-Eugene
Private message me if you need help.