So, I have a page that is both the query and results page. The query searches for books in a library database and displays the results. The problem is that I'm using $_POST[""] variables to get the query parameters and the results page is the same page as the query page. This is giving me a warning message that the variable doesn't exist when the page first loads and a query has yet to be performed:
Does anyone know how I can perform a check to see if a POST method has been executed before attempting to access the $_POST[""] variables or if that isn't possible, if there is a way to suppress that error so it isn't written to the page?Notice: Undefined index: query in E:\Inetpub\WWWRoot\testing\aq-db\query.php on line 72
The code that generates the query (for now):
Code: Select all
<?php
if($_POSTї"e;query"e;] != null){
$connectionstring = odbc_connect("e;Allacquistions"e;, "e;"e;, "e;"e;);
$queryStr = $_POSTї"e;query"e;];
$searchOpt = $_POSTї"e;search-option"e;];
$Query = "e;SELECT * FROM AllFields WHERE ($searchOpt LIKE '%$queryStr%' ) ORDER BY TITLE ASC"e;;
//...irrelevent code removed...
odbc_close($connectionstring);
}
?>Gabe