Registration form in phonegap using php

Hello all,
i am starting with building mobile application using html5, css3, javascript/jquery with phonegap, which i just have finished studying.
The very first application which i want to create is a registration system which will have:

  1. A login form where the user will enter his id and password
  2. If user is new, the form will be redirected to the registration form.

All the information will be stored in the ‘mysql’ database.

so, the problem which i am getting in my flow diagram of the whole process is how to check whether the user is registred or not, as for that, the user will have to directed to the server side, and will have to be redirected to the registration form, if not already registered.

Another problem which i see is whether phonegap has support for php scripts or not as i have not found any thing relating phonegap to php scripts.

Phonegap can interact with server side scripts, including those made in php. You can read/send data from the server in any normal format e.g json, name value pairs, xml etc

Display data in PG from external MySQL, using PHP and XML (both links needed)
http://www.techrepublic.com/article/create-xml-with-mysql-and-php/5035149
http://www.switchonthecode.com/tutorials/xml-parsing-with-jquery