Jump to content

Getting values from Flex to PHP


chanchelkumar

Recommended Posts

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!

 

Link to comment
Share on other sites

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;

?>

Link to comment
Share on other sites

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;

}

?>

Link to comment
Share on other sites

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...

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.