| | |
Set cookies at start of the website
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2008
Posts: 6
Reputation:
Solved Threads: 0
Hi,
I was searching for the code to set a cookie at the start of the website like you can see at
http://www.apniisp.com , they have given the cookie at the start of the website which automatically popups.
plz send me as soon as possible
I was searching for the code to set a cookie at the start of the website like you can see at
http://www.apniisp.com , they have given the cookie at the start of the website which automatically popups.
plz send me as soon as possible
try this javascript function which will be called with php code
add this code in your inside the head tag but below the title tag
and this code you will add it inside the body tag, but you have to first test if the cookie is not set. if not set thats when you put this code
where it says:
your page- put the name of the page you want to be popped
advert- just the name you want to give it
status- is if you want it to show status bar
resizable- is when you want it to be resizable
width and height- thats the size of the pop up
add this code in your inside the head tag but below the title tag
PHP Syntax (Toggle Plain Text)
<script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script>
and this code you will add it inside the body tag, but you have to first test if the cookie is not set. if not set thats when you put this code
PHP Syntax (Toggle Plain Text)
<?php echo"<SCRIPT LANGUAGE='JavaScript'> MM_openBrWindow('yourpage.html','advert','status=yes,resizable=yes,width=500,height=400')</SCRIPT>";
where it says:
your page- put the name of the page you want to be popped
advert- just the name you want to give it
status- is if you want it to show status bar
resizable- is when you want it to be resizable
width and height- thats the size of the pop up
![]() |
Similar Threads
- my computer hangs! (Windows NT / 2000 / XP)
- My hijackthis log (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: Call to undefined function mysqli_connect()
- Next Thread: Calendar for php form
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error errors execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javascript joomla keywords limit link login loop mail menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube





