Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Server-Side Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-22-2009, 07:33 PM   #1
nstreetm
Registered User
 
Join Date: Oct 2009
Posts: 1
Default Flex and PHP Integration problem

Hey gang I'm new to Flex, trying to receive some data via PHP. Both the php and flex scripts run but it does not receive data. Just sits there waiting on response form the web server. Any help is appreciated here is my code.
PHP:
require('globals-mconnect.php');
if( $_POST["eagle"])
{
//add the user
$Query = "SELECT * FROM MYGSUSER WHERE USER_STUID= '".$_POST['eagle']."'";
$Result = mysql_query( $Query );
$Return = "<MYGSUSER>";
while ( $User = mysql_fetch_object( $Result ) )
{

$Return .= "<user><USER_PIDM>".$User->USER_PIDM."</USER_PIDM><USER_FNAME>".$User->USER_FNAME."</USER_FNAME><USER_LNAME>".$User->USER_LNAME."</USER_LNAME></user>";
}
$Return .= "</MYGSUSER>";
mysql_free_result( $Result );

}
?>

Flex Script:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" borderColor="#42DF64" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#B1ACAC, #514E4E]">
<mx:HTTPService id="userRequest" url="https://webtest.georgiasouthern.edu:4102/portal/services/flextest2.php" useProxy="false" method="POST">
<mx:request xmlns="">
<eagle>{eagle.text}</eagle>
<USER_PIDM>{USER_PIDM.text}</USER_PIDM>
<USER_FNAME>{USER_FNAME.text}</USER_FNAME>
<USER_LNAME>{USER_LNAME.text}</USER_LNAME>
</mx:request>
</mx:HTTPService>
<mx:Form x="22" y="10" width="493">
<mx:HBox>
<mx:Label text="Eagle ID"/>
<mx:TextInput id="eagle"/>
</mx:HBox>
<mx:Button label="Submit" click="userRequest.send()"/>
</mx:Form>
<mx:DataGrid id="dgUserRequest" x="22" y="128" dataProvider="{userRequest.lastResult.MYGSUSER.use r}">
<mx:columns>
<mx:DataGridColumn headerText="User Pidm" dataField="USER_PIDM"/>
<mx:DataGridColumn headerText="User First Name" dataField="USER_FNAME"/>
<mx:DataGridColumn headerText="User Last Name" dataField="USER_LNAME"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>

Thanks!
nstreetm is offline   Reply With Quote
Old 11-01-2009, 12:30 AM   #2
sparkdemon
Member
 
Join Date: Oct 2009
Posts: 70
Send a message via Skype™ to sparkdemon
Default

it wont work just like this. Instead of trying this way i suggest you use amfphp
sparkdemon is offline   Reply With Quote
Old 11-02-2009, 12:30 AM   #3
ASWC
Site Contributor
 
Join Date: Dec 2007
Location: Vermont, USA
Posts: 3,178
Default

PHP Code:
print($Return); 
got to print it on the page if you want Flex to read it.
__________________
aswebcreations
ASWC is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:54 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.