Jump to content

error message not displaying


slashpine

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.