Results 1 to 9 of 9

Thread: skip website intro...

  1. #1
    Join Date
    Apr 2007
    Posts
    149
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default skip website intro...

    Hello Everyone... i found this website and im looking for that script that they have as soon as you enter their website, this script shows a page everytime somebody visitits it and at the bottom it has the option to skip it once or skip it everytime you enter the website. does anybody know where i can get such a script? it would be such a great help if anybody does.... thanks in advance...

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You could use a cookie.

    Store "visited" in a cookie and skip the page if that exists.

    <?php setcookie('visited',1,60*60*24*365); ?>
    would set it, or you could use javascript.


    <?php
    if ($_COOKIE['visited']==1) { header('Location: http://this.com/intro2.htm'); }
    ?>
    would redirect if they have visited.


    Should get you going in the right direction, anyway.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2007
    Posts
    149
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks but where do i put this code? on the page were the intro is? and what do i put on the link for them to skip it once? im not exactly an expert on this... can you help me?

  4. #4
    Join Date
    Apr 2007
    Posts
    149
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Ok i found this.. but still i need help... whenever i enter the website, i see the "Splashpage" but since i have a video on the main page, it starts playing as soon as i enter, but i want it to start playing once i skip the splashpage, how can i do this?
    Last edited by remp; 08-22-2007 at 07:50 PM.

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Hm... that's an option.

    1. You could turn autoplay off.

    2. You could get lucky and find a way to use javascript to trigger autoplay once the screen dissapears, but this might be tricky or impossible, depending on the way the video is embedded.

    3. You could redirect to another page after the screen dissapears.


    As for the code above, you would put it where it should go in response to the user. PHP code runs when the page loads; Javascript would be able to run in realtime with the user, so you could try that instead.


    Basically, set a cookie once the link has been clicked. You could have this trigger a javascript event that sets the cookie, send a variable in the URL to the PHP code (like my.htm?splash=skip), or just have a code on the next page that creates the cookie, regardless of how the user got there.
    Creating the cookie is as simple as using the setcookie() function in PHP, or a similar function in Javascript.

    Then, on the splash page, you check if that cookie exists, and, if so, redirect, using the second bit of code above.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Here's an example:


    SPLASH PAGE:
    Code:
    <?php if (isset($_COOKIE['visited'])) { header('Location: http://your.com/page2.php'); } ?>
    <html>
    .......
    <a href="page2.php">ENTER</a>
    PAGE 2:
    Code:
    <?php if (!isset($_COOKIE['visited'])) { setcookie('visited',1,60*60*24*365); } ?>
    <html>
    .......
    That's all you need.

    It will save a cookie when they skip the splash page the first time and won't show it again until the cookie is removed. The expiration date for the cookie is currently one year (and you can change that). You could set it to expire once a day, for example.

    Bueno suerte.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Apr 2007
    Posts
    149
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    ok but that would bring me back to how to direct the people to the splash page once they go to the website url?

  8. #8
    Join Date
    Apr 2007
    Posts
    149
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    OK nervermind. i made it work. but i still have that problem i told you about. the video still shows on the splash page, although it doesnt play because i changed the setting, it still shows. i can't figure out a way to fix this.

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    What type of video is it?

    You should be able to fix the problem with some manipulation of the z-index properties of the things on the page.

    Oh, just looked at the link in your PM.
    That quicktime video is embedded strangely. Scrolling on the page makes the video lag behind.

    I'd look at apple.com for an update to the embedding code.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •