How to Create a POP-Up in PHP (Server-Side Script)?
-
I Got a project which asks me to make a popup window open automatically on main page load, but in PHP with following details: I want popup window -- 1. to a specified size 2. at a specified position 3. with no toolbars 4. with no scrollbars 5. with no address bars 6. with resizable set to no. 7. with location set to no. 8. with no directories 9. with no status bar 10. with no menubar and 11. with no copyhistory ** But the Main window should close automatically as soon as popup gets open with any confirmation. The Script can contain JavaScript (JS) too, but it has to have PHP too in it I want to use this on INTRANET (Not Internet) as this is one of my PHP project assigned to me, and i need it urgently. By far i came up with JavaScript only, like below: <script type='text/javascript'> function SetWindow() { var height = 400 //Set height var width = 400 //Set width var name = "popup" //Set window name var top = 20 //Set distance from top var left = 20 //Set distance from bottom if(document.location.search=='') { newwin=window.open(document.location + "?newwin=true", name, "fullscreen=no,toolbar=no,status=no,menu… + width + ",height=" + height + ",left=" + left + ",top=" + top); window.open('','_self',''); window.close(); Please if anyone can help me, i'll be grateful him/her. i need to convert this script in PHP or embed in PHP.
-
Answer:
Well, you can't do this directly in PHP, because PHP is a server-side language and the functionality you want takes place on the client side (from the browser). The simplest way to do this is to simply write a PHP script with the necessary JavaScript embedded in it, just as you would embed HTML. If you could do this kind of thing *directly* using only PHP, my job would be light years easier than it is.
Arun at Yahoo! Answers Visit the source
Related Q & A:
- How to run a external program in PHP?Best solution by Stack Overflow
- How to read a PDF file with PHP?Best solution by Stack Overflow
- How to create a table in PHP with MySQL?Best solution by Stack Overflow
- How to call a function asynchronously in PHP?Best solution by Stack Overflow
- How to make a dynamic table in PHP?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.