Skip navigation.


Web Site Design News & Tips

Helping you get the job done better

Simple php search script fix

There is a simple php search script tutorial online but the code is broken.


//This is only displayed if they have submitted the form
if ($searching =="yes")
{
echo "

Search Results

";

//If they did not enter a search term we give them an error
if ($find == "")
{
echo "

You forgot to enter a search term

";
exit;
}

The missing info is that the query isn't looking to what search term was used. Add this to the relevant section above the form.

$parameter = array('find', 'field', 'searching', 'search');
foreach($parameter as $name)
{
$$name = isset($_REQUEST[$name]) ? $_REQUEST[$name] : '';
}

[ 10/02/2006 09:53:00 AM ] Read...

I trust that this Web Site Design News & Tips helps bring you up to date with what I have been up to recently. If you want to contact me then click here. Thanks for reading some of the most recent news. If you want to read some of the older files then they have been stored in the archives here.

Loading

Useful Links

Follow mikeallbutt on Twitter
There are two ways to live and there is a choice we all face. What is your choice? Visit (link) to understand more.

TOP