Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Problem: cant send variables to php.

Avatar

Level 1

hey guys...

I've recently started an application on Flex 3.3 which will be based on a database and it will include some components in order to insert new rows with user feedback to the database.

I'm new to Flex but I've been searching for the last 6 hours and it seems that my flex code and my php code are ok. For some reason though the variables from the HTTP Service are not passed to the php script.

here is my php assignment to variables (I'm not including the code for the insertion to the database table because this is working for sure )

<?php

$Alias=$_POST["Name"];
$Feedback=$_POST["Feedback"];
$Email=$_POST["Email"];


?>

and here is my http service.

<mx:HTTPService id="toPHP" method="POST" url="test.php" useProxy="false">
        <mx:request xmlns="">
            <Email>someEmail</Email>
            <Name>someName</Name>
            <Feedback>someFeedback</Feedback>   
        </mx:request>
    </mx:HTTPService>

<mx:Button x="617" y="51" label="Submit" id="submit" click="toPHP.send()"/>

I tried to navigate to the php file right after the send() through the swf and if i echo the php variables I get 3 errors saying that Name,Email,Feedback are undefined.

if you think there is some other part of my mxml needed in order to help let me know so I can post it, but I think that if there is something wrong then its here.

Also, I'm using EasyPHP 3.0 in my local machine.

2 Replies

Avatar

Level 1

I'm wondering how to send variables to PHP myself.  Have you figured it out?

Avatar

Level 3

Hi,

           Try to add the ResultEvent and FaultEvent to HttpService,

            The code at the flex side is corrcect may be the url which u specifed in the HttpService may be wrong try to check the Url and

            first check whether r u able to call your PHp Class or not??