| | |
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 |
5.2.10 action address ajax apache api array auto autoincrement beginner binary broken cakephp checkbox class classes cms code cron curl database date dehasher destroy display domain dynamic echo email error errorlog fatalerror file files folder form forms function functions google href htaccess html if-else image include insert integration ip java javascript joomla limit link load login mail masterthesis menu mlm multiple mysql mysqlquery oop paypal pdf php popup problem query radio random record recursion regex remote script search security server sessions sms soap sockets source space sql syntax system table tutorial update upload url validator variable video web xml youtube





