Iphone - Sending Http Request Using Method Post To A Mobile Application That Is Using Objective C (.xcode)
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 :
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:
So what I have to do in order to receive the variable correctly and display it in the second php?
IPhone App/JSON - Posting Data To Remote Database?
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..
Iphone - Newline In Text - UITextView To Sqlite - Sqlite To JSON (via NSString) - JSON To It
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 "", 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:
Send An Array Of Object From IPhone App To A Script With JSON?
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 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
Objective C - More Specific About Sending Json With Utf8 To Iphone From Server?
We have php server that sends json string in utf-8 encoding. Im responsible for the iphone app that get the data. I want to be sure that on my side everything is correct :
//after I downlad the data stream : NSString* content = [[NSString alloc] initWithData:self.m_dataToParse encoding:NSUTF8StringEncoding]; //here the data is shown correctly in the console NSLog(@"%@",content); SBJsonParser *_parser = [[SBJsonParser alloc]init]; NSDictionary *jsonContentDictionary = [_parser objectWithData:self.m_dataToParse]; //here, when i printer values of array IN array, i see u454 u545 4545 format. any ideas why ? [Code]....
im using the latest version of json library : [URL] There is problem is the iphone side? (json parser? ) or in the php server?
just to be clear again : 1.on the console, before json, the string looks o.k 2.after doing json, the array in array values are in the format of u545 u453 u545
Write The Server Side If Using The Json On Client Side Of The Iphone?
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.
I got a windows com executable which returns a jpg image in a BSTR.
Let's say, the var that holds the data is $imgData.
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 to treat the data as binary instead of a formated string. As far as I know, echo $imgData shouldn't expect a formated string, as print does.
(I know, returning a Safearray from the com executable would be a better way and probably I will also do it that way, but at the moment, I'm trying to solve this problem.)
Iphone SDK - Upload Image From Iphone To A Server Send Empty File?
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
this is the most message I got after I send photo to server
The app I'm writing needs to get information from a remote database and then store it in the SQlite database on the iphone for offline use. As of now I'm using a php script to querry the database and then just basically scrapping the html data from the php echo calls. My problem is that now that I'm moving away from test data I'm using database tables that are fairly large with complex dependencies. I would really like to not to have to write a parser for these complex files to manually put the data and dependencies into the iphone database.My question is if there is any way to use a php script to pass to the iphone a copy the actual database file and then just dump that into the SQlite database on the iphone.
IPhone - Notify Some Subscribers When The Database Changes
I have three things: An iPhone app PHP-mySQL database on a server Google App Engine (?) The iPhone app is working fine storing data in the database. I'd like to notify some subscribers when the database changes (i.e. someone uploads something). I assume the app is running, so I just want the view up to date. (Also, is it feasible to send push notifications when is not running?)
right I am planning to make an application that connects to an online database to a certain website i have developed using php.the site uses MYSQL.anyways how would i allow the application on my iphone update and receive records from one of the tables with the ability to delete records aswell.I am fairly new to programming on my iphone.
I am trying to make an xml file to export my data from my database to my iphone. Each time I create a new post, I need to execute a php file to create a xml file containing the latest post Here is current php code ... but my nsxmlparser gives me an error code (33 - String is not started).
<?php // dition du dÈbut du fichier XML $xml .= '<?xml version="1.0" encoding="UTF-8"?>'; $sml .= '<channel>'; $xml .= '<title>Infonul</title>';
I noticed a few things when i open 20news.xml in my browser : I got squares instead of single quotes ... I can't see <[CDATA[ but ]]> is clearly visible ... why ?!?