Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: PHP: Get input box value
10-31-2012, 03:15 AM #1
- Join Date
- Sep 2012
- Thanked 0 Times in 0 Posts
PHP: Get input box value
Hi I am trying to see if a username is already taken in my table.
The following code calls the Java function when the user clicks out of the textbox.. It works great but I have to manually enter a username where it says 'HERE!?'
I would like it to use the value of the textbox 'text'.
How would I go about doing this?
10-31-2012, 08:49 AM #2
- Join Date
- Jan 2010
- Behind the Wall
- Thanked 349 Times in 345 Posts
completely wrong approach. PHP is executed on the server before the HTML/JS is displayed in the browser.
hence you cannot mix JS and PHP like that.
what you can do is ask a PHP script via AJAX, whether a certain username exists. and of course the DB table needs to be unique on the username field.
The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.André Behrens, NY Times Software Developer