RE: SEARCHING for an answer...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Correct. PHP_SELF refers to index.php which is the page that the  
search is happening on. a few lines above that there is a reference  
to edit.php and here is the code for it:

Sorry for the long cut/paste, but I thought it was important to try  
and provide it in context, and the line where it says :
<td><a href='edit.php?Record={$row['Record']}'>Edit</a></td> is the  
ONLY reference to edit.php in the entire code of that page.


//Display the info using heredoc syntax
echo <<<HTML

	<tr>
	
		<td>{$row['FName']}</td>
		<td>{$row['LName']}</td>
		<td>{$row['Add1']}</td>
		<td>{$row['Add2']}</td>
		<td>{$row['City']}</td>
		<td>{$row['State']}</td>
		<td>{$row['Zip']}</td>
		<td>{$row['XCode']}</td>
		<td>{$row['Record']}</td>
		<td><a
href='edit.php?Record={$row['Record']}'>Edit</a></td>
		<td><a
href='delete.php?Record={$row['Record']}'>Delete</a></td>
	</tr>

HTML;

}
echo "<div class=\"nav\"><A Href=\"excelexport.php\">Export to Excel</ 
A><BR><A href=\"logout.php\">Logout</A><BR><a href=\"add.shtml\">Add  
Record</A>";
echo "<P class=\"total\">Total Records: $num_rows</P></div>";

echo "</div></div>";

}
$search = $_GET['search'];
$self = $_SERVER['PHP_SELF'];
$qstring = "SELECT * FROM current WHERE FName like '%$search%' or  
LName like '%$search%' or Add1 like '%$search%' or Add2 like '%$search 
%' or City like '%$search%' or State like '%$search%' or Zip like '% 
$search%' or XCode like '%$search%'";
echo $qstring;

if ($search != NULL){
echo "The search string is: <strong>$search</strong>.<BR>";
echo $search;
$qresult= mysql_query($link, $qstring);
echo "Query completed";
}
else {
echo ('
<form action="'.$self.'" method="get">
<label>Search:
<input type="text" name="search" id="search" />
</label>
<input type="submit" value="Go!" />
</form>
');
}

>
[/snip]

Are you getting the output from echo "The search string is:
<strong>$search</strong>.<BR>"; or it is redirecting before that? How
long is the complete code for the page, you may have to paste all of it
or use pastebin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux