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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new browser window

Status
Not open for further replies.

bardley

Programmer
May 8, 2001
121
US
Hi.
We have a login form in a frame, and depending on the info in the form, the script will redirect to a different url by sending a header with location=blah.

But now the big man wants to conditionally open the page in a new browser window depending on the login info. So, how would I use a header to tell the browser not only which page, but also to open that page in a new window?

Thanks for any help!! Brad Gunsalus
Cymtec Systems, Inc.
bgunsalus@cymtec.com
 
Brad,

Why not just check for the condition the boss man wants and perform a specific function based on the result.

For example, we want to check to see if the user has already seen a banner add. We query our 'banners' database to see if the user is listed. if it is, your header would look like:

header("Location: /mylocation.php?location=memberpage");

if the user is not listed in the banners database, we add the user so he/she is now listed, and create our header:

header("Location: /mylocation.php?location=memberpage&banner=true");

Now, when we go to mylocation.php, we know that we have to load the member page in the frame we prescribe, but we also know that banner is true which means that we have to display it. So all we have to do is have our handy javascript available that is conditionally activated in our frameset. When the frameset loads, it also pops a window up. Voila!

The next time the user logs in, he/she is already listed, thus the banner will not popup.

If this is way off track from what you are trying to accomplish, please describe in more detail what you are looking to do.

Chad.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top