Hi All,
can any1 gimme solution abt this...i wanna redirect user to some page but at the same time i want that page 2 b open in a new window....so is there any way to do this....
header("Location: somefile.php"); -----> opens the file in the same frame....i want it 2 b open in a new window....
so hopin 4 a favorable response.....
Saadi
can i set target of file while redirecting 2 it using header
Moderator: General Moderators
-
saadatshah
- Forum Newbie
- Posts: 23
- Joined: Fri Jul 05, 2002 5:50 am
- Location: Lahore
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
In case you're wondering the javascript looks like this:
<script language="JavaScript">
<!--
function openwin(url, name)
{
settings=
"toolbar=yes,location=yes,directories=yes,"+
"status=yes,menubar=yes,scrollbars=yes"+
"resizable=yes";
MyNewWindow=window.open("http://"+url,name,settings);
}
//-->
</script>
To forward your user as soon as a page loads you would add this to the body tag:
onLoad="openwin('www.yourpage.com','Window Name');"
To forward a user when a link is clicked you would use this as your <a> tag:
<a href="#" onClick="openwin('www.yourpage.com','WindowName'); return false">
Just be sure you don't put a space in your WindowName.
<script language="JavaScript">
<!--
function openwin(url, name)
{
settings=
"toolbar=yes,location=yes,directories=yes,"+
"status=yes,menubar=yes,scrollbars=yes"+
"resizable=yes";
MyNewWindow=window.open("http://"+url,name,settings);
}
//-->
</script>
To forward your user as soon as a page loads you would add this to the body tag:
onLoad="openwin('www.yourpage.com','Window Name');"
To forward a user when a link is clicked you would use this as your <a> tag:
<a href="#" onClick="openwin('www.yourpage.com','WindowName'); return false">
Just be sure you don't put a space in your WindowName.
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact: