I want to show pop-up window when user login.
i write JavaScript pop-up window code in login functions, which open a new pop-up. but my php code execution stop there and not proceed to show my home page.
any idea?
thanks,
want to show a small popup window, when user login.
Moderator: General Moderators
Yes
in login checking & validation file, after checking & session is stored i write follwoing code before page redirect
print '<SCRIPT LANGUAGE="javascript">';
print 'window.open("test.html","Window1", "menubar=no,width=430,height=360,toolbar=no");' ;
print '</SCRIPT>';
header('location: index.php');
exit();
print '<SCRIPT LANGUAGE="javascript">';
print 'window.open("test.html","Window1", "menubar=no,width=430,height=360,toolbar=no");' ;
print '</SCRIPT>';
header('location: index.php');
exit();
can write this:
Code: Select all
print '<meta http-equiv="refresh" content="2; index.php" />'; //redirect with HTMLwouldn't it make more sense to have a "mypage.php" that you can only access after going through login.php (which is what you probably have), then...
on mypage.php, do this:
That way you don't have unnecessary code in your login.php file, and it's easy to change in the future if you want to.
on mypage.php, do this:
Code: Select all
<?php
//make sure session exists, if it does:
?>
<html><body><head>
<SCRIPT type="text/javascript">
function loaded()
{
window.open("test.html","Window1", "menubar=no,width=430,height=360,toolbar=no");
}
</SCRIPT>
</head>
<body onLoad="loaded()">
</body>
</html>
<?php
//if it doesn't, kick em in the pants.
?>-
Phoenixheart
- Forum Contributor
- Posts: 123
- Joined: Tue Nov 16, 2004 7:46 am
- Contact: