Hi friends i am going to explain how to post mobile form data to MySql Database using PHP :
Title : PhoneGap Tutorial - posting form data to MySql database Using PHP.
Here is the html form source code ,
Requirements :
PHP Server(you can install it in your local server or other wise you can use many free php webhosting servers online , I am using neq3.com for free control panel)
Html5
JavaScript
Css
Here are the source files Html and JavaScript Files :
Index.html
Insert title here
Ajax Form
Here is the PHP Server file :
All Form data will be stored in mysql database like this
In my next tutorial i am going to explain how to convert this table data xml service or xml sothat it can be used as webservice.
Thanks man. Excellent.
ReplyDeleteYou are the man :D
ReplyDeleteI tried this and it works fin in browser but when packaged as a phongap app on android it does not work. When I submit the form I get a white screen and no new records in the DB. I have all the linked files with full http urls to the JQuery script and php file.
ReplyDeleteCan you post your error shown in logcat.
DeleteI get the same issue. No error, just a blank screen.
DeleteIf I just open the html file in Firefox on Android, it works fine.
Package it up into Phonegap and it doesn't work.
Any ideas?
I am experiencing the same problem with a blank screen and no new entry in the database.
DeleteHas anyone found a solution to this problem?
Also, if phone gap doesn't support php files, should the php file not re-direct to a html file?
does phonegap accept php.how do i linkt them?
ReplyDeleteNo phonegap does not accept php or java or any thing , PhoneGap is framework for mobiles to develop hybrid applications using HTML5,CSS,JavaScript. It takes help of Native WebView.
DeleteBut you have to use rest services like json , xml for backend data and parse this files using javascript.
PHP or JAVA is used to build rest services by storing some data in database and this will be converted to restservices. and in phonegap we use javasscript to parse rest services.
DeleteIts working absolutely fine.............
ReplyDeleteCan somebody please post the SQL for the DB??
ReplyDeleteWe are using MySql DB for this , and for creating database and some simple data please go to this tutorial....
Deletehttp://www.w3schools.com/sql/
Hey buddy, thanks for the code, but you should really HIDE YOUR PASSWORD AND SERVER ADDRESS, including the database name, because you're asking for someone to hack you. :) Just put something like "password_here" instead of your real password ;)
ReplyDeletecheers
It works, it save data yet i have some problem, im using an ripple emulator. after a successfully saved record it does not return to the page.it is already blank.how should i fix that..
ReplyDeleteNice Super
ReplyDeleteHi. Could you send me the code for the posted: 06/16 - 06/23 (4) PhoneGap Tutorial - posting form data to MySql, so i want to learn about that.
ReplyDeletePlease joseberrios@hotmail.com from caracas venezuela
thanxxxxxxxxx ....its wrking
ReplyDeleteHi pratap.its not working for me.can u please send me the code for my mail id soumya89murthy@gmail.com.thank u in advance
Deletehi, can u please send me the code for this.It will be very helpful .mail id is soumya89murthy@gmail.waiting for ur response.thank u in advance
ReplyDeletesmm panel
ReplyDeletesmm panel
İs İlanlari
İNSTAGRAM TAKİPÇİ SATIN AL
hırdavatçı
beyazesyateknikservisi.com.tr
SERVİS
Tiktok hile