1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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,500
    Likes Received:
    4,460
    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.