Jump to content


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


Simple but confusing issue!

Recommended Posts

I have a simple script to enable administrators to search a MySQL database for a person's surname. The script works fine in Firefox and displays the data as it should, but when you click "search" in IE6, it does not return anything except the search form again.

Below is the code for my search form:

echo ("
    <link type=\"text/css\" rel=\"stylesheet\" href=\"style.css\">
    <form action=\"$php_self\" method=\"post\">
    <table class=\"formtable\" align=\"center\">
    <tr><th colspan=\"2\">Search for a Club Member</th></tr>
    <tr><td><input class=\"form\" name=\"findphrase\"></td><td><input class=\"form\" type=\"submit\" name=\"find\" value=\"search\"></td></tr>
if (isset($_POST["find"])) {
    $term = addslashes($_POST["findphrase"]);
    echo ("You searched for \"$term\"<p>");
    $sql = mysql_query("SELECT * FROM memberdata WHERE surname LIKE '%$term%'")
        or die ("Could not query the database");
    $num = mysql_numrows($sql);
    if ($num > 0) {
        echo ("Found $num results<p>");
        while ($row = mysql_fetch_array($sql)) {
            echo ("<a href=\"members.php?choosemember=$uniID\" title=\"$forname $surname\">$forname $surname</a><br>");
    } else {
        echo("No results found for that term, please try again");

Any help much appreciated!!

Share this post

Link to post
Share on other sites
if (isset($_POST["find"])) {
if (isset($_POST["findphrase"])) {

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.