PHP Condition !

Discussion in 'PHP' started by me4you, Apr 18, 2008.

  1. #1
    I want to check Browser's url and set a if--else condition.

    can anybody write the code for me? :confused:

    Thanks.
     
    me4you, Apr 18, 2008 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,875
    Likes Received:
    4,547
    Best Answers:
    123
    Trophy Points:
    665
    #2
    do a
    var_dump($_SERVER);
    Code (markup):
    and check the output. It will give you a stack of information.

    however if you are trying to see if your page is appearing in a frame from another site then you'll need javascript.
     
    sarahk, Apr 18, 2008 IP
  3. phpl33t

    phpl33t Banned

    Messages:
    456
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Try this:

    
    
    $thispage = $_SERVER['PHP_SELF'];
    echo $thispage;
    
    
    PHP:
     
    phpl33t, Apr 18, 2008 IP
    me4you likes this.