View Full Version : skip website intro...

08-22-2007, 05:33 PM
Hello Everyone... i found this (http://www.bennyhinn.org) 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...

08-22-2007, 06:10 PM
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.

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.

08-22-2007, 07:09 PM
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?

08-22-2007, 07:38 PM
Ok i found this (http://www.dynamicdrive.com/dynamicindex3/dynamicsplash.htm).. 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?

08-22-2007, 08:47 PM
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.

08-22-2007, 11:10 PM
Here's an example:


<?php if (isset($_COOKIE['visited'])) { header('Location: http://your.com/page2.php'); } ?>
<a href="page2.php">ENTER</a>


<?php if (!isset($_COOKIE['visited'])) { setcookie('visited',1,60*60*24*365); } ?>

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.

08-22-2007, 11:23 PM
ok but that would bring me back to how to direct the people to the splash page once they go to the website url?

08-22-2007, 11:36 PM
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.

08-23-2007, 12:21 AM
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.