Problems in HTTPService with PHP

Hello

It's the Flex code that I have.

<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"creationComplete =" do_work () "> "

"< mx:HTTPService id ="find_college"fault =" errorhandler (event) "result =" resulthandler (event) "showBusyCursor ="true"method ="GET"useProxy ="false">

< / mx:HTTPService >

< mx:Script >

<! [CDATA]

Import mx.collections.ArrayCollection;
Import mx.rpc.events.ResultEvent;
Import mx.controls.Alert;
Import mx.rpc.events.FaultEvent;

[Bindable] private var collegeData:ArrayCollection = new ArrayCollection();

private function do_work (): void
{
' find_college.url = ' http://localhost/Take2.php?name=PQR "
find_college. Send();
}

private void errorhandler(e:FaultEvent):void
{
Alert.Show (e.fault.message, "Server" error);
}

private void resulthandler(e:ResultEvent):void
{
collegeData = e.result.mydata;

}
[]] >
< / mx:Script >
< mx:ComboBox id = "college_list" x = "464" y = "229" dataProvider = "{collegeData}" = 'name' labelField >
< / mx:ComboBox >

< / mx:Application >

-----

and contains the take2.php-

ECHO ("< mydata >". $_GET ['name'].) "" < / mydata > ");"

---

Problem is that the ComboBox control does not come with the value of the GET variable, it says transfer of localhost indefinitely.


http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete =" do_work () ">"


Fault = "ErrorHandler (Event)" "
result = "resultHandler (Event)" "
resultFormat = "xml".
showBusyCursor = "true".
method = 'GET '.
useProxy = "false" >
   
   
   
   
               
Import mx.collections.ArrayCollection;
Import mx.rpc.events.ResultEvent;
Import mx.controls.Alert;
Import mx.rpc.events.FaultEvent;
       
[Bindable] private var collegeData:XMLList = new XMLList();
       
private function do_work (): void
{
find_college. "URL ="http://localhost/take2php?name=pqr"
find_college. Send();
}
       
private void errorhandler(e:FaultEvent):void
{
Alert.Show (e.fault.message, "Server" error);
}
       
private void resulthandler(e:ResultEvent):void
{
collegeData = XML (e.result) .mydata;
}
]]>
   

   
   

/* ----------------------------------------------------------------------------------------- -----------*/

/ * take2.php

/* ----------------------------------------------------------------------------------------- -----------*/

<>
$x  = "";
$x .= "";
$x. = "«. $_GET ['name']. »« ;
$x. = "«. $_GET ['name']. »« ;
$x. = "«. $_GET ['name']. »« ;
$x .= "
";

Header ("Content-Type: text/xml");
Header ("' Content-Length:".strlen ($x) ");
Print ($x);

Tags: Flex

Similar Questions

  • View scrolling problem to live with php files

    While I am in Live View mode I can scroll in html documents in Dreamweaver, but when I work with a php document, it does not allow me to scroll.  Can someone tell me why this is?

    Screenshot of preview in Dreamweaver with html file (you can see the scroll bar to the right of the display window):

    Dreamweaver html.PNG

    Screenshot of preview in Dreamweaver with a php file (you don't see the scroll bar to the right of the display window):

    Dreamweaver php.PNG

    You have overflow: hidden together on yourtag by accident?

  • Multi and Flex HTTPService and PHP user access

    Hello

    I'm developing a Flex with PHP application as a technology of the side server. I use HTTPService to send and receive data at and fom PHP. When I want to get a result, I send the request to a specific URL of PHP and manage the result in the Resut the HTTP Service event, which is in the form of an XML th. The problem is that if more than 1 user tries to perform the same operation at the same time, then the result is to be send to the same PHP url. But each user may have requested the URL in a different way. So, how can I check the result sent to a user is identical to what he prayed for and is not in conflict with another user.

    No, they won't, it's the same thing as you when you browse the internet, your ISP must have thousands of users, but when you ask forums.adobe.com you will get this site, not what your neighbor has asked. It's like a phone call when you dial a number, it rings and then someone answers you, is a one to one conversation.

  • Invalid accept header with PHP SDK 5.1 against 1.5.1 vCloud Director

    In PHP 5.1 SDK samples do not work against 1.5.1 vCloud Director?  Any code that I am trying to write with PHP 5.1 SDK really will work against my vCD 1.5.1?  Or it will fail as the samples?  Is there something I can do for samples and all this work?

    My question seems very similar to http://communities.vmware.com/message/2142668#2142668.  I've had some success with the SDK 1.5 samples against my 1.5.1 vCloud Director.  But when I've upgraded to the PHP 5.1 SDK, all I could get was "invalid accepts header" messages, like this:

    PHP Fatal error: Eception exception 'VMware_VCloud_SDK_Exception' with the message "POST ". https://vCloud.mydomain.edu/API/login failed, return code: 400, error: <? xml version = "1.0" encoding = "UTF-8"? >

    " < error xmlns =" http://www.VMware.com/vCloud/v1.5 "stackTrace =" com.vmware.vcloud.api.rest.handlers.exceptions.BadRequestRestApiException: invalid application accepts the header

    at com.vmware.vcloud.api.rest.common.handlers.ErrorHandler.getBadRequestApiException(ErrorHandler.java:71)

    at com.vmware.vcloud.api.rest.common.handlers.ErrorHandler.errorBadRequest(ErrorHandler.java:44)

    at sun.reflect.GeneratedMethodAccessor11639.invoke (unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)

    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)

    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:133)

    to org.ap in /home/bob/lib/vcloudPHP-5.1.0/library/VMware/VCloud/ServiceAbstract.php on line 178

    After changing VCLOUD_API_VERSION in library/VMware/VCloud/Constants.php of 5.1 to 1.5, I get this:

    PHP Fatal error: Eception exception 'VMware_VCloud_SDK_Exception' with the message "POST ". https://vCloud.mydomain.edu/API/login failed, return code: 401 error,:, request data:
    ' in /home/bob/lib/vcloudPHP-5.1.0/library/VMware/VCloud/ServiceAbstract.php:178
    Stack trace:
    #0 home/bob/lib/vcloudPHP-5.1.0/library/VMware/VCloud/Service.php(114): VMware_VCloud_SDK_Service_Abstract-> message ('https://vcloud...) "(, 200) "
    #1 home/bob/lib/vcloudPHP-5.1.0/samples/login.php(78): VMware_VCloud_SDK_Service-> login ('vcloud.mydomain...', Array, Array)
    #2 {hand}
    lifting in /home/bob/lib/vcloudPHP-5.1.0/library/VMware/VCloud/ServiceAbstract.php on line 178

    A standard API call seems to work:

    curl - test id = true u scripty@system h ' Accept: application / * + xml; " version 1.5 =" https://vCloud.mydomain.edu/API/sessions

    Enter password for the user "scripty@system": Home


    HTTP/1.1 200 OK

    Date: Wednesday, November 28, 2012 17:43:56 GMT

    x vcloud-authorization: rxpTQIswdd15HNz + hZku6BCutGljF5VLUrt0M8x + IGI =

    Set-Cookie: vcloud-token = rxpTQIswdd15HNz + hZku6BCutGljF5VLUrt0M8x IGI plus; Guarantee; Path = /.

    Content-Type: application/vnd.vmware.vcloud.session+xml;version=1.5

    Date: Wednesday, November 28, 2012 17:43:56 GMT

    Content-Length: 1009


    <? XML version = "1.0" encoding = "UTF-8"? >

    " < session xmlns =" http://www.VMware.com/vCloud/v1.5 "user = org"scripty' = 'System' type="application/vnd.vmware.vcloud.session+xml' href =" https://vCloud.mydomain.edu/API/session/ "" xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance " xsi: schemaLocation = " http://www.VMware.com/vCloud/v1.5 http://vcloud.the.usg.edu/api/v1.5/schema/master.xsd" > "" "

    "" < link rel = "low" type="application/vnd.vmware.vcloud.orgList+xml" href = " https://vCloud.mydomain.edu/API/org/ "/>

    "" < link rel = "low" type="application/vnd.vmware.admin.vcloud+xml" href = " https://vCloud.mydomain.edu/API/Admin/ "/>

    "" < link rel = "low" type="application/vnd.vmware.admin.vmwExtension+xml" href = " https://vCloud.mydomain.edu/API/admin/extension "/>

    "" < link rel = "low" type="application/vnd.vmware.vcloud.query.queryList+xml" href = " https://vCloud.mydomain.edu/API/query "/>

    "" < link rel = "entityResolver" type="application/vnd.vmware.vcloud.entity+xml" href = " https://vCloud.mydomain.edu/API/entity/ "/>

    < / session >

    Version switching in gross 1.5 to 5.1 API call causes the accept header message invalid, which is not surprising, now that I became familiar with the format and the requirement to accept header.
    For example, can code samples from the SDK 5.1 actually work against 1.5.1 API?
    Thank you!!!

    Hello

    PHP Fatal error: Eception exception 'VMware_VCloud_SDK_Exception' with message "POST https://vcloud.mydomain.edu/api/login failed, return code: 401 error,:, request data:"

    [Rajesh] Seems to me like a problem of password username. As it clearly says 401.

    After changing VCLOUD_API_VERSION in library/VMware/VCloud/Constants.php of 5.1 to 1.5, I get this:

    [Rajesh] SDK users should not change the code in the library. This is a bug with the SDK for not allowing users to change the version of API through the library (connection method accepts the version as well) rather than change in the library.
    Kind regards
    Rajesh Kamal.
  • Send an email with php and mysql

    I want a visitor to my site click on a field in mysql to email with a BCC to me also, I want the link to show 'Send an email' not the e-mail address of the field

    There is no way to hide a BCC address with a mailto link, because it just opens the e-mail program of the user with the address fields filled in.

    What I would recommend is to create a contact form, as described in Chapter 5 of PHP Solutions. Using PHP to send the form hides your email address and all BCC addresses. It appears from your description that the email will be sent to different people according to which the link is clicked. If this is the case, the programming becomes more complex, but you can solve this problem, once you have learned how to create a contact form and email with PHP.

    I hope PHP Solutions is sufficient for your needs, but I warn you to take Chapter 3 slowly. Do not try to memorize everything in Chapter 3. Just have a general idea for how the language is structured and re-enter the chapter whenever you need to refresh your memory. If you feel the need for another book, I think that the books of Visual Quick Start of Larry Ullman are good.

  • Call to undefined function getsqlvaluestring() with PHP mysql Dreamweaver

    Hey guys, I'm new to the forum and it seems very useful. I think I have a unique problem well.

    Although this script worked for a year or two, all of a sudden, during the holidays, he went to hay

    Front end is always get all the information, it must be the Database.But when I try to connect through the side admin I created with php and database of dreamweaver extensions normal I get this error.

    I do not know many php - then I'll hide the chain at the moment - if I need to paste the code that I'll - thank you in advance


    Fatal error
    : Call to undefined function getsqlvaluestring() in /xxxxx/xxxx/xxxxxxx/xxxxxxx/newsletters/xxxxxxx/xxxxxxx/admin/login.php on line 22

    Vicinity of line 22 looks like this

    @mysql_select_db ($database_promocenter, $promocenter);

    $LoginRS__query = sprintf ("SELECT username, password, destination_page FROM users WHERE username = %s AND password is %s",

    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "int"));

    $LoginRS = mysql_query ($LoginRS__query, $promocenter) or die (mysql_error ());

    $loginFoundUser = mysql_num_rows ($LoginRS);

    If {($loginFoundUser)

    First part looks like this

    < form id = "form1" name = "form1" method = "POST" action = "<?" PHP echo $loginFormAction;? > ">"
    < b >
    < td bgcolor = "#dedede" >
    < table width = "400" border = "0" align = "center" cellpadding = '3' cellspacing = "0" bgcolor = "#ffffff" >
    < b >
    < td height = "35" align = "right" valign = "middle" id = "description" > user name: < table >
    < height td = "35" > < label >
    < input style = "height: 20px;" border: 1px solid #999999 "name ="username"type ="text"id ="username"size ="35"/ >"
    < / label > < table >
    < /tr >
    < b >
    < td height = "35" align = "right" valign = "middle" id = "description" > password: < table >
    < height td = "35" > < label >
    < input style = "height: 20px;" border: 1px solid #999999 "name ="password"type ="password"id ="password"size ="35"/ >"
    < / label > < table >
    < /tr >

    Anton

    Could also show you it could never work.  Why?  Because the call to the function is made before the function is defined.  He would always stop execution with an undefined function error.

    Now - it seems that you have added the users authentication that was placed before the code block in which the function is defined.  So I would say that you move it-

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION< 6)="" {="" 6)="">

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    from its current location to a new block just under the connection with the directive, i.e.,.

    MOVE HERE ? >

    <>

    Validate request to connect to this site.

    so that the final code looks like this-

    <>

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION< 6)="">

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    ?>

    <>

    Validate request to connect to this site.

  • Insert a special character such as apostrophes with PHP/Mysql

    Hi friends,

    I have a problem with php/mysql. I created a form vach'inton a page php with dreamweaver and when I try to fill in the form with a string that contains an apostrophe ('), I got an error. It seems that integration is not possible. Would you have any idea for that. I give you the code of dreamweaver php and thank you for your help.

    <? php require_once('Connections/Mainconnect.php');? >

    <? php require_once('Zend/Date.php');? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    If ($theValue =="")

    {

    $theValue = "NULL";

    }

    on the other

    {

    $zendDate = new Zend_Date($theValue,"dd/MM/yyyy");

    $theValue = "" "." $zendDate-> toString("yyyy-MM-dd"). »" « ;"

    }

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    $editFormAction = $_SERVER ['PHP_SELF'];

    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);

    }

    If ((isset($_POST["MM_update"])) & & ($_POST ["MM_update"] == "form1")) {}

    $updateSQL = sprintf ("UPDATE pers_soc_reg SET Field1 = %s, Field2 = %s,

    GetSQLValueString ($_POST ["field1"], "text").

    GetSQLValueString ($_POST ["Field2"], "double"));

    Hello friends,

    I solved the problem.

    The problem is a free extension for dreamweaver called 'check new items' of Felixone. After his retirement, all forms of work without problem.

    Thanks to you all.

  • Flex with php

    Hello

    I want to insert a record in my database but ICAN t. I am new to Flex, and there is my code:

    <? XML version = "1.0"? >

    < mx:Application ' xmlns:mx = ' http://www.Adobe.com/2006/MXML "xmlns =" " * "layout =" " absolute "creationComplete ="userRequest.send ()" >

    < mx:HTTPService id=" userRequest " url=" http://localhost/Flex/Insere.php "useProxy =" " fake "method =" " POST " >

    < mx:request xmlns = "" " >

    < username > {username.text} < / name > < emailaddress > {emailaddress.text} < / emailaddress >

    < / mx:request >

    < / mx:HTTPService >

    < mx:Form x=" 22 " y=" 10 "width = » 493 " >

    < mx:HBox >

    < mx:Label " text = ' Username " />

    < mx:TextInput id=" username " />

    < / mx:HBox >

    < mx:HBox >

    < mx:Label " text = ' Email address " />

    < mx:TextInput id=" EmailAddress " />

    < / mx:HBox >

    < mx:Button " label = ' BOLAS "click ="userRequest.send ()" />

    < / mx:Form >

    < / mx:Application >

    I think the problem is that insere.php is not called.

    Any help, please?

    Heres the flex work:

    
    
    
         
             
         
    
        
            
                {usernameStr}
                {emailStr}
            
        
    
        
            
                
                    
                
            
                
                
            
            
        
    
        
            
                
                
                
            
        
    
    
    

    Configure a datagrid control, so you can see the add users button that you press

    Try this PHP, swap "xxx" for your usename and "xxxx" your database password database:

    ";
    
       while ($User = mysql_fetch_object($Result))
       {
              $Return .= "".$User->userid."".$User->username."".$User->emailaddress."";
       }
       $Return .= "";
       mysql_free_result($Result);
       print ($Return)
    ?>
    

    your daa

  • Hey, need help. I get this in my iPhone that 'there is a problem of billing with a previous purchase. Please update your payment method"in any way I can remove my visa card from iTunes

    Hey, need help. I get this in my iPhone that 'there is a problem of billing with a previous purchase. Please update your payment method"anyway I can remove my visa card from iTunes?

    You must pay your debt first.

  • the site theme is problem with firefox, but not any problem of chrome with!

    the site theme is problem with firefox, but not any problem of chrome with!
    for ex: http://haftegy.ir
    How to fix?

    Wow sorry! IM update firefox to the latest version and my problem is solved.
    Thank you very much.

  • I can not access to sites such as Youtube or truckcam.tv it seems that the problem may be with the most recent Adobe flash and firefox as browsers further

    Question
    I can't access to sites such as Youtube or truckcam.tv , seems, the problem may be with the last Adobe flash and firefox as other browsers work I reinstalled both, but without success, even on the two desktop using Vista and laptop on Windows 7

    See:

  • Have problems and questions with Time Capsule were addressed in any significant way. Reluctant to buy according to your comments.

    Have problems and questions with Time Capsule was dealt with in a meaningful way? Reluctant to buy according to your comments.

    Apple did not have any material changes to the time Capsule to nearly 3 years. The only change that has occurred in the last 18 months or so is a firmware update to address security issues.

  • I have problems to make my battery charged, because the cable does not have a link solid with the socket of the phone.  The problem seems compatible with a lot of cables, so I think the problem is with the phone. Can it be fixed?

    I have problems to make my battery charged, because the cable does not have a link solid with the socket of the phone.  The problem seems compatible with a lot of cables, so I think the problem is with the phone. Can it be fixed?

    Probably there is debris and dust in the decision-making of the lightning.  Serve with compressed gas canned (NEVER orally).  If this doesn't help, try electronic contact cleaner has a q - Tip.  Finally, take it to Apple.

  • Problems of wireless with my Satellite A505

    Hello people,

    I have a Satellite A505 which uses a Realtek RTL8191SE wireless network card. Recently, I had connectivity problems with my home router. This configuration used to work perfectly, but recently, I had a problem where I won't be able to connect to my router wireless access point. Reset the adapter does not solve the problem, or don't restart.

    I found that my router reboot solves the problem, I am able to login after the reboot of the router. I have not had this problem on any of the other devices or laptops in my house and never had this problem until last month. I tried to do a factory reset on my router in order to ensure that some recent changes in our setup of the router were not to blame, but the problem persists even with a clean slate.

    Ideas for what to do?

    Thank you!

    Hello

    >... and never had this problem until the last month or more
    Do you use WLAN driver from Toshiba support page?
    I ask this question because I noticed that under Win7 driver for this wireless network card is offered as optional update. Maybe this update is installed, and now you have this problem.
    If possible, try to roll back OS a few weeks back and check if the problem persists.

  • Problems of lag with Safari/Youtube

    Hey guys, I had this problem for a while:

    When I close the Youtube tab (normally with a video) to get to the next tab, tab Youtube sometimes freezes for a few seconds before closing completely.

    Then Safari starts getting lag, "restless" and slow, even when I'm on Facebook or other websites in general. I noticed that my Mac starts to slow down too.

    The only way I have temporarily resolve this problem is to remove the story and the datas of Safari and start over. Or what Mac is becoming seriously lag is to restart (it happened seldom).

    This problem has occurred before the update to OS X El Capitan 10.11.3 (I thought that it improved...)

    Clues or suggestions on what to do?

    • I have never installed readers flash, adobe etc...
    • I don't have a plugins, web extensions installed.
    • I décliqués Plugin Internet on Safari, thought preference that he touched it...
    • This Youtube problem never happens with Chrome
    • I have a Macbook Pro OS X El Capitan 10.11.3, retina

    Try to reset the settings of Safari:

    1. open Safari

    2. click on the Safari menu at the top (to the right of the Apple logo)

    3. Select the Preferences/Privacy tab

    4. click on remove all data from the Web site

    5. close Safari.

    Remove cache Safari files:

    1. click on finder

    2. look for the menu GO to top

    3. click on GO and hold down the option key. This will show a user library folder.

    4. click library and find the Caches folder

    5. in the folder caches com.apple.Safari Ouvrezledossier

    6. move the Cache.db file Trash.

Maybe you are looking for