Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
09-15-2005, 08:56 AM #1
- Join Date
- Apr 2005
- Lahore, Pakistan
- Thanked 0 Times in 0 Posts
problem while access value to other page
here is a simple code, which retrieves size from database. Size is stored in string format which is "M-L-XL-XXL".
i use the explode function, and store all the sizes in combox like M, L , XL and XXL are seperatley.
i want that when i press the submit button, then it will transfer that values of combox, which i selected. kindly help me in this regard.
here is the code
$query = mysql_query("Select * from newproductinfo where pid=$pageid",$db) or die ("Error");
while ($result = mysql_fetch_array($query))
echo"Size: <select name='select'>";
$sizes = explode("-",$size);
// echo"<input type='hidden' value='L' name='size'>";
plz help in this regard
09-15-2005, 10:13 AM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,659 Times in 2,628 Posts
I responded to your other thread about creating these option values easily.
Also, please wrap your code in [php] tags so its easily readable.
With this, you need to do something with the values selected. Create a form:
or whatever you need.Code:<form action="process.php" method="post"> <select name="selectbox"> <options /> </select> <input type="submit" name="submit" value="Submit" /> </form>
Process.php then retains the values of these fields within the $_POST superglobal. Always refer to this as a $_POST field -> never rely on register_globals bein 'on' as most hosting companies are defaulting these to 'off' (which is good).
Your output would be whatever has been selected on the form. Watch out for evaluations though, textfields will get you as isset() always returns true, whether the fields are populated or not.PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');