[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

header + target

Posted on 2002-05-25
5
Medium Priority
?
2,220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

656 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