Some code help.. very simple

Discussion in 'PHP' started by Proxyhub, Jan 31, 2008.

  1. #1
    Okay everyone.. here is the code I am working with.

    
    <?php
    $url = “google.com”;
    if ($_GET[’OVKWID’]) {
    $url = “google.com” . $_GET[’OVKWID’];
    }
    header("Location: http://www.".$url);
    ?> 
    Code (markup):
    Now, go to
    http://www.dir111.com/greenteax
    It is suppose to go to www.google.com, but for some reason it tries to go to

    http://www.%93googlecom%94.com/

    Any help, anybody? :confused::confused::confused::confused:
     
    Proxyhub, Jan 31, 2008 IP
  2. imvain2

    imvain2 Peon

    Messages:
    218
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would get rid of the ticks and use normal quotes, I also made a minor change to your header line

    
    <?php
    $url = "google.com";
    if ($_GET["OVKWID"]) {
    $url = "google.com" . $_GET["OVKWID"];
    }
    header("Location: http://www.$url");
    ?>
    
    PHP:
     
    imvain2, Jan 31, 2008 IP
  3. lfhost

    lfhost Peon

    Messages:
    232
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    the code should be

    
    <?php
    $url = "google.com";
    if ($_GET["OVKWID"]) 
    {
       $url .= $_GET["OVKWID"];
    }
       header("Location: http://www.".$url);
       exit;
    ?>
    
    Code (markup):
     
    lfhost, Jan 31, 2008 IP