How can I pass a veriable -----
Posted: Thu Oct 08, 2009 10:59 pm
I have two buttons named 'go' and 'sub' and one form to do this.At same form i have two click events.
echo "<input type='submit' name='go' id='go' value='Go' />"; // button go
echo "<input type="submit" name="sub" id="button" value="Submit" />"; // button sub
echo "<input type='text' name='type' id='type' value='$router' />"; // This is a texbox. This value-$router pass from a list box
if (isset($_POST['go'])) // when user click on go button
{
$r=$_POST['type'];
echo $r; // this printed $r value.
}
if (isset($_POST['sub']))
{
// problem is...
// How can i get $r value to here...?
echo "Router : ".$r; // I got null value for this
// How can i get $r value to this click event..?
}
echo "<input type='submit' name='go' id='go' value='Go' />"; // button go
echo "<input type="submit" name="sub" id="button" value="Submit" />"; // button sub
echo "<input type='text' name='type' id='type' value='$router' />"; // This is a texbox. This value-$router pass from a list box
if (isset($_POST['go'])) // when user click on go button
{
$r=$_POST['type'];
echo $r; // this printed $r value.
}
if (isset($_POST['sub']))
{
// problem is...
// How can i get $r value to here...?
echo "Router : ".$r; // I got null value for this
// How can i get $r value to this click event..?
}