Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Something so simple

Status
Not open for further replies.

SuaveRick

Programmer
Apr 12, 2004
142
CA
This must be a config problem I'm having, I'm just trying to get the value of a form field over to a php page and print it out.... but it doesn't work at all, so simple but nothing works: have a look, like I said, so simple:
INDEX.HTML:
<html>
<body>
<form method='post' action='index2.php'>
<input type='text' name='name'>
<input type='submit' value='submit'>
</body>
</html>

INDEX2.PHP:
<html>
<body>
<? print "this is name:".$name; ?>
</body>
</html>

OUTPUT:
this is name:

So I go, "what the heck??"

Thanks!
 
Try:

<? print "this is name:" . $_POST['name']; ?>

You submitted the form with the post method, so all your form element values are in the $_POST[] superglobal associative array.

Lee
 
Yup register_globals is off, I knew it had to be a config setting.

Thanks for the help guys, that fixed it up!!

Suave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top