chanchelkumar Posted July 22, 2007 Share Posted July 22, 2007 Hi friends, Am new to flex, am trying with forms... Am stucked here with a problem... My form contains four tabs, each contains submit buttons. I want to insert the values to database using Mysql using PHP... How can i get these text values page wise??... Now am getting it in to the data base... But the problem is when i press the second button it enters the values of the first and second page... Please help me! Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 22, 2007 Share Posted July 22, 2007 quick example for you. <?php if(isset($_POST['submit'])){ if($_GET['1']==1){ echo "<center>$a</center>"; } if($_GET['1']==2){ echo "<center>$b</center>"; } if($_GET['1']==3){ echo "<center>$c</center>"; } if($_GET['1']==4){ echo "<center>$d </center>"; } } $self=$_SERVER['PHP_SELF']; echo <<<form <center> <form method="POST" action="$self?1=1"> <input type="hidden" name="a" value="i love php test 1"> <input type="submit" name="submit" value="test me"> </form> form; echo <<<form <form method="POST" action="$self?1=2"> <input type="hidden" name="b" value="i love php test 2"> <input type="submit" name="submit" value="test me"> </form> form; echo <<<form <form method="POST" action="$self?1=3"> <input type="hidden" name="c" value="i love php test 3"> <input type="submit" name="submit" value="test me"> </form> form; echo <<<form <form method="POST" action="$self?1=4"> <input type="hidden" name="d" value="i love php test 4"> <input type="submit" name="submit" value="test me"> </form> </center> form; ?> Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 22, 2007 Share Posted July 22, 2007 short version <?php if(isset($_POST['submit'])){ if($_GET['1']==1){ echo "<center>test $a</center>"; } if($_GET['1']==2){ echo "<center>test $a</center>"; } if($_GET['1']==3){ echo "<center>test $a</center>"; } if($_GET['1']==4){ echo "<center>test $a </center>"; } } $self=$_SERVER['PHP_SELF']; for($i=1; $i<5; $i++){ echo <<<form <center> <form method="POST" action="$self?1=$i"> <input type="hidden" name="a" value="i love php test $i"> <input type="submit" name="submit" value="test me"> </form> form; } ?> Quote Link to comment Share on other sites More sharing options...
chanchelkumar Posted July 23, 2007 Author Share Posted July 23, 2007 Thanks ,,,, that is correct ... Form your example ,, How can i get the value of $_request("submit").. in the flex page i have to assign a button with id od name or something else.. How ??? that is not posiible for me... dat is my problem... I give id , name to the button... How we call a xml button with id="Test" name="Test" label="Submit" ... Am agin repeat.. dat button is in a flex page... Help me... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.