HELP Parse error: syntax error, unexpected T_STRING

Discussion in 'PHP' started by SeR_Cyclops, May 16, 2008.

  1. #1
    I am getting a T_STRING error on my page with this code

    <?php ob_start();

    if(isset($_REQUEST[’kw’]))

    {

    $kw = preg_replace(’/%20/’,’ ‘,$_REQUEST[’kw’]).”";

    $k1w = urldecode( $_REQUEST[’kw’] ).”";

    }

    else

    {

    $k1w = NULL;

    }

    ?>



    It says that the error is on this line :$kw = preg_replace(’/%20/’,’ ‘,$_REQUEST[’kw’]).”";


    If anyone can help thank you sooo much.
     
    SeR_Cyclops, May 16, 2008 IP
  2. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Allow me to re-write your post with better formatting:
    ----------------------------------------------------

    I am getting a T_STRING error on my page with this code

    ob_start();
    if(isset($_REQUEST[’kw’]))
    {
      $kw = preg_replace(’/%20/’,’ ‘,$_REQUEST[’kw’]).”";
      $k1w = urldecode( $_REQUEST[’kw’] ).”";
    }
    else
    {
      $k1w = NULL;
    }
    PHP:
    It says that the error is on this line :

    $kw = preg_replace(’/%20/’,’ ‘,$_REQUEST[’kw’]).”";
    PHP:
    If anyone can help thank you sooo much.
    ------------------------------------------------------
    No let's see..

    You probably noted with this colored code that you have extra double quotes at the end of that line ...
    
    {
      $kw = preg_replace(’/%20/’,’ ‘,$_REQUEST[’kw’]);
      $k1w = urldecode( $_REQUEST[’kw’] );
    }
    PHP:
     
    selling vcc, May 16, 2008 IP
  3. SeR_Cyclops

    SeR_Cyclops Peon

    Messages:
    103
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you very very much. :)
     
    SeR_Cyclops, May 16, 2008 IP