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
https://forums.phpfreaks.com/topic/61204-getting-values-from-flex-to-php/
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;

?>

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;

}

?>

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

 

Archived

This topic is now archived and is closed to further replies.

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