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

Secondary new window on load? 1

Status
Not open for further replies.

Spidy6123

Technical User
May 30, 2002
227
CA
Hi..
I'm fairly new to php.. I was hoping to add a popup window to one of my scripts.. so that when the php loads with will also open a secondary fixed sized window..

I understand I have to use javascript for this? Can anyone help me with some syntax?

TIA
 
Code:
window.open();

But it will likely get blocked.

Try the Javascript forum if you need more info.

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
see.. that's my point.. Im not sure how to make the javascript launch via php without a hyperlink
 
php in this context just outputs text to the browser (in terms of interaction with the browser, that is). the text can be html or javascript or whatever. so

Code:
<?php
echo <<<HTML
<script>
window.onload = function(){alert('i am a js dialog box');};
</script>
<div>
A dialog should pop up now
</div>
HTML;
?>
should cause the browser to pop up a dialog box.
 
Use the onload event of your pages body element.
Code:
<body onload="window.open()">
But again this is a JS question not PHP.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
sorry for the js question in php..

but I dont have a body tag in this php.. its a oscommerce php script which redirects to bunch of stuff

thanks guys :)

 
There has to be a body tag somewhere even if its oscommerce stuff, otherwise the html would be invalid, and could not be rendered properly.

You need to look for it in the pages the oscommerce stuff produces.

But trust me its there somewhere.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top