PDA

View Full Version : How to create a dynamic self-updating pages



simbarashe
11-28-2006, 03:37 AM
I'm new to PHP and MYSQL i would like to ask the best way to make a page that prefills itself if a person is entering a customers name that is already in the database. In onter words I just want a script that checks if a certain customer exists in my system without submiting the form... Is there a way using PHP or can i embed another language in PHP that could do that and what could that language be

syosoft
11-28-2006, 05:56 AM
I think you might be looking for a dhtml (or ajax) solution. Pretty simple to pull off...
throw an onkeydown event on the customers name field, something like...

onkeydown="getCustData(this.value);"

obviously that function exists in javascript and is setup to use an ajax style request to the server passing the customer name, and when it gets data back - populate the rest of the fields.

This is more of a javascript question though, as the only thing you'd need php for was the querying of the database and the output of the array.