Jump to content

Getting value of a form object


shan_cool

Recommended Posts

[!--quoteo(post=349799:date=Feb 27 2006, 06:44 AM:name=shan_cool)--][div class=\'quotetop\']QUOTE(shan_cool @ Feb 27 2006, 06:44 AM) [snapback]349799[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi all,

I want to get a value of a text box in a same form.
how can i do it?

can anybody help me?
Thanks,
Shan
[/quote]

$_POST['text box name here'];
[!--quoteo(post=350145:date=Feb 28 2006, 12:20 AM:name=shan_cool)--][div class=\'quotetop\']QUOTE(shan_cool @ Feb 28 2006, 12:20 AM) [snapback]350145[/snapback][/div][div class=\'quotemain\'][!--quotec--]
hi,
Thanks for ur reply,It does not work.

shan
[/quote]

What are you trying to do with it? You have to press submit for PHP to get involved.

Assume the filename is "thisfile.php".
[code]
<?php
$name = $_POST['name'];
print $name;
?>
<form action="thisfile.php" method="post"><input name="name"><input type="submit"></form>
[/code]

This will print what ever you put in the field after you submit it. The page does have to reload.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.