Page 1 of 1

Header() target?

Posted: Thu Jan 30, 2003 9:41 pm
by virgil
Hi PHP's :)

Does the Header() function allow a target attribute?


Something like...


header(location:anypage.php target:"main");


I cant seem to find any info on this...

Thanks so much for any advice :)


Virgil

Posted: Fri Jan 31, 2003 12:00 am
by evilcoder
To my understanding of the header() function, it is serverside and cannot accomodate for frames, but i may be wrong.

Posted: Fri Jan 31, 2003 12:04 am
by bznutz
since the header() function sends raw header data, I would think that it cannont send browser dependant data. wouldn't such a thing as a target specification in raw data be browser specific?

Posted: Fri Jan 31, 2003 12:09 am
by evilcoder
yep your right, you just reassured me. Its an absolute serverside command.

Posted: Fri Jan 31, 2003 10:47 am
by Kriek
virgil wrote:Does the Header() function allow a target attribute?
You can't use target in a php header, unfortunately. The header will simply redirect to the page specified, and only in the frame that contains the header. However, you can always use Javascript.

Posted: Fri Jan 31, 2003 7:10 pm
by virgil
Yeah... I sort of figured....


Here's the script I found, in case someone is looking...

the window att is "parent"
the frame is "left"

<?
?><SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
parent.left.location='anypage.php';
//--> </SCRIPT>
<?
?>



Thanks for the advice :D :D

Posted: Fri Jan 31, 2003 11:01 pm
by evilcoder
yeh well of coarse you could javascript, but thats not serverside nor PHP header().