Modular Merchant: Shopping Cart Software

Shopping Cart Software Service

Advanced SearchAdvanced Search RegisterRegister ProfileProfile FAQFAQ MemberlistMemberlist Log inLog in
Storefront Splash page - PHP help
Post new topic   Reply to topic
Modular Merchant Forum Index -> Web Design & Programming
Author Message

Danielle2104




Joined: 27 Nov 2009
Posts: 3


PostPosted: Dec 09, 2009 06:50pm    Post subject: Storefront Splash page - PHP help Reply with quote

I am trying to create a splash page for my storefront, but am encountering an issue where the person keeps being redirected to the splash page when they try to enter the store. I have tried two different non-PHP workarounds for this, neither work. The previous developer on this store knew PHP (I do not) and appears he used a cookie-based workaround for this, but all I have is the code that was present on the storefront.php page, I do not know what corresponding code to put on the splash page itself. Here is the snippet of code I found on the old storefront.php page:

<?php

if(!isset($_COOKIE['no_splash'])) {
session_write_close();
header('location: http://www.ourwebsite.com/page/3/splash');
exit();
}

?>

Can anyone help me with the code needed on the splash page to make this function correctly? Any help would be EXTREMELY appreciated!
Thank you!

Danielle2104




Joined: 27 Nov 2009
Posts: 3


PostPosted: Dec 09, 2009 08:12pm    Post subject: Nevermind All, I got it!! Reply with quote

Thanks Laughing

Mail Bag


Answering Your Questions Since... 9:30am

Joined: 28 Aug 2005
Posts: 198


PostPosted: Dec 10, 2009 03:03pm    Post subject: Reply with quote

Hello,

Quote:
I am trying to create a splash page for my storefront, but am encountering an issue where the person keeps being redirected to the splash page when they try to enter the store. I have tried two different non-PHP workarounds for this, neither work. The previous developer on this store knew PHP (I do not) and appears he used a cookie-based workaround for this, but all I have is the code that was present on the storefront.php page, I do not know what corresponding code to put on the splash page itself. Here is the snippet of code I found on the old storefront.php page:


Looking at the code sample provided it appears that the storefront.php page is expecting to find a cookie called no_splashin order to allow the user to continue forward into the store. This code also ensures that if a customer is viewing the store for the first time (first time in that particular shopping session), they will be automatically redirected to the Splash page initially, which is the intended behavior.

One approach that could be taken is to set a cookie named no_splash when the customer views the Splash Page; this way when they click on the link to enter the storefront this cookie will then be recognized by the code listed and not redirect the customer back to the splash page.

There are a few ways cookies can be set, provided below is a code sample for creating a cookie. This code should be included at Line 1 of the Splash page (before any other code), as this will set the cookie as soon as the customer views the splash page.

Code:

<?php
setcookie ("no_splash", "", '0');
?>


In this code sample, the cookie is set and with the no_splash name. This should prevent the storefront page from redirecting the customers back to the splash page all of the time.

Note: This cookie has been set with a '0' expiration, meaning that the cookie will be removed from the user's computer when they close their browser. This will ensure that the Splash Page is seen every time the user comes to the store again.

I hope this information was helpful and points you in the right direction. If you have any further questions, please let us know.
_________________
Modular Merchant Mail Bag
Answering your questions, queries and puzzlers.
Modular Merchant shopping cart software, website hosting, and custom programming.
Display posts from previous:   
Post new topic   Reply to topic    Modular Merchant Forum Index -> Web Design & Programming All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group