Header() target?

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
virgil
Forum Commoner
Posts: 59
Joined: Thu Jun 13, 2002 11:43 pm
Location: New York, U.S.

Header() target?

Post 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
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

To my understanding of the header() function, it is serverside and cannot accomodate for frames, but i may be wrong.
User avatar
bznutz
Forum Commoner
Posts: 58
Joined: Mon Dec 09, 2002 9:52 pm
Location: Here
Contact:

Post 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?
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

yep your right, you just reassured me. Its an absolute serverside command.
User avatar
Kriek
Forum Contributor
Posts: 238
Joined: Wed May 29, 2002 3:46 am
Location: Florida
Contact:

Post 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.
virgil
Forum Commoner
Posts: 59
Joined: Thu Jun 13, 2002 11:43 pm
Location: New York, U.S.

Post 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
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

yeh well of coarse you could javascript, but thats not serverside nor PHP header().
Post Reply