Creating a default value for textbox from previous search

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
havoc2005
Forum Newbie
Posts: 1
Joined: Wed Apr 09, 2008 12:55 am

Creating a default value for textbox from previous search

Post 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
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Creating a default value for textbox from previous search

Post by aceconcepts »

You could use a session variables and just set the form element values equal to the variable.
Post Reply