hello! i have a problem passing data from one page to another. I made two sample pages:
//getname.html
<html>
<body>
<form action="handler.php" method="get">
first name: <input type="text" name="FirstName">
<input type="submit" value="submit">
</form>
</body>
</html>
//handler.php
<html>
<body>
<?php
print "hello $FirstName";
?>
</body>
</html>
after pressing the submit button on the first page, i get redirected to the second. in the second page, instead of dipslaying hello paul, i get an error saying that the variable $FirstName is unknown. I'm using microsoft IIS. I already installed php to it. It also has asp.net. Asp.net works fine. do you think my problem is because of having these two on one server? Or do I just have to configure something in my server? thanks!
query strings
Moderator: General Moderators
-
Paddy
- Forum Contributor
- Posts: 244
- Joined: Wed Jun 11, 2003 8:16 pm
- Location: Hobart, Tas, Aussie
- Contact:
You were almost there. Put
Above <html> in your handler.php file. You must get the submitted info before you can use it.
Code: Select all
<?php
$FirstName = $_GET['FirstName'];
?>and read Sticky: Before Post Read: Concerning Passing Variables in PHP 4.2+
it's not a sticky thread for nothing
it's not a sticky thread for nothing