...

View Full Version : Implanting Vars.



Meltdown
04-08-2003, 01:45 AM
How would I take a form field var. which was posted by a user and implant it into a page?

Jason
04-08-2003, 02:50 AM
use the _POST to get the var into a PHP variable...


Jason

fractalbit
04-08-2003, 03:44 AM
If you have a form field that look like this :

<input type=text name=username>

Then, after the form has been submitted you can access the value submitted like this :

The data you submitted is <?php echo $_POST['username'] ?>

or <?php print "The data you submitted is {$_POST['username']}" ?>

Note that you have to use {} when accessing the variable inside quotes.

Meltdown
04-09-2003, 10:18 PM
thank u both very much but one more thing...i need to know how to add cookies to remember the info posted..:confused:

Nightfire
04-09-2003, 10:19 PM
Never worked with cookies, but you might wanna check here http://www.php.net/setcookie

Meltdown
04-09-2003, 10:21 PM
ty..very fast response

Meltdown
04-10-2003, 02:21 AM
ne other suggestions

duniyadnd
04-10-2003, 06:29 AM
A major problem I had with setcookie function was that I didn't realize it was supposed to be on the VERY top of the page, even
spaces count. Make sure that is the case for you otherwise it will generate errors.

Duniyadnd

Meltdown
04-10-2003, 12:42 PM
thanks..thats probably my problem



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum