Opening new browser window

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
paultfh
Forum Commoner
Posts: 31
Joined: Thu Jul 20, 2006 6:24 pm

Opening new browser window

Post by paultfh »

I was wondering what the php function is for opening up a new browser window.

Right now my code looks like this:

Code: Select all

header("Location: ../nzb/submitform.php?" . 
			"fileurl=" 		. $fileurl .
			"&name=" 		. $name .
			"&size=" 		. $sizeofallfiles .
			"&numfiles=" 	. $numfiles .
			"&date=" 		. $date .	
			"&group=" 		. $group);
What I want to do is open this in a new window.
User avatar
kbrown3074
Forum Contributor
Posts: 119
Joined: Thu Jul 20, 2006 1:36 pm

Post by kbrown3074 »

Cant you just put it into a link? Whats the use of opening a new page? I would think using a javascript window.open would suffice...
paultfh
Forum Commoner
Posts: 31
Joined: Thu Jul 20, 2006 6:24 pm

Post by paultfh »

kbrown3074 wrote:Cant you just put it into a link? Whats the use of opening a new page? I would think using a javascript window.open would suffice...
I didn't think to use java script - I guess that will do it.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

php can't open a new window.. that's client-side functionality.
paultfh
Forum Commoner
Posts: 31
Joined: Thu Jul 20, 2006 6:24 pm

Post by paultfh »

How do I send my php variables to JS?
paultfh
Forum Commoner
Posts: 31
Joined: Thu Jul 20, 2006 6:24 pm

Post by paultfh »

For example:

Code: Select all

$myvariable

?>

<SCRIPT LANGUAGE="javascript">
<!--
window.open ('titlepage.html?$myvariable, 'newwindow', config='height=100,
width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no')
-->
</SCRIPT>
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post by LiveFree »

Code: Select all

$myvariable = "op=newwindow";
echo "
<SCRIPT LANGUAGE=\"javascript\">
<!--
window.open ('titlepage.html?".$myvariable."', 'newwindow', config='height=100,
width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no')
-->
</SCRIPT>";
paultfh
Forum Commoner
Posts: 31
Joined: Thu Jul 20, 2006 6:24 pm

Post by paultfh »

Oh of course. Just not thinking today, thank you.
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post by LiveFree »

:)
Post Reply