Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2008
    Location
    Covington, Washington, United States
    Posts
    205
    Plugin Contributions
    1

    Default Trying to use an age verification script, getting session problems..

    OK, so I have an adult shop I am working on. I have a script that SEEMS to work, just not with zen cart... haha. I think for some reason zen-cart isn't allowing a separate session or something.

    the zc store is located like in the following directory:
    www.domain.com/store

    in the root folder (store) I have the following .php file (verify.php)
    PHP Code:
    <?php 
    session_start
    (); 
    if (
    $_REQUEST["over18"] == 1) { 
        
    $_SESSION["over18"] = 1
        
    header("Location: " $_REQUEST["redirect"]); 

    ?> 
    <html> 
        <head> 
            <title>Verify Your Age</title> 
        </head> 
        <body> 
            <a href="/store/verify.php?over18=1&redirect=<?php echo $_REQUEST["redirect"]; ?>">I am over 18</a> |  
            <a href="http://www.google.com/">Get me out of here!</a> 
        </body> 
    </html>
    Then I have the following in my includes/application_top.php file at the very end:
    PHP Code:
    <?php 
    session_start
    ();
    if (
    $_SESSION["over18"] !=1) {
        
    header("Location: /store/verify.php?redirect=" $_SERVER['PHP_SELF']); 

    ?>
    I get the verify.php page to come up, but when clicking "I am over 18". It simply redirects back to the same page... What am I doing wrong? Please note that the script is in the application_top.php file so that this check populates whatever page the customer enters from, not just the homepage...

  2. #2
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,277
    Plugin Contributions
    0

    Default Re: Trying to use an age verification script, getting session problems..

    sorry for saying this . but looking at the script ,, i wonder what is the point of this age verification ???

    is just a link that user clicks on and gain access to your site , how this would verify someones age ??? is just a extra step for accessing your site . unless im missing something.

    as far as i know , you can only have one session at the time ..

  3. #3
    Join Date
    Apr 2008
    Location
    Covington, Washington, United States
    Posts
    205
    Plugin Contributions
    1

    Default Re: Trying to use an age verification script, getting session problems..

    I can replace the html portion later and add a script for checking DOB or whatever later, but before I do that I want to make sure that the session and/or cookie can be stored, and it will redirect properly.

    As far as having one session at a time:

    1 zen session.. yes, you are correct, but if you can store multiple cookies at a time, why wouldn't I be able to start this "stop18" session?

  4. #4
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,277
    Plugin Contributions
    0

    Default Re: Trying to use an age verification script, getting session problems..

    I found this topic that might help. although script there is just javascript .. but it seems to do the job for zencart store.

    http://www.zen-cart.com/forum/showthread.php?p=546887

 

 

Similar Threads

  1. Ignore Java Script during secure session
    By davefant in forum Basic Configuration
    Replies: 2
    Last Post: 11 Jan 2008, 06:38 AM
  2. Will i have Session problems?
    By Empirer in forum Installing on a Windows Server
    Replies: 2
    Last Post: 18 Jun 2006, 01:26 AM
  3. Replies: 6
    Last Post: 10 May 2006, 11:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •