Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    I can not find the error in my search engine

    can you help

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html><head>

    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
    <title>search</title>


    </head><body>

    <center>
    <h2>Review Nation</h2>
    <form action="./search.php" method="get">
    <input k="" size="50" type=" name=">
    <input value="search" type="submit">
    </form>

    </center>

    </body></html>






    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html><head>

    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
    <title>searchpage</title>


    </head><body>
    <h2>Review Nation</h2>

    <form action="./search.php" method="get"> <input name="k" size="" 50="" value="" type="text">
    <?php echo $_GET['k'];
    <input value="Search" type="submit">
    </form>

    <hr>
    <?php $k = $_GET['k']
    $terms = explode(" ", $k);
    $query = "SELECT * FROM search WHERE";
    for each ($terms as $each){
    $i++;

    if ($i == i)
    $query .= "keywords= LIKE '%each%' ";
    else
    $query .= " OR keywords= LIKE '%each%' ";
    }
    //connect
    mysql_connect("50.63.227.187", "reviewsearch", "gjhghhbgftgyh");
    mysql_select_db("reviewsearch");

    $query = mysql_query($query);
    $numrows = mysql_num_rows($query);
    if($numrows > 0){

    while ($row = mysql_fetch_assoc($query)){
    $id = $row['id'];
    $title = $row['title'];
    $description = $row['description'];
    $keywords = $row['keywords'];
    $link = $row['link'];

    echo "<h2><a href='$link'>$title</a></h2>
    $description<br /><br />";

    }
    else
    echo"No results found for \"<b>$k</b>\"";

    //disconnect
    mysql_close();


    ?>
    </body></html>
    Last edited by jmurphy45; 02-12-2012 at 02:35 AM.

  • #2
    New Coder
    Join Date
    Feb 2012
    Posts
    17
    Thanks
    4
    Thanked 1 Time in 1 Post
    What sort of error are you getting?

  • #3
    Regular Coder
    Join Date
    Jan 2012
    Posts
    134
    Thanks
    0
    Thanked 32 Times in 32 Posts
    I'd like to know as well. A quick glance though and I noticed this:

    Code:
    <input k="" size="50" type=" name=">
    Looks like you have a syntax error somewhere...probably a missing quote. The code you pasted looks like it was generated using firebug or something similar. It will often try to fix missing quotes and you get weird stuff happening like the above.

    Look at your code again for missing quotes. If the code you pasted wasn't from a debugging tool, then start by fixing the attributes on that input.

  • #4
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by KuriosJon View Post
    I'd like to know as well. A quick glance though and I noticed this:

    Code:
    <input k="" size="50" type=" name=">
    Looks like you have a syntax error somewhere...probably a missing quote. The code you pasted looks like it was generated using firebug or something similar. It will often try to fix missing quotes and you get weird stuff happening like the above.

    Look at your code again for missing quotes. If the code you pasted wasn't from a debugging tool, then start by fixing the attributes on that input.
    I looked at it again and it does look a syntax error. Could I make a page that would allow people submit sites to the data base


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •