RE: php and cocoa
RE: php and cocoa
- Subject: RE: php and cocoa
- From: "Rufat A. Abdullayev" <email@hidden>
- Date: Tue, 21 Sep 2010 14:23:31 +0500
- Acceptlanguage: en-US
- Thread-topic: php and cocoa
Hi Douglas
Here is the example of how to send HTTP request with parameters from cocoa
http://deusty.blogspot.com/2006/11/sending-http-get-and-post-from-cocoa.html
just make a php script on web server side that reads POST/GET variables sent from cocoa application and output desirable content
inside cocoa application create request and modify parameters according to what you will process by php script
for example lets assume you send via http request 'option' variable
just set in cocoa (see above mentioned example this string used there)
NSString *post = @"option=image"; for image
NSString *post = @"option=quantity"; for quantity
NSString *post = @"option=description"; for description
And send to PHP script
On php script side get it:
$option = $_POST['option'];
And output accordingly
If($option == 'image'){
//do something
} else if($option == 'quantity'){
//do something
} else if($option == 'desription'){
//do something
}
Cheers,
Rufat
-----Original Message-----
From: cocoa-dev-bounces+rufataa=email@hidden [mailto:cocoa-dev-bounces+rufataa=email@hidden] On Behalf Of douglas chanco
Sent: Monday, September 20, 2010 9:32 PM
To: email@hidden
Subject: php and cocoa
For those on the xcode mailing list I am not spamming or anything but on one of these lists xcode or cocoa, someone posted a link with an example of getting data from a php web page into objective-c
The responses I got on the xcode list while useful is not what I am looking for. What I am beginning to look at is an app that will send a http request to a php page and display the results (an image, description and qty)
I plan to have a php page that will return (depending on what it received)
1. a link to a image (or the actual image) I am still thinking this out
2. a single numeric value (quantity available)
3. a description of the item (a string)
any advice or the above mentioned link would be greatly appriciated
thanks
dougc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden