iphone - sending http request using method post in php to a mobile application that is using objective C (.xcode) -
I am working on the project that is taking data from the VoiceXX LX application and then sends the VoiceXXLPL application variable that contains the data Is in PPP and I have been with that part but the problem is that when I request a PHP. I want to send fat by sending from FPC to mobile application, which is installed on the iPhone which is written with the Objective-C programming language, an extension (.xcode), I had to face a problem getting the variable on the mobile app,
So what I tried to do for a few months, the first variable sent the second .php and it works with me, by removing the problem with the mobile app Will try
I used the httpRequest () class-method post to send the variable but the problem is that I do not know what to write, to get this variable on another .php file and Then display it.
This is the complete code:
& Lt; Format result ($ line = mysql_fetch_array ($ result1)) by $ / / & quot; // line; {$ message = $ line ["message"]; echo " & Lt; / TR> ";} Echo" response & lt; / Table> "; $ Query =" Update Request SET ReadFlag = 1 WHERE ReceivedFlag = 1 "; $ Result2 = mysql_query ($ query, $ Conn);} // ------------ - Post server variable for other clients ----------------------- $ r = New HttpRequest ('http: //localhost/form.php ', HttpRequest :: METH_POST); $ R-> addPostFields (array (' user '=> message)); try {echo $ r-> send () -> getBody ();} I used the database as a buffer because I am working on different sessions, which is what I am doing. VXML and earlier .php y The first is between .php and the second .php form.php contains the following which display only a white page and do not print the already generated variable .php:
& lt ;? Php $ clientVariable = $ _POST ['message']; // Print to print data ($ clientVariable);? & Gt; < P> So what do I have to do to get the variable correctly and display it in another php? I appreciate your help.
Regards, Heba
If your variable contains sensitive data, I will use the session. If not, you can simply use GET:
Using the session:
session_start (); $ _SESSION ['myvariable'] = 'insert variable here'; Then in php2:
session_start (); Echo $ _SESSION ['myvariable']; Or you can use GET:
header ("location: /php2.php?myvar=insertcontent"); then in php2:
$ _GET ['myvar'] echo;
Comments
Post a Comment