Jump to content

Archived

This topic is now archived and is closed to further replies.

slashpine

error message not displaying

Recommended Posts

I have a script that searches a database for individual business names...

way too may users are trying to use this script/form to find business categories, regardless of the fact it is distinctly labled as such...

The programmer that originally helped me with this scrpt included such an error message but it does not work... if there are no results the script returns a blank form with no message...

how can I get this script to return a message telling users they are using the wrong form when no results are returned

here is the part of the scrip that does not work

TIA for any help...

[code]$PHP_SELF = $_SERVER['PHP_SELF'];

$searchTerm = trim($_POST['searchTerm']);

$submit = trim($_POST['submit']);




$input_form = <<< END

<form name="searchForm" action="{$PHP_SELF}" method="post" onSubmit="return checkInput();">

Search by name:

<input type="text" name="searchTerm" size="20" maxlength="45">

<input type="hidden" name="submit" value="Search">

<input name="submit" type="submit" value="Search">

</form>

END;




$error_msg = <<< END

<font color="red">We are unable to process your request at this time, please try again in a few moments.</font>

<br><br>

$input_form

END;

// if no results,

$no_results = <<< END

There were no results with the searchterm '<font color="blue">{$searchTerm}</font>', please try again.

<br><br>

$input_form

END;





?>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.