I am working on project that is taking the data from a voiceXML application and then the voiceXML application send the variable that contains the data into a .php and I am done with that part but the problem is when I want to send the variable by sending a HTTP POST Request from .php to the mobile application which is installed on the iphone that is written using objective C programming language with an extension (.xcode), I faced a problem in receiving the variable on the mobile application,

So what I tried to do for a couple of months is to send the variable first to another .php and if it works with me, I will try to fixed the problem with mobile application. I used httpRequest () Class - method post in order to send variable but the problem is that I don't know what to write on the other .php file to receive this variable and then display it. This is the whole code :

[Code]....

I used the database as a buffer since I am working on different sessions which is between the .VXML and first .php or the first .php and second .php The form.php contains the following which just display a white page and doesn't print the variable that is coming from the first .php:

[Code]....

So what I have to do in order to receive the variable correctly and display it in the second php?

I have a UITextView that ends up sending the text to a sqlite db on the iPhone. Later on I will be querying this data from sqlite, putting it into a JSON string and sending it to a server (PHP/MySQL) from the iPhone using ASIHTTPRequest (using ASIFormDataRequest class). There is a data condition where this send to PHP fails to decode properly (using json_decode). The data condition seems to be where there's a newline in the text that was entered to sqlite via the UITextView.

Things I've Tested: Write out the same JSON string that I'm trying to send to the server to a text file on the iPhone. Take that text, copy it into a web form (that I put together for this troubleshooting) that POSTs the data to the same PHP script that accepts the JSON from the iPhone. This processes successfully (e.g. decodes and writes to the MySQL db). Write out the same JSON string that I'm trying to send to the server to the console (using NSLog). Copy the text from the console and copy it into a web form that POSTs the data to the same PHP script that accepts the JSON from the iPhone. This processes successfully (e.g. decodes and writes to the MySQL db).

Remove the newline in the sqlite db, run the app and send the JSON to the server per design, no problem...it decodes and writes to the MySQL db. I want to keep the newline in the text as that is what the user typed and what they will expect when they see the information on the server. Not sure how to keep the newline and at the same time be able to send the data to the server without any issues.

When i use my iphone app and attempt to retrieve it, it says "Json parse failed: Garbage after JSON" And if i run the PHP file in a browser, i see all the JSON data fine but after it there is "[1]", which is screwing it up i think?

I'm attempting to use Json-Framework to parse output (on the iPhone) from my website. The data on the website is an array of news objects... passed through PHP's json_encode().The JSON Output is here:[URL]....I am able to conne to the server and store the JSON data, then I do:

I have a JSON parser in my iphone app. I'm using the above PHP code to try and search Twitter. Can anyone tell me the best way to search the web or get twitter results and return them to my app? I've tried YQL but could not get on with it. All i want is raw text returned to my app. Almost like RSS feeds

I don't know any PHP so another developer helped me out with this code. I am trying to return the names of all the files in a folder on my server. These are then passed to my iPhone app which uses the data. However, I have 160 files in the folder and the JSON string only returns 85. Is there something wrong with this code:

I have an iPhone app with an array of objects that I want to send to a PHP script and have them be stored in a mySQL database. The objects in the array contain only floating points and strings, nothing special.

From what I understand the best way to send the array to the php script is to convert the array into an JSON, send it to the php script via http post, and do a json_decode on the other end. However I'm having a hard time figuring out how to convert the array into a json object.

I have an iPhone app that uses ASIHTTPRequest to post data to a php file, which then uses sql to update the database accordingly.What's bugging me is I keep reading that I should encode my posted data in JSON format. Can somebody explain to me the point in this? Why should I encode in JSON format? What are the benefits, needs for this..

I would like to send my contact list with all numbers for each numbers. I'm trying to send a JSON Object (with all my data) to a PHP file and to decode with the json_decode function. Is it possible to use JSON to send to a server by POST in HTTPrequest

i want to make my server side in php. after writing the code in php can i directly use json to parse it of or something other required on the server side with php.can you give me some example of it, how to do this on server side if i want to use json of my client side.

With perl, in a cgi script, I may simpy write:8<--------8<--------8<--------8<--------8<--------$| = 1;print "Content-type: image/jpeg

";binmode(STDOUT);print $imgData;8<--------8<--------8<--------8<--------8<--------and the Image is propperly printed to the Client-Browser.

Now I want to achieve the same with php, but I just can't find a way totreat the data as binary instead of a formated string.As far as I know, echo $imgData shouldn't expect a formated string, as printdoes.

(I know, returning a Safearray from the com executable would be a better wayand probably I will also do it that way, but at the moment, I'm trying tosolve this problem.)

I try to send a photo and GPS location to server via PHP here is the PHP part:Copy from here Saving the Uploaded File The examples above create a temporary copy of the uploaded files in the PHP temp folder on the server. The temporary copied files disappears when the script ends. To store the uploaded file we need to copy it to a different location:

The script above checks if the file already exists, if it does not, it copies the file to the specified folder.

Note: This example saves the file to a new folder called "upload"

now back to iOS part ,I only can send GPS location to server ,it's easy because just a string. and you can download sample code here But an image is not,I do some search and found this discussion I directly put the code in my send GPS&image button the best thing is it can feedback I send the file success or failed

I find var_dump and print_r functions to be excellent for debugging variables, function calls and arrays respectively. The problem is I have been asked to debug code on a live site (no dev site, I know it is a horrible practice but this is not my project from the start.) So I would like to know what core function or php library or whatever else it is that I could use to log debugging calls in to log that I can check so I don't have to send debugging calls to the browser on a live site?

I like the way you can use the console.log function in JavaScript code and check it in Firebug or the Webkit Console and I also like like the console window in Xcode and I was wondering if there was some similar tool for PHP debugging.

First of all, I'm uploading multiple images that goes through a for loop by the input file with multiple selections (HTML5), however when attempting to output the links in JSON, it's only outputting one image filename, even when I've selected 2+ images.

This is how I'm creating the JSON (the important parts, not the full script):

I know this seems like I should have immediately found the one example out there that simply explained this concept, and I can't find the right one. The examples in tutorials out there use flickr as the request url, and I get it up to a point. I'm trying to handle a very complex form with four different buckets of info under one larger bucket of info. I though json would be a good choice. So I found an example that shows me how to serialize the data like this:

$.fn.serializeObject = function(){ var o = {};[code]....

Which is great! Via an alert, I can see the json structure and my form elements. So I thought the rest would be totally simple. And here I am banging my head because I can't find one simple example of HOW to SEND or REQUEST this serialized data from my processing page which needs to print, organize and calculate the values of what was sent.So what I did next (and I'm sure it's wrong, but perhaps this will illustrate how new I am to it and where I need to start in my understanding of it) was to write the serialized data out to a hidden field like so:

I'm using the GET method in the form and when it pops the alert it looks fine, then it goes to the next page. Only that hidden var I wrote out isn't there. The rest of the form values are. I just WANT to see the darn json somehow so I can then use json.parse or whatever I have to use in PHP to decode it.

I am trying to convert json data in to array using php. But unfortunately my json data contains encoded values. For this reason why i am unable to convert this json object in to array in php. I tried it in different ways, But i couldn't get any solutions to solve this.This is the URL data i am getting from client side.

I want to load higher resolution pictures for iPhone 4 users, but the only way I know of detecting users is by a user-agent. But I'm under the impression that the user-agent of MobileSafari on any iOS4 phone is the same across the board.

I have a text file that is formatted like JSON, but in a print/view friendly format and I want to convert that string to valid JSON.Basically, I want to read the file using PHP5 and call json_decode to deserialize the string.But, json_decode is not able to parse the "print-friendly" json string.I am getting error 4 Invalid or malformed JSON.

I am generating json from an array using json_encode(), it's working properly, but it uses the key:value from the array, as usual. but I want to change the name of the key only in the json output.. is it possible to do it ? or should I prepare the json key:values myself manually?

$result=mysql_query("select * from pointtable where Latitude between '$latitude1' and '$latitude2' and Longitude between '$longitude1' and '$longitude2' ");

$posts=array();[code]...

above code is of creating json response..i have one form from which by POST method i am getting parameter information..result is fine but it opens in diagloue box..i want to type this json response in a page...what do i do?..

i donot want this starting...{"posts":"post'}..want to start it from {id:1...}what do i change?...

I have to create a iphone app using Aweber. But Aweber has no iphone API link. Now I just want to know that I have knowledge of PHP and aweber has PHP API, is it possible to create a iphone API for a newbie like me (I mean for Iphone) to accomplish this task.

I'm trying to finish a site for my friends brother, and everything (almost) works fine.The site is built with a centered container, aprox 15-20% space from the left side.The problem is though that when you open it in iPhone or iPad the site is scaled so that the space on the left side is removed, the text starts exactly where the screen starts. I hope I'm explaining this right.

Is there a simple way for me to change this only for mobile devices? Too bad I don't have any experience when it comes to designing for phones.