I am writing an application that utilizes PHP and MySQL.
I have a form that I would like to prefill with user information that is obtained from a MySQL database.
So far I have a field that a person can enter a username or partial username and lookup the user information and insert it into the form.
The way it is setup now is I have two files one that does the lookup and generates a list of people to select from..then submits the username to the form which is used to create a helpdesk ticket.(it's helpdesk software I'm writing)
I am trying to combine the two at least partially. What I would like to do is have the lookup on the same page as the form used to create the ticket.
My problem is how do I do I get the page to do the lookup once a person enters a name and presses the lookup button.
One other issue is what if no user is found and the person wants to use the create ticket button at the bottom of the page to insert the ticket into the database?
Any ideas on how to implement this. I have a way of using multiple pages as I stated earlier but, that can get troublesome if I add the lookup to the page with the rest of the form.