Whats Wrong With This Script

Discussion in 'PHP' started by !Unreal, Nov 19, 2008.

  1. #1
    Ive got this script to insert the URL someone has requested if they are using Firefox. But its not working.

    Can anyone spot the problem?

    
    <?php
    $con = mysql_connect("localhost","user","pass");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("db", $con);
    
    $req = .$_SERVER['REQUEST_URI'];
    
    if(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/3.0.4') !== false)
    {
    $req = .$_SERVER['REQUEST_URI'];
    mysql_query("INSERT INTO agent (firefox) 
    VALUES ('$req')");
    }
    
    ?>
    
    PHP:

     
    !Unreal, Nov 19, 2008 IP
  2. lp1051

    lp1051 Well-Known Member

    Messages:
    163
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Hi, didn't try, but why the dot is there?? I would use only - $req = $_SERVER['REQUEST_URI'];
    If there's some other problem, can you post the error or warning you get??
     
    lp1051, Nov 19, 2008 IP
  3. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #3
    I think the problem is with the dot.

    Maybe what u want is :

     
    ads2help, Nov 19, 2008 IP