Please help me

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
NighTCrawLa
Forum Newbie
Posts: 4
Joined: Sat Apr 03, 2004 5:50 pm

Please help me

Post by NighTCrawLa »

i have a password protect code


<?php
if ($_POST['pass'] == "123456") {
include ("membersonly.php");
}
else {
header("Location:error.html");
}
?>


and i want the membersonly.php to pop up
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

This should be in client side.

You need to echo out the javascript to pop up the window.

Code: Select all

<?php
if($_POST['pass']=="123456"){
echo <<<EOT
<script language="javascript">
window.open("yoursite.com", "", "fullscreen=no,toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes,width=500,height=387");
</script>
EOT;
}
else {
header("Location:error.html");
}
?>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Moved to Clientside.

Mac
Post Reply