Accessing PHP web service in iPhone - php

I have accessed .net webservices in iPhone,now i like to develop PHP webservice which has to be consumed by my iPhone application.
Is it possible to consume a PHP web service in iPhone,if possible can anybody suggest me a good tutorial or web reference for designing a simple web service in PHP and consuming it through a iPhone application.
Thank a lot in advance...

Yes, it's perfectly possible. The client (iPhone) doesn't care in the very least what programming language you use on the server, as long as the output (HTML, XML, JSON, whatever else you want to consume) is something the client understands.
You don't need a tutorial, it's no different from making a normal website with PHP.

Related

Integrate a chatbot (using php, aiml 1.0, program-O) onto a website written in .NET

We have a chatbot written in aiml 1.0 using program-O as the interpreter, basically we used PHP, ajax. Now we want this to be integrated onto a website which is in .Net environment. Has anybody done this before?
Integrating different technologies isn't too difficult, if you are able to make adjustments in both languages then using JSON from the browser to your PHP chat backend could easily work.
However, if you do not want to expose your PHP application directly to the end user, then an application to application interface would work as well. For example JSON, SOAP, REST are all good API protocols to use.

Chrome web apps - server side support

Does Google Chrome web store support server sided technologies such as PHP or Python?
I am currently making a productive web application which i have already implemented in python but i wish to give it a nice little web application interface and also harness the power of PHP...
Does Chrome support Python or PHP; or does Chrome even support Server sided scripting?
I am learning how to develop chrome apps from here...
If a member is aware of any better tutorials please inform me...
Or is it that i just have to build a normal web applications and add a logo and manifest and zip it and publish it?
Thankyou...
The platform supports server-side technologies the same way a C++ or Java application would support them: through HTTP (probably RESTful) interfaces that the server side of your app (if any) exposes. For example, your app might make a request to http://example.com/api/foo/bar/baz?param1=123&param2=456, and might get back a JSON response that your app would then parse. It doesn't really matter which server-side technology you're using, because the API looks the same from the app's perspective.
If you're asking about PHP, Ruby, Python, Go, node.js, etc., running on the user's machine as a client-side app, no, that's not how Chrome packaged apps work (though in theory one could get one of those environments running as a NaCl module that then generates client-side code). Instead, you write code in a very similar way to how you'd write a pure AJAX app: in JavaScript, without navigation, with the content/data being fetched in a RESTful fashion from whatever server/service you use (or none in the case of something like a calculator or simple game that doesn't talk to the network at all). Incidentally, we're finding that very AJAXy apps are relatively simple to convert to packaged apps.
Check out all the samples at https://github.com/GoogleChrome/chrome-app-samples to get more an idea of the shape of the platform.

Moving php apps to Android and iPhone

I am a php developer with a few web apps like a project management app and a forum i'd like to move to Android and iPhone.
I've heard of developers using Sencha Touch and PhoneGap to develop native apps and I know they support HTML5, CSS and Javascript, but how abot PHP? And is are there any other APIs/frameworks I should consider that better support local server scripting?
Speaking about webapp, maybe you can avoid building an app by having a mobile enabled version of your website compliant with all the client browsers.
Have a look at jquerymobile, it is compliant with mostly all the mobile browsers and you will be able to reuse your code.
To answer correctly, you can call your webservices using ajax to fetch json/xml/etc data from Phonegap because it is using jQuerymobile ;-)
Have a look at this discussion here on Stackoverflow :
Passing formdata from Phonegap to PHP with JSON
Hope this helps
PHP is a server-side scripting language and your .php files have to be stored on the server side. You can access them asynchronously with Ajax, so no, you can not include php files (with reasonable time and effort) in your app.
The only smart way to go here is native iOS apps, forget PHP, Android and the rest of that crap. By the way I'm not trying to be an iOS snob here but am just reflecting on a few realities. One is that iOS apps can actually make money though a web replacement app might not. The second issue is that going native demands a reboot on your part, that is best done on one platform until you get up to speed. The third issue is that users now a days expect well performing apps that don't have a lot of web cruft in them. Fourth the Android marketplace is screwed, you are far more likely to establish that critical user base on iOS as you can target a handful of platforms running the latest generation of iOS, android is by comparison a pathetic mess of old versions of android running on all sorts of hardware.
On iOS look a BlueAlien as an example of a better than web method of accessing Reddit.

how to consume .net webservices

please tell that can we consume .net web services in php or not.
if yes then please tell me how can we do it.
i am to create a web service which takes values and save it in database also it will take values and reply some data as a standard xml format.
i know how to create web service and how to use it in asp.net but don't know how to use/call it from php.
thing is that i will not be writing code in php to consume but wants to know that do i need to take care of any special thing or need to do some extra code to make it available and use by php developers.
i am to create web service in .net framework 2.0
Thanks
It's possible, but it looks like you have your work cut out for you. .Net web services are based on SOAP. The PHP class you're looking for is SoapClient.
Take some time to read through the PHP site's documentation. .Net hides a lot of the raw SOAP nuts and bolts, so you're going to need to peel back the curtain on your web service a bit.
One easy way is to play with an existing WS client through a proxy like Fiddler, which lets you see exactly what's going back and forth.
Good luck,
n.

How to make my server work with an iPhone app?

I am working on a social network project in PHP/MySQL. If you have ever seen or used the myspace or facebook iPhone app you will see what my question is all about. I am curious what most iphone apps do with the server for a social network type iphone app. I was tyhinking possibly it uses a REST server with jSON or XML output and possibly the iphone app will just read that? Or does most iphone apps do there own query to a database somehow? Sorry I really don't have any knowledge in that sort of programming so I could be way off on all this.
So basicly what would be the most efficient way for a iphone app to get data from a server?
In my opionion, the ASIHTTPRequest Library, a RESTful Webservice and the JSONTouch library are working great together.
To get you started (including a PHP/MySQL example) take a look at this great tutorial:
iPhone Coding Tutorial – Creating an Online Leaderboard For Your Games
A RESTful approach is almost certainly the cleanest and easiest. The iPhone API has great support for communicating via XML.
There are some fairly comprehensive examples in Apple's Developer Connection.
http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/XMLParsing/XMLParsing.html
You would use JSON or XML web services but you can use whatever HTTP mechanism you like.
Answering the second part of your question no the apps don't normally talk direct to the database but use web services instead.

Categories