SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict bbparis's Avatar
    Join Date
    Aug 2008
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AD page for the first visit

    Hello,

    Somebody knows where can I find the full explication, or a free script / tutorial, about making an advertising page for first visitor's visit to the website ?? so if he visits any page inside the website for the first time by day, an advertising page will appear and he has to click on SKIP AD PAGE to view the page that he was visiting.

    I appreciate your help.
    thanks in advance

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    session_start
    ();
    if((
    true === isset($_SESSION['first_visit'])) && (false !== $_SESSION['first_visit']))
    {
        
    #display ads
    }
    else
    {
        
    $_SESSION['first_visit'] = false;
    }
    ?>
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Addict bbparis's Avatar
    Join Date
    Aug 2008
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello SilverBulletUK

    First of all, you are so nice, I got a lot of help from you before, I appreciate that.

    hemmm ok for the code, but to be honest I don't know where have I to insert it ?? because I have many scripts on the site, so I think it should be related to .httpaccess no ?? I hope you will explain for me more about this step.

    think for example that visitor comes from a search engine to : www.mywebsite.com/script1/page5165165165.php ( or html )
    how can I forward his visit to the AD page ??

    and how it's working is I have many HTML pages ?

    Thanks in advance for your help.

  4. #4
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Place the code I posted into a separate file, then use a .htaccess to instruct Apache to 'prepend' this script to any request.

    Here's a little more info.

    Good luck!
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  5. #5
    SitePoint Addict bbparis's Avatar
    Join Date
    Aug 2008
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot my cyber friend, I will test that I think this evening and I will back to you with the result. I appreciate your help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •