...

View Full Version : Setting a variable using a text box



Jay Vincent
11-22-2003, 12:53 AM
Hi, this could possibly be an obvious question, but I've just started learning PHP, so, yeah give me a chance :P.

What i would like to do is for the user to define what a variable should equal by typing it into a textbox.

eg.

If the user typed mobile phone into the textbox...
$variable="mobilephone";

or if the user type internet into the textbox...
$variable="internet";

You get the idea :)

Thanks in advance

JayV

Nightfire
11-22-2003, 12:57 AM
Once the form has been submitted by the POST method, you can use:



<?php
$variable = $_POST['textareanamehere'];
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum