display chosen option onto another webpage
Moderator: General Moderators
display chosen option onto another webpage
hi all, i have a form with few options. what i am trying to do is display the option chosen from the user onto another page..i have the form setup up but what do i code to display the chosen option on the second page??
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: display chosen option onto another webpage
Let's see your form.
This is how you get POSTED form elements:
This is how you get POSTED form elements:
Code: Select all
if(isset($_POST['submit']))
{
$firstName=$_POST['firstName'];
}
Re: display chosen option onto another webpage
this is the 1st page..this works
2nd page...cant get the options to display
Code: Select all
<form method="post" action="nextPage.php">
<p align="center">
<input type="text" name="txtInput" size="20" />
<input type="submit" name="btnSubmit" value="Submit Data" />
</p>
<p align="center"> </p>
<div align="center">
<table width="200">
<tr>
<td><label>
<div align="center">
<input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_0" />
Radio</div>
</label></td>
</tr>
<tr>
<td><label>
<div align="center">
<input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_1" />
Radio</div>
</label></td>
</tr>
<tr>
<td><label>
<div align="center">
<input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_2" />
Radio</div>
</label></td>
</tr>
<tr>
<td><label>
<div align="center">
<input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_3" />
Radio</div>
</label></td>
</tr>
</table>
</div>
<p align="center"><br />
</p>
</form>
Code: Select all
<?php
if ( isset($_POST['btnSubmit']) ){
if ( !empty($_POST['txtInput']) ){
$strInfo = $_POST['txtInput'];
}else{
$strInfo = "You didn't submit any data in the form field.";
$_POST['RadioGroup1_0'];
$_POST['RadioGroup2_1'];
$_POST['RadioGroup3_2'];
$_POST['RadioGroup4_3'];
}
echo htmlentities($strInfo, ENT_QUOTES);
}
Re: display chosen option onto another webpage
Hi, name of your radiobuttons is RadioGroup1.
To echo it:
echo $_POST['RadioGroup1'];
To echo it:
echo $_POST['RadioGroup1'];