[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

header + target

Posted on 2002-05-25
5
Medium Priority
?
2,223 Views
Last Modified: 2007-11-27
hi,

another prob here.
can i use target in my url when i use header for redirect?

example:
header("location:start.php");

but, start.php will actually load 2 frames (one top, one down), and i only want either the down-frame to reload, or load start.php in _parent (or _self)

(somehow i assume this will require javascript, hope i'm wrong)

cheers
Ricky
0
Comment
Question by:Paurths
  • 2
  • 2
5 Comments
 
LVL 32

Expert Comment

by:Batalf
ID: 7034790
I think you have to use Javascript for this. To reload one frame with javascript:

in start.php:

<script>
top.frames[1].location.href='newUrl.html?random='+Math.random();
</script>

You could also use location.reload() to reload the frame.

Batalf
0
 
LVL 7

Expert Comment

by:axis_img
ID: 7034798
This sounds like a javascript solution to me as well... I would have to see more of the setup to know for sure though. 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.

There may be another solution though, but please post a little more detail about what you are trying to do.

Thanks
Barry
0
 
LVL 7

Accepted Solution

by:
axis_img earned 400 total points
ID: 7034809
"or load start.php in _parent (or _self)"

Is this always the case? start.php will ALWAYS need to open in the parent, and not be contained within a frame?

If so, then you may be able to simply do the following inside the start.php script:

Add this javascript line into start.php, which will force start.php to reload itself as the parent when it is called.

<script language="javascript">
if(top!=self){top.location=self.location;}
</script>

I am not sure if this is what you are talking about. Let me know.
0
 
LVL 12

Author Comment

by:Paurths
ID: 7034815
thanx barry,

that did it,

i'm sure i can use in a couple of other cases i've run into trouble with this.
i've only been using php for 4 days or so now...
html/asp a little longer (couple of years) but never learned javascript
i guess its time for that.

u guys are great.

cheers
Ricky
0
 
LVL 12

Author Comment

by:Paurths
ID: 7034817
btw, batalf,

your example 'seems' to work (seems logic) but it only refreshed the top-frame (even if i change the 1 to 0, or to the frame-name)

cheers
Ricky
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses
Course of the Month20 days, 11 hours left to enroll

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question