Hello Khoa,

On 8 Jan 2004 at 0:13, khoa vo wrote:

> <--------index.html---------->
> <form action="action.php" method="POST">
>   Your name: <input type="text" name="name" />
> <input type="submit">
> </form>

That's fine, but that's not what you have up on your web space. Your form is pointing 
to 
action.html, not action.php.
 
> <--------action.php---------->
> #!/lusr/bin/php
> Hi <?php echo $_POST["name"]; ?>.

Ok, you don't need the first line (#!/lusr/bin/php), because this is a script for the 
web and 
will be processed by the web server. But you do need to save the file action.php with 
the 
".php" suffix. I've just checked your online pages and your form is being sent to 
"action.html", not "action.php", so the PHP code is not being processed, because your 
web server doesn't look for PHP code in HTML files.

I had a look at the source of your action.html file and it's like this:

<html>
Hi. Your name is <?php phpinfo(); echo $_POST["name"]; ?>.
</html>

The phpinfo() function is going to print a long list of information about PHP on the 
server, so you might want to remove that.

So, to recap, you need to change the action attribute in your index.html file to 
"action.php", and then rename the file action.html to action.php (and maybe remove the 
phpinfo() function while you're at it). That should do the trick.

Good luck,

Erik

Reply via email to