PDA

View Full Version : Cookies and URL questions...



jderosa3
March 11th, 2008, 09:11 AM
I have two questions and not sure where they should be posted, but I thought this would be the best place.


1) I am making a site that has a flash intro that explains about the company... Is there a way to have a cookie stored on the person's computer so that when they come back to the site it skips the flash intro they already viewed... for instance if the flash intro is on index.html it would forward them to the site on index2.html

2) how do some sites hide the trailing end of their URls.... instead of it displaying like:

http://www.mydomain.com/index.html, contact.html, etc.

it would just display as:

http://www.mydomain.com/


Thanks for any advice you can give on this.

simplistik
March 11th, 2008, 09:42 AM
1) well if you're using php you would so something like this:


// setcookie() would be executed after the first time you view the intro or whatever this one will expire in 30 days
setcookie( "skipIntro", 1, time()+60*60*24*30 );

// call this at the top of the page, if skipIntro has been set then it'll just goto the new page
$skipIntro = $_COOKIE['skipIntro'];
if ( $skipIntro == 1 ) header ("Location: index2.html");


2) Canonicals, some people refer to them as "clean urls"