Computer Forums  

Go Back   Computer Forums > Internet > Website Development

Website Development HTML, traffic, hosting, and more... this is the forum for every webmaster.

Register Now for FREE!

Fill out the form below for your free account and start posting today!


Username: Password: Confirm Password: E-Mail: Confirm E-Mail:
Agree to forum rules 

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 13/12/08, 21:41
Jam's Avatar
Jam Jam is offline
CompuForums Moderator
 
Join Date: 02 Mar 2008
Location: In My Own Little World
Posts: 711
Jam has a reputation beyond reputeJam has a reputation beyond reputeJam has a reputation beyond reputeJam has a reputation beyond reputeJam has a reputation beyond reputeJam has a reputation beyond reputeJam has a reputation beyond reputeJam has a reputation beyond reputeJam has a reputation beyond reputeJam has a reputation beyond reputeJam has a reputation beyond repute
Default PHP Cookies Help

So, all this is new to me... but I am almost certain that I have this right.. however, it's not working

PHP Code:
<?php
$Month 
2592000 time(); //this adds 30 days to the current time
setcookie(warning$Month); // sets cookie with name warning, value of 1, and expiry date
?>

<?php 
if ($HTTP_cookie_VARS[warning] == "1")
{
echo 
"document.write('<javascript>showPopUp();</javascript>')"
}
else
{
 
/*do nothing...*/
}
?>

Code:
<script>showPopUp() {
tb_show('WARNING!', '{$mybb->settings['bburl']}/warning.html?width=250&height=300&modal=true');
}</script>
Can anyone see where I am going wrong here?
What I want to happen is the the JavaScript to run only if in the cookie there is a value of 1.
(as the javascript is a warning pop up box, telling users they have to be 18+ to enter)

Thanks,
Jam
__________________
Help Support CompuForums, And Become a Premium Member today! -

Advert Free - Increased PM Storage - Increased Avatar Size - Colored User Name (To Set You Apart From Other Members!) - And Access To The Premium Members Only Forum!

Your Donations Help Keeps CompuForums Alive!

JamsUbuntu.blogspot.com
www.RaquelReed.com
Funky-Facts.blogspot.com


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
javascript, php

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:28.


Content © Copyright 2005-2010 CompuForums. All Rights Reserved. Some content © Copyright of the respective owners.
Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0