Click to See Complete Forum and Search --> : [RESOLVED]PHP retrieve textbox value
Osiris
Aug 19th, 2005, 10:25 PM
is there a way to retrieve a textbox value with PHP ?
for example...
<input type=textbox value=1 name="box">
is there a way to get the value of "box" into a PHP variable?
ninjanutz
Aug 20th, 2005, 01:08 AM
yea in a php script type
<?php
echo $_POST['box'];
?>
this sends the value of "box" to ur web browser. in order to process the form to the way u want it u could either use conditionals, etc...
{yak}
Aug 20th, 2005, 01:08 AM
You can access it through the $_POST (http://www.php.net/manual/en/language.variables.external.php) superglobal:
echo $_POST['box'];
ninjanutz
Aug 20th, 2005, 01:09 AM
in order to use $_POST the form method must be post u could also use form methof get and $_GET (get appends the information to the url and wen u call it it takes it straight from the url
Osiris
Aug 20th, 2005, 08:41 AM
yea in a php script type
<?php
echo $_POST['box'];
?>
this sends the value of "box" to ur web browser. in order to process the form to the way u want it u could either use conditionals, etc...
But in order to do this you would need a form, a submit button and a change of url... what i was thinking of was getting the value of a textbox without changing the url and without having a form and without submitting anything. Is there a way?
Osiris
Aug 20th, 2005, 10:54 AM
I don't know if there is a way since the values are client side and php is server side, but I ended up putting everything in a form and submitting it via submit button...
thanks everyone
ninjanutz
Aug 20th, 2005, 03:45 PM
yea i dun think its possible with a form
ninjanutz
Aug 20th, 2005, 03:46 PM
without*
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.