search utility still doesn't work

Discussion in 'PHP' started by t7584, Mar 22, 2006.

  1. #1
    search utility still doesn't work
    Parse error: parse error, unexpected T_VARIABLE on line 13

    <?php

    // Get the search variable from URL

    $var = @$_GET['q'] ;
    $trimmed = trim($var) //trim whitespace from the stored variable





    $lines20 = file ('gb.txt');
    $i=0;
    foreach($lines20 as $rec20) {
    $pos = strpos($rec20, $trimmed);
    if ($pos !== false) {
    $a20[$i] = $rec20;
    $i = $i + 1;
    }



    if ($i=0) {
    echo "0 results";

    }
    else {
     
    t7584, Mar 22, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Change $trimmed = trim($var) to $trimmed = trim($var);
     
    mad4, Mar 22, 2006 IP