Re: Php in Cgi

From: Date: Wed, 08 Dec 2004 18:18:29 +0000
Subject: Re: Php in Cgi
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-203746@lists.php.net to get a copy of this message
Peter Law wrote: > I am learning Php and have a web site host where scripts have to be in the > cgi-bin. What is put in the original web page to call a script from the > cgi-bin? The info from the web host is below. Something like this may be useful to you: Make two files. Name one of them: form.html Put this in it: <HTML><BODY> <FORM ACTION="/cgi-bin/form_processor.php" METHOD="POST"> <INPUT NAME="name"><BR> <INPUT TYPE="SUBMIT" VALUE="What's your name?"> </FORM> </BODY></HTML> Name the second file: form_processor.php Put this in it: <?php if (isset($_POST['name'])){ ?> Hello, <?php echo $_POST[name]?><BR> Welcome to my website! <?php } ?> Now, upload the HTML page to the HTML part of your site, but put the PHP page in your cgi-bin part of your site. Visit the HTML page, and it *SHOULD* invoke the PHP page when you submit the form. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#203746) next »