Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9265327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:02:40+00:00 2026-06-18T14:02:40+00:00

Alright, I’ll try and keep this simple and sweet. I am working on my

  • 0

Alright, I’ll try and keep this simple and sweet. I am working on my wesbsite, and it currently loads a splash page when the user first loads the site. That is the behavior I want.

  1. if the user has never been to the site before, redirect to splash page.
  2. if user has been to the site before and did not want to see the splash don’t redirect.
  3. if user likes splash and wants to see upon new session, show splash page.

those basically the scenarios i am working with, can’t really think of any more, been trying to hack something out for the past couple of hours with no luck.

index.php

<?php
setcookie("visit", "true", mktime (0, 0, 0, 12, 31, 2014), "/"); // delete cookie on 31DEC14

$cookie_splash = $_COOKIE['splash'];
$cookie_visit = $_COOKIE['visit'];
$cookie_visit_now = $_COOKIE['visit_now'];

do {

    if ($cookie_splash == '' && $cookie_visit == '' && $cookie_visit_now == '') {
        /*
        echo "<script type = text/javascript>";
        echo "window.location = 'http://chrisrjones.com/splash.php'";
        echo "</script>";
        */
        header('Location: splash.php');
    }

    if ( $cookie_splash == 'false' && $cookie_visit_now == 'true') {
    break;
    }

    if ( $cookie_splash == 'true' && $cookie_visit_now == 'false') {
        /*
        echo "<script type = text/javascript>";
        echo "window.location = 'http://chrisrjones.com/splash.php'";
        echo "</script>";
        */
        header('Location: splash.php');
    }

    if ( $cookie_splash == 'true' && $cookie_visit == 'true' && $cookie_visit_now == "false") {
        /*
        echo "<script type = text/javascript>";
        echo "window.location = 'http://chrisrjones.com/splash.php'";
        echo "</script>";
        */
        header('Location: splash.php');
    }

    if ($cookie_splash == 'true' && $cookie_visit == 'true' && $cookie_visit_now == 'true') {
        break;
    }
}
while (0);




?>

splash.php

<p>
    <form name="tosplashornottosplash" action="scripts/splash-process.php" method="post" onSubmit="return valForm()">
    Splash pages are stupid.

    <input type="radio" name="splash" id="splash_false" value="false" /> No
    <input type="radio" name="splash" id="splash_true" value="true" /> Yes

    <input type="submit" name="splashSubmit" onClick="return valForm(tosplashornottosplash)" value="Enter" />
    </form>
    </p>

splash-process.php

    <?php 

    setcookie("visit", "true", mktime (0, 0, 0, 12, 31, 2014), "/"); // delete cookie on 31DEC14
    setcookie("visit_now", "true", NULL, '/'); // cookie should expire / delete at end of session.


    $splashvar = $_POST["splash"];

    if ( $splashvar == "false" ) {
        // create cookie - splash 1
        setcookie("splash", "true", time()+3600, '/'); // expires in one hour
    }
        else {
            // create cookie - splash 0
            setcookie("splash", "false", time()+3600, '/'); // expires in one hour
        }

    echo "<script type = text/javascript>";
    echo "window.location = 'http://chrisrjones.com/index.php'";
    echo "</script>";

    ?>

Go to chrisrjones.com to see what I’m talking about.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:02:41+00:00Added an answer on June 18, 2026 at 2:02 pm

    Alright, so I think the problem wasn’t with my code, but rather understanding how browsers behave. If I go to the site (chrisrjones.com) as of right now in FF 18.0.2 and select “No” on splash pages are stupid, then I can enter the site once I click enter.

    However if I leave the tab open, and have FF set to leave tabs open on restart (whatever it’s called you know what I mean), and quit FF, then relaunch it the session cookies never expire. So when I refresh the page thus the splash page isn’t loaded. However, if I close the tab then quit the browser then reload the page, the splash page is loaded. (Which is what I want).

    Chrome on the other hand appears to not delete session cookie’s once the browser is closed, so that’s why I was having such difficulty with Chrome.

    I now have a better understanding as why things are behaving the way they are, and realize it wasn’t all my poor coding practice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright I don't see why this isnt working. It seems pretty simple. Here is
Alright, this is driving me nuts because my regex is working on Rubular, but
Alright, I'll try and make this brief as possible. I wanted to a UIToolbar
Alright, I have decided to go about this by opening a new page (newPage.aspx)
Alright, I've got a quick question. I'm currently working with a legacy database, so
Alright, Currently, if given a string like such: A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5,(F:0.6,G:0.7)H:0.8 I am using this: child
Alright, i am new to python, and simple tab creation in this language somewhat
Alright, I am trying to accomplish this: When a user clicks a button that
Alright guys, this should be a very simple request. I'd like to run a
Alright so I have no idea how to even begin doing this But basically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.