Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a windows contents from a pop-up

Status
Not open for further replies.

Grimblam

Programmer
Sep 27, 2004
9
GB
Hello,

I have a bit of a dummy question.

I have a main window which when opened, a login pop-up window is immediately displayed. The login page asks a user for username and password in a form. When the user clicks submit, it sends the form details to a php page called loginquery.php which checks the details in a mysql database and if ok, forwards on to the logged in page.

My problem is that when submit is clicked, the php

(header("Location: ./main.php");)

is forwarding on to the next page in the pop-up window where I actually wanted it to close the pop-up and forward onto the next page in the main window.

Can anyone suggest a way of doing this? A rough snippet of code would be ideal.

Thanks a lot,
Andy
 
You will have to use a client side scripting language for this, e.g. JavaScript. There is a JavaScript forum on Tek-Tips.

However, your method seems not to be that secure. Anyone could just type in main.php in the browser addess bar...

I would suggest to handle the whole login process within one window anyway. Why do we need another popup? People disable popups these days.

Just as a hint:
Code:
<script language="Javascript">
   window.opener.location.href = "main.php";
   self.close();
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top