/    Sign up×
Community /Pin to ProfileBookmark

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’);

}
//}

?>

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@ScottyBoyApr 19.2012 — 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.
Copy linkTweet thisAlerts:
@holyhttpApr 19.2012 — 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.
Copy linkTweet thisAlerts:
@CidauthorApr 20.2012 — 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: [email][email protected][/email]
Copy linkTweet thisAlerts:
@CidauthorApr 20.2012 — Hello Holyhttp,

You stated: [I][COLOR="DarkRed"]After the user is logged in successfully setup a standard cookie value (string not a number e.g. isLogged)[/COLOR][/I]

[I]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:

[/I]
[COLOR="Gray"] if(!isset($_COOKIE['user_id']) || ($_COOKIE['user_id']!='isLogged')){

require('reg_form_detail.php');[/COLOR]
[I] that you suggested in with my code, but still not working?[/I]

Regards,

Cid email: [email][email protected][/email]
Copy linkTweet thisAlerts:
@ScottyBoyApr 20.2012 — 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: [email][email protected][/email][/QUOTE]


http://www.php.net/manual/en/function.setcookie.php

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

[code=php]
<?php
setcookie('name', 'value');
?>

<html>
</html>
[/code]


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

When in doubt, read [url=http://www.php.net/manual/en/index.php]the manual[/url]. It's very informative, and the user comments are often helpful as well.
×

Success!

Help @Cid spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...