views:

250

answers:

3

I created php pages.. those php pages are registration form.with the fields.FirstName,LastName and CompanyName...If I fill the information in that form and hit submit the data will store it on the mysql database.And I created one page...that displays the data which I have added through register form...I have a button on this page which displays the data...my question is when I click that button...my display data must store on the Iphone ...is that possible to do.....or any other solution.....and how to use php on Xcode....?

+1  A: 

You appear to be confusing server and client-side programming.

If you want to run stuff on a website on the iPhone to save locally, you will have to use HTML5 and Javascript, and HTML5's feature for local databases (if the iPhone doesn't support this currently, it certainly will soon).

PHP will run on the server, if you want to save the data on the server-side.

If you want to run stuff only locally on the iPhone, then you'll want to look into XCode and Objective-C. The iPhone uses SQLite as a local database for applications to use.

JeeBee
yeah I understand and do you know how to write php coding on Xcode.....?cocoa php application....
Xcode doesn't work with PHP. Xcode is built to be used with in C, C++ or Objective-C programming languages. It doesn't matter in what language you wrote your server side code. On the iPhone, if you want to write an app, you'll have to write it in Objective-C
nash
How can I create a registration form on Iphone so that if I submit the form the data must be store on my database which is on my webserver which is mdb file?
I'd look into web services. You'd write a server, that runs on your server, that takes the data from the web via a web service. You can do this in PHP. On the iPhone you would create a client for the webservice in Objective-C and Cocoa-Touch, that submits to the web service.
JeeBee
Hello JeeBee,Would you please help me in creating a client for the webservice in Obejective-C and Cocoa -Touch ?krishyyy
Sorry, no time, and no Mac at the moment either. Good luck. Apple have a lot of tutorials online.
JeeBee
A: 

Are you opening your webpage in Safari on the iPhone, or are you planning on having an application running?

If you have a server with a PHP application, why would you want to store the "display data" on the iPhone? Is this for offline use?

Users can copy/paste info to notes on their iPhone, though this is not a very handy solution.

If you want the phone to remember the data locally, you can set the expire header of your application to a date in the far future, but be careful as this has risks if you change data and the client doesn't learn about it because it thinks it has a valid local copy.

Also, read this (short) article about caching data with HTML on the iPhone: http://ajaxian.com/archives/html5-features-in-latest-iphone-application-cache-and-database

That suggests it is supported. But, I wouldn't know how. I'm sure google can help you there.

nash
A: 

You could just capture the user's information in standard UITextField's and then submit the form programmatically using ASIFormDataRequest from the ASIHTTPRequest library. It's made specifically for posting data to a form.

Matt Long