473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

load a popup window on login

How can I make a popup window that opens everytime a user logs in?

I'm using javascript with php
Dec 7 '07 #1
3 3487
Ferris
101 100+
How can I make a popup window that opens everytime a user logs in?
you can use window.open(fileName); to open a new window, but the popup window will be usually blocked by browser.

you can also create an div element in page, when the user logs in, show this element. it will never be blocked,but it is not a real popup window.

I wrote the sample code for you , hope it helps.

[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>User log in Page</title>
</head>
<style type="text/css">
<!--
body{
background-color:#E4DFFF;
}
-->
</style>
<body>
user log in successfully
<br />
<div id="popupWindow" style="position:absolute; left:178px; top:64px; width:426px; height:280px; border:1px solid; background-color:#FFFFFF">
<div style="text-align:right; background-color:#CED3FF"><a onclick="document.getElementById('popupWindow').st yle.display = 'none';" style="cursor:pointer;">Close</a></div>
<div>This is your popup window<br />You can click "Close" to close it.</div>
</div>
</body>
</html>
[/HTML]
Dec 7 '07 #2
you can use window.open(fileName); to open a new window, but the popup window will be usually blocked by browser.

you can also create an div element in page, when the user logs in, show this element. it will never be blocked,but it is not a real popup window.

I wrote the sample code for you , hope it helps.

[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>User log in Page</title>
</head>
<style type="text/css">
<!--
body{
background-color:#E4DFFF;
}
-->
</style>
<body>
user log in successfully
<br />
<div id="popupWindow" style="position:absolute; left:178px; top:64px; width:426px; height:280px; border:1px solid; background-color:#FFFFFF">
<div style="text-align:right; background-color:#CED3FF"><a onclick="document.getElementById('popupWindow').st yle.display = 'none';" style="cursor:pointer;">Close</a></div>
<div>This is your popup window<br />You can click "Close" to close it.</div>
</div>
</body>
</html>
[/HTML]

Could I also use it to display php code. because I need to use it for a php program that I'm doing.
Dec 8 '07 #3
Ferris
101 100+
Could I also use it to display php code. because I need to use it for a php program that I'm doing.
I don't know much about php,but I think you can use echo to write HTML code into a php page.

[PHP]
<?php
echo "<div style=\"text-align:right;background-color:#CED3FF\"><a
onclick=\"document.getElementById('popupWindow').s tyle.display= 'none';\" style=\"cursor:pointer;\">Close</a></div>";
?>
[/PHP]


replace "displ ay" into "display"
Dec 8 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

26
by: Raffi | last post by:
Hi, We have a database application that runs in a popup Internet Explorer application window. The reason for this is to isolate the casual user from the address bar and the typical IE navigation...
2
by: yatharth | last post by:
I am facing a problem ,the situation is like this. I have a home page named "Index.html" ,on which there is login link,when i click on the login link the login popup opens and user enter the...
2
by: Brian Henry | last post by:
I want to show a modal box after the page has been loaded how would i do that? right now i can get it to show before the page is rendered on screen by doing a response.write(*modal show java script...
1
by: Kalyani | last post by:
Hi, I have a page with a button.On click of this button a popup window opens.Now if this window is kept open until session timeout then login page opens in the same window. Now I want that the...
15
by: H00ner | last post by:
Hello All Hope you can help Been pulling my hair out about a popup problem in ASP.NET. One of the forms i wrote requires the user to select a product from a list in a popup web form. the...
1
by: ABC | last post by:
After the application user login, when I click the master page button, it popup window using javascript's window.showModalDialog function as: Response.Write("<script...
1
by: gvrajkumar | last post by:
Hi Popup window is opened and after some time session has expired. After session expire, if the user tries to make any actions on the popup page the user is redirected to login.jsp page. What...
4
by: goscottie | last post by:
I used submodal as my popup window. With some tweaks, it working great in my app. However, I can't find a way to detect session timeout in the popup window. The app is a form based...
1
by: sweetneel | last post by:
hi all, i am developing an asp.net Application. when i am clicking a link , it opens a pop up (login page). after successfull login , the disignated url opens in the popup window. this is a problem....
1
by: Jeyush | last post by:
Hey buddy, I have three pages 1)index.php 2)login.php 3)client.php. When I click on "login" on index.php page, it opens a popup. When I submit that login page at that time I want to redirect...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.