Click to See Complete Forum and Search --> : [RESOLVED] Pop Up CSS or Window to Login


StevenJ
02-27-2009, 04:51 PM
Hi,

I am putting together a website for my photography, and I am trying to achieve the following.

a pop up CSS or window area that I can enter login credentials to login to an admin area.

while I can create a pop up window, I then struggle.

If authenticated I wish to redirect the "main" window to an admin page, say admin.php and if not, redirect the main page to error.php

I have googled for a tutorial, and found nothing to help (maybe I am using the wrong search terms).

can anyone point me to a tutorial?

currently the pop up window I have done shows the pages that I am redirecting to using the following code:
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );

whereas I want the original main page to redirect! help!

Fang
02-27-2009, 11:12 PM
The authentication would have to be done with Ajax. Any reloading of the child window would break the parent -child relationship. Why the need for a child window?

StevenJ
02-28-2009, 07:01 AM
what I decided on was a CSS pop-up (show/hide), and then on POST, post to the same page.

I am not sure if there is a disadvantage to this?

for the CSS box, use java to show/hide a css element called "popupbox":

<script language="JavaScript" type="text/javascript">
function login(showhide){
if(showhide == "show"){
document.getElementById('popupbox').style.visibility="visible"; /* If the function is called with the variable 'show', show the login box */
}else if(showhide == "hide"){
document.getElementById('popupbox').style.visibility="hidden"; /* If the function is called with the variable 'hide', hide the login box */
}
}
</script>


just a normal form would be displayed in the "popupbox" element.

Then in php I have the usual stuff for login. it means that the login action is located on every page that I can login from, rather than just 1 login form, but that shouldn't pose a problem.