www.webdeveloper.com
Results 1 to 6 of 6

Thread: Registration JQuery Form will not close

  1. #1
    Join Date
    Jan 2012
    Location
    Eastern United States
    Posts
    38

    Registration JQuery Form will not close

    Hello,

    Is there any one out there that can help me resolve my Jquery POP-UP problem: The Form will not close after Login.

    The JQuery Registration form is on my home page, but will not close after the User have logged in? The Form continues to Pop Up even after the Visitor or User has registered and/or logged in? Coding is very new to me, so if you can please illustrate in a actual diagram below on how to fix this I would be most appreciative.

    I have enclosed a Sample of my Script below:

    Thanks,

    Regards,

    Cid

    My Registration Form Code:


    <?php



    //Bof Raj (script for pop up )
    //if($_SERVER['REMOTE_ADDR']=='115.240.51.183'){
    if(!isset($_COOKIE['user_id']) &&($_COOKIE['user_id']<1)){

    require('reg_form_detail.php');



    }
    //}


    ?>

  2. #2
    Join Date
    Jul 2009
    Location
    My house, sitting at the computer. Duh!
    Posts
    118
    Generally you'd want to use sessions instead of cookies for user login. And if reg_form_detail.php is being included, that means your condition is true. So obviously either $_COOKIE['user_id'] is no set, or $_COOKIE['user_id'] is less than 1. My guess is that the script that gives the users their cookies is not being executed.

  3. #3
    Join Date
    Nov 2006
    Location
    Oakland
    Posts
    500
    I can only assume the reg_form_detail.php is the PHP file containing the details of that signup form.
    Why: $_COOKIE['user_id']<1?

    1) After the user is logged in successfully setup a standard cookie value (string not a number e.g. isLogged)

    3) From then on just check is the cookie with the chose name (user_id) is set and equal to whatever value (i.e. isLogged


    if(!isset($_COOKIE['user_id']) || ($_COOKIE['user_id']!='isLogged')){
    require('reg_form_detail.php');

    }

    That piece of code will only be executed if the cookie user_id is not set or is the value of the cookie read is different from 'isLogged' or whatever string you chose.

  4. #4
    Join Date
    Jan 2012
    Location
    Eastern United States
    Posts
    38
    Hello ScottyBoy,

    Thanks for your response!
    You said cookies is not being executed. Can you tell me how to correct this problem or via diagram or insert directly into the code I provided?

    Thanks

    Regards,
    Cid email: kirkpatrick.rich7@gmail.com

  5. #5
    Join Date
    Jan 2012
    Location
    Eastern United States
    Posts
    38

    Lightbulb Cookie not set

    Hello Holyhttp,

    You stated: After the user is logged in successfully setup a standard cookie value (string not a number e.g. isLogged)

    I been getting a successful login. However, how and where do I perform this setup, especially when the pop-up continues even after a successful login?
    Can you explain via diagram and the place where I need to incorporate the code. I did incorporate this line of code:
    if(!isset($_COOKIE['user_id']) || ($_COOKIE['user_id']!='isLogged')){
    require('reg_form_detail.php');
    that you suggested in with my code, but still not working?

    Regards,
    Cid email: kirkpatrick.rich7@gmail.com

  6. #6
    Join Date
    Jul 2009
    Location
    My house, sitting at the computer. Duh!
    Posts
    118
    Quote Originally Posted by Cid View Post
    Hello ScottyBoy,

    Thanks for your response!
    You said cookies is not being executed. Can you tell me how to correct this problem or via diagram or insert directly into the code I provided?

    Thanks

    Regards,
    Cid email: kirkpatrick.rich7@gmail.com
    http://www.php.net/manual/en/function.setcookie.php

    You have to call that function BEFORE any other output, including HTML and echoed text.

    PHP Code:
    <?php
    setcookie
    ('name''value');
    ?>

    <html>
    </html>
    That will set a cookie called 'name' that can now be accessed from other pages using $_COOKIE['name']

    When in doubt, read the manual. It's very informative, and the user comments are often helpful as well.
    Last edited by ScottyBoy; 04-20-2012 at 04:58 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles