Page 1 of 1

Creating a default value for textbox from previous search

Posted: Wed Apr 09, 2008 1:01 am
by havoc2005
I am implementing a search feature using PHP. How would I be able to create a default value for the search textbox which will be the previous search string. Of course this will be blank when first loaded.

After search is passed I would like to display the same page with the previous string in the box and an error message Invalid search expression, or no matching files found. Please try again.

Thanks

Re: Creating a default value for textbox from previous search

Posted: Wed Apr 09, 2008 6:03 am
by aceconcepts
You could use a session variables and just set the form element values equal to the variable.