close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

redirect from index page

Thread began 2/16/2010 6:45 am by i.edwards384429 | Last modified 2/19/2010 1:30 am by i.edwards384429 | 1687 views | 4 replies |

i.edwards384429

redirect from index page

Hi

I'm trying to setup a redirect based on a 5 day cookie life. I've searched and cannot find a solution recipe
so over the past weeks I've been working on it.

I now have on my index.php page above the header

<?php
if( !(isset($_COOKIE["splashCookie"])) ) {
header("Location: http://www.ashburyblinds.co.uk/splash.php");
}
?>

on the page splash.php I have

<?php
if ("" == "") {
setcookie("splashCookie", "visited", time()+(60*60*24*5), "/", "", 0);
}
?>

This does not seem to work, any ideas why?

thanks

Ian

Sign in to reply to this post

Dani Chankhour

On your splash page, you need to change:

if ("" == "") { to

if( !(isset($_COOKIE["splashCookie"])) ) {

because you only want to set the cookie once, otherwise the cookie expiration time will be incremented by 5 days every time your visit the page.

Sign in to reply to this post

i.edwards384429

update

Hi Dani

regrettably no further forward!

If I go to

index.php

the page does redirect to

splash.php

the code at the top of the index page is:

<?php
if( !(isset($_COOKIE["splashCookie"])) ) {
header("Location: http://www.ashburycurtains.co.uk/splash.php");
}
?>

I can find no other code relating to the cookie ie no onLoad events.

On the splash page is the code:

<?php
if( !(isset($_COOKIE["splashCookie"])) ) {
header("Location: http://www.ashburycurtains.co.uk/splash.php");
}
?>

Again there appears to be no onload event set or any other code.

The help files are not "helpful" (to me a novice) and there is regretably no road map for what I assume is a core use of cookies!

would appreciate your input

thanks

Ian

Sign in to reply to this post

Dani Chankhour

When i go to:

index.php

the first time I'm redirected to:

splash.php

which is correct. And when i go back to your index page, i'm not redirected anymore, which also seems correct. Could you explain a little more about what is not working?

Sign in to reply to this post

i.edwards384429

update

Hi Dani

apologies late late last night ( 1 am - dammed olympics) I noticed a possible code error which got it all working.

Became involved in the Olympics and forgot to post the solution.

As always simple- I forgot that splashCookie is different from splashcookie

changed the case and all is now working!!!

thanks

Ian

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...