Html5 Tutorial - Future Technology

Wednesday, 19 June 2013

PhoneGap Tutorial - posting form data to MySql database Using PHP

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
Category:
Website:
CouponTitle :
CouponDescription :
CouponCode :
AffiliateLink :
AffiliateImage :
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.

20 comments:

  1. I 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.

    ReplyDelete
    Replies
    1. Can you post your error shown in logcat.

      Delete
    2. I get the same issue. No error, just a blank screen.
      If 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?

      Delete
    3. I am experiencing the same problem with a blank screen and no new entry in the database.
      Has 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?

      Delete
  2. does phonegap accept php.how do i linkt them?

    ReplyDelete
    Replies
    1. No 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.

      But you have to use rest services like json , xml for backend data and parse this files using javascript.

      Delete
    2. 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.

      Delete
  3. Its working absolutely fine.............

    ReplyDelete
  4. Can somebody please post the SQL for the DB??

    ReplyDelete
    Replies
    1. We are using MySql DB for this , and for creating database and some simple data please go to this tutorial....

      http://www.w3schools.com/sql/

      Delete
  5. 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 ;)

    cheers

    ReplyDelete
  6. 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..

    ReplyDelete
  7. Hi. 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.

    Please joseberrios@hotmail.com from caracas venezuela

    ReplyDelete
  8. thanxxxxxxxxx ....its wrking

    ReplyDelete
    Replies
    1. Hi pratap.its not working for me.can u please send me the code for my mail id soumya89murthy@gmail.com.thank u in advance

      Delete
  9. hi, 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

    ReplyDelete