Beginner question

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
ammd
Forum Newbie
Posts: 4
Joined: Thu Mar 30, 2006 11:57 am

Beginner question

Post by ammd »

I'm trying to learn PHP under IIS. I wrote this simple HTML file with a form that calls a PHP program:

Code: Select all

<html>
<body?

<form action="action.php" method="post">
 <p>Your name: <input type="text" name="name" /></p>
 <p>Your age: <input type="text" name="age" /></p>
 <p><input type="submit" /></p>
</form>


</body>
</html>
This is the file action.php:

Code: Select all

<html>
<body>
Hi 
<?php echo $_POST['name']; ?>.
You are <?php echo $_POST['age']; ?> years old.

</body>
</html>
The initial HTML file and action.php are located in the same directory: C:\Inetpub\wwwroot.

I open the HTML with Firefox, fill in some data, click the Submit Query button and the program action.php is called, showing the result. But when I try to do the same with IE, nothing happens when I click the Submit Query button. Not even an error message.

Any idea about what is going on? Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your body tag is malformed.
ammd
Forum Newbie
Posts: 4
Joined: Thu Mar 30, 2006 11:57 am

Post by ammd »

Stupid me!!! How didn't I see that!!! The problem is that neither Firefox nor IE showed any errors. Thanks!!!
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Trying to validate the page would have shown it ;)
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply