Re: [PHP] Targetted redirection?
is there any limitation with header function?im wondering why it not realy working for me. it really gives me a headache. i've done exactly what you've told us but it does'nt work. i remove the comment from the left.php or right.php and retain the index.ph as-is, but still it doesnt jump out the frames. * index.php ** index page * left.php ** the menu right right 2 * right.php ** Right Hi there. This is the main content page in the right frame. * right2.php ** Right 2 Hi there. This is the secondary content page in the right frame. > > > > Now, put all those files on your machine. Hit index.php and you'll see > everything normally. Then, uncomment the header function in left.php or > right.php and you'll see that page jump out of the frames. But, turn > the header on in index.php or index2.php and you'll still be in the > frames. > > Enjoy, > > --Dan > > -- > PHP scripts that make your job easier > http://www.analysisandsolutions.com/code/ > SQL Solution | Layout Solution | Form Solution > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
I use this code to break out of frames: if (top.frames.length!=0) top.location=self.document.location; Put this code in the section between
Re: [PHP] Targetted redirection?
> Here's a nice link to Netscape.com describing the basics of frames: > http://www.netscape.com/eng/mozilla/2.0/relnotes/demo/target.html Ok, I'll have to check it out. > For your particular question though I would consider targeting the action of > the tag: > > This will essentially "cover over the frame". Hope this helps. Indeed. However, the reason why I have the target as, essentially, $PHP_SELF is so I can validate the form before going on to the next page. If I want to do that, the page has to stay in the current frame until everything checks out. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Targetted redirection?
Here's a nice link to Netscape.com describing the basics of frames: http://www.netscape.com/eng/mozilla/2.0/relnotes/demo/target.html You can find the predefined variables for use in frames listed, along with a quick reference to the optional HTTP header that can be specified. For your particular question though I would consider targeting the action of the tag: This will essentially "cover over the frame". Hope this helps. Robert Zwink http://www.zwink.net/daid.php -Original Message- From: Analysis & Solutions [mailto:[EMAIL PROTECTED]] Sent: Friday, March 15, 2002 12:50 PM To: PHP List Subject: Re: [PHP] Targetted redirection? On Fri, Mar 15, 2002 at 12:25:10PM -0500, Analysis & Solutions wrote: > On Fri, Mar 15, 2002 at 11:03:22AM -0600, Chris Boget wrote: > > > > > > > The script needs to be in between in order to execute > on your server. Browsers don't execute PHP. What you've written is how > Java'sCrap works. Wow. Someone just pointed out I'm wrong, showing me the following link: http://www.php.net/manual/en/language.basic-syntax.php#language.basic-syntax .p +hpmode Sorry about that! When I started using PHP, I don't recall that being the case. Things change, eh? --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Fri, Mar 15, 2002 at 12:25:10PM -0500, Analysis & Solutions wrote: > On Fri, Mar 15, 2002 at 11:03:22AM -0600, Chris Boget wrote: > > > > > > > The script needs to be in between in order to execute > on your server. Browsers don't execute PHP. What you've written is how > Java'sCrap works. Wow. Someone just pointed out I'm wrong, showing me the following link: http://www.php.net/manual/en/language.basic-syntax.php#language.basic-syntax.p +hpmode Sorry about that! When I started using PHP, I don't recall that being the case. Things change, eh? --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
> > > > if( isset( $submit )) { > > header( "Window-target: content" ); > > header( "location: right.php" ); > > exit(); > > } > > > The script needs to be in between in order to execute > on your server. Browsers don't execute PHP. What you've written is how > Java'sCrap works. Huh? The file names are .php and the code is within PHP script tags so it is running on the server. The redirection is occuring, just that it's not going to the right frame. is the same as writing The latter is just shorthand. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Fri, Mar 15, 2002 at 11:03:22AM -0600, Chris Boget wrote: > > if( isset( $submit )) { > header( "Window-target: content" ); > header( "location: right.php" ); > exit(); > } > The script needs to be in between in order to execute on your server. Browsers don't execute PHP. What you've written is how Java'sCrap works. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Fri, Mar 15, 2002 at 11:27:59AM -0500, Brinkman, Theodore wrote: > > Given: My site is being brought up inside somebody else's (say > about.com)frameset. [We'll call this page about.html] > Given: I want my main page (index.html) to break out of the frames in the > about.html page. > > Solution: My main page (index.html) should send header('Window-target: > _Top'); That works for me. I use my layout templating sytsem to send out that header on every page. > So, if I use frames, and I want to keep my frameset page out of someone > else's frame, I should send that header for my frameset page? Hmm. Under these circumstances, from the _minimal_ testing I just did on this matter, it might not. I'm guessing, that if their frameset has already been established and one of their pages has a link which will put your content into one of their existing frames, then, no, you won't be able to hop out. In this scenario, have the page check for the referrer and if it's "'da basta'ds," have your script print out a hyperlink to your content rather with a source="_blank" in it. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
> # Turning this on will jump this page out of the frames. > # header('Window-target: _top'); > ?> Can you use this only for the predefined variables? _top, _parent, etc? Because it isn't working for me. Perhaps I am misunderstanding something. Here are my sample files: index.php // index page // left.php // if( isset( $submit )) { header( "Window-target: content" ); header( "location: right.php" ); exit(); } left page // right.php // right page you got redirected here // Am I misunderstanding something? Or doesn't that header work this way? Thanks for any insight you might give! Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Targetted redirection?
OK, If I understand correctly, the following scenario would work? Given: My site is being brought up inside somebody else's (say about.com)frameset. [We'll call this page about.html] Given: I want my main page (index.html) to break out of the frames in the about.html page. Solution: My main page (index.html) should send header('Window-target: _Top'); So, if I use frames, and I want to keep my frameset page out of someone else's frame, I should send that header for my frameset page? Is this correct? - Theo -Original Message- From: Analysis & Solutions [mailto:[EMAIL PROTECTED]] Sent: Friday, March 15, 2002 10:27 AM To: PHP List Subject: Re: [PHP] Targetted redirection? Hi Folks: Okay, here's what I'm talking about... A sample system. Four files. index.php main page holding the frameset. frameset has two frames. one on left. one on right. left.php navigation menu that goes in the left hand frame right.php content in right hand frame. this page is the default one that comes up in the initial frameset. right2.phpanother page for the right hand frame * index.php ** index page * left.php ** the menu right right 2 * right.php ** Right Hi there. This is the main content page in the right frame. * right2.php ** Right 2 Hi there. This is the secondary content page in the right frame. Now, put all those files on your machine. Hit index.php and you'll see everything normally. Then, uncomment the header function in left.php or right.php and you'll see that page jump out of the frames. But, turn the header on in index.php or index2.php and you'll still be in the frames. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Friday, March 15, 2002, at 10:27 AM, Analysis & Solutions wrote: > Now, put all those files on your machine. Hit index.php and you'll see > everything normally. Then, uncomment the header function in left.php or > right.php and you'll see that page jump out of the frames. But, turn > the header on in index.php or index2.php and you'll still be in the > frames. Is this because the frame of the _top page needs to be a child of the "parent" _top page? That is to say, if the frameset is not created by a particular page "A" then the pages with the header() function do not consider page "A" to be their _top ? Good example. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
Hi Folks: Okay, here's what I'm talking about... A sample system. Four files. index.php main page holding the frameset. frameset has two frames. one on left. one on right. left.php navigation menu that goes in the left hand frame right.php content in right hand frame. this page is the default one that comes up in the initial frameset. right2.phpanother page for the right hand frame * index.php ** index page * left.php ** the menu right right 2 * right.php ** Right Hi there. This is the main content page in the right frame. * right2.php ** Right 2 Hi there. This is the secondary content page in the right frame. Now, put all those files on your machine. Hit index.php and you'll see everything normally. Then, uncomment the header function in left.php or right.php and you'll see that page jump out of the frames. But, turn the header on in index.php or index2.php and you'll still be in the frames. Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Targetted redirection?
> > > > > oh yes i've got your point, but i've tried what you've told us before > but > > > still it does not redirect to cover over the frame page. > > > > Ah, yes, that'd be a problem... :) > > > > I knew what I said worked because I use it to get my pages to break out > > of About.com's frames. Man, the audacity of those folks... > > framing up my content in their ads. > > > > In the headers of all of my pages, I send out > >header('Window-target: _top'); > > > > Now, doing some testing of why it didn't work for you I found that it > > only works when pages with that header are one of the pages requested by > > the initial frameset. If header is sent out from a page which is > > requested once the main frameset is constructed, the header doesn't > > work. > > > What do you mean? could give us some simple script sample to visualize more?please.. --Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Thu, Mar 14, 2002 at 08:53:23AM +0800, Michael P. Carel wrote: > oh yes i've got your point, but i've tried what you've told us before but > still it does not redirect to cover over the frame page. Ah, yes, that'd be a problem... :) I knew what I said worked because I use it to get my pages to break out of About.com's frames. Man, the audacity of those folks... framing up my content in their ads. In the headers of all of my pages, I send out header('Window-target: _top'); Now, doing some testing of why it didn't work for you I found that it only works when pages with that header are one of the pages requested by the initial frameset. If header is sent out from a page which is requested once the main frameset is constructed, the header doesn't work. Hope that makes sense... If not, let me know and I can clarify. --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Wednesday, March 13, 2002, at 07:36 PM, Analysis & Solutions wrote: > Sure it works... execpt when people who have Java'sCrap turned off come > to your site. Oh, and then there's the folks with browsers that don't > have JS at all? HTTP headers work across all browsers. > header('Location: http://foo.org/') is the real solution. > > For more info on why not to use Java'sCrap and how accomplish the same > things without it, see >http://www.analysisandsolutions.com/code/weberror.htm?j=y I agree with what you say -- never rely on JavaScript. A good rule of thumb (IMO) is to make sure that your site works perfectly and does exactly what it should using HTML/PHP code alone (test with JS turned off), and then add "features" with JavaScript that may make it -better-, but not features that are ever -required-. For instance, make sure that your PHP validates the forms that are submitted to the server, but if you have already done this then you can add JavaScript form validation so that the user doesn't have to wait for a full resubmit to make sure that they have everything. There are other ways that I can see JS enhancing a web site, as long as you don't require JS to do what you want... but in all honesty I haven't learned much JS so even I don't really take this route. It's just a theory. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
- Original Message - From: "Analysis & Solutions" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Thursday, March 14, 2002 8:36 AM Subject: Re: [PHP] Targetted redirection? > On Thu, Mar 14, 2002 at 07:58:29AM +0800, Michael P. Carel wrote: > > > I have that kind of problem before, but it whould be much better to use > > javascripts rather than the HTTP Header function when redirecting to cover > > over the frame page. Use this instead: > > > > echo"top.location.href=http://your.page.direction; "; > > > > I've already tried and using this kind of redirection and it just works fine > > with me. > > Sure it works... execpt when people who have Java'sCrap turned off come > to your site. Oh, and then there's the folks with browsers that don't > have JS at all? HTTP headers work across all browsers. > header('Location: http://foo.org/') is the real solution. > > For more info on why not to use Java'sCrap and how accomplish the same > things without it, see >http://www.analysisandsolutions.com/code/weberror.htm?j=y > > Enjoy, > > --Dan > oh yes i've got your point, but i've tried what you've told us before but still it does not redirect to cover over the frame page. Here's what i've did: header('Window-target: _top'); header('Location: http://my.directed.page'); or either header('Window-target: _blank'); header('Location: http://my.directed.page'); this source doesnt redirect to cover the frame, instead it just shows within the frame, and upon refresh it will cover the frame page. what should be the problem? --Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Thu, Mar 14, 2002 at 07:58:29AM +0800, Michael P. Carel wrote: > I have that kind of problem before, but it whould be much better to use > javascripts rather than the HTTP Header function when redirecting to cover > over the frame page. Use this instead: > > echo"top.location.href=http://your.page.direction; "; > > I've already tried and using this kind of redirection and it just works fine > with me. Sure it works... execpt when people who have Java'sCrap turned off come to your site. Oh, and then there's the folks with browsers that don't have JS at all? HTTP headers work across all browsers. header('Location: http://foo.org/') is the real solution. For more info on why not to use Java'sCrap and how accomplish the same things without it, see http://www.analysisandsolutions.com/code/weberror.htm?j=y Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
Ben, I have that kind of problem before, but it whould be much better to use javascripts rather than the HTTP Header function when redirecting to cover over the frame page. Use this instead: echo"top.location.href=http://your.page.direction; "; I've already tried and using this kind of redirection and it just works fine with me. Hope this will help you. Regards, Mike - Original Message - From: "Ben Cheng" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 14, 2002 4:15 AM Subject: [PHP] Targetted redirection? > I have a page within a frame that uses Header() to redirect to another page. > However, I don't want the redirection to take place just within that frame > set. I want the page that it redirects to to cover over the frame. Is this > possible? > > -Ben > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Wed, Mar 13, 2002 at 03:52:42PM -0500, Erik Price wrote: > > On Wednesday, March 13, 2002, at 03:15 PM, Ben Cheng wrote: > > >However, I don't want the redirection to take place just within that > >frame > >set. I want the page that it redirects to to cover over the frame. Is > >this > >possible? > > Hm... I don't think that frames were ever intended to be manipulated at > the level of headers! Weird. This is the third time this question has been asked and answered in the past couple days... Put the following in before your header('Location: ...') call something along the lines of... header('Window-target: _top'); or... header('Window-target: _blank'); Does that do what you want? --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
If you were going to use javascript to do that, use _parent as the target -- that should reuse the window rather than making a new window. -Joe "Erik Price" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On Wednesday, March 13, 2002, at 03:15 PM, Ben Cheng wrote: > > > I have a page within a frame that uses Header() to redirect to another > > page. > > However, I don't want the redirection to take place just within that > > frame > > set. I want the page that it redirects to to cover over the frame. Is > > this > > possible? > > Hm... I don't think that frames were ever intended to be manipulated at > the level of headers! Otherwise you could use a "target" attribute or > something. If you're willing to use a bit of JavaScript, you might be > able to reference a new window or something like a target="_blank" and > THEN call the header() function from there... but that's more of a > workaround than a solution. > > Good luck, sorry I don't have any other ideas. > > > Erik > > > > > > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Targetted redirection?
On Wednesday, March 13, 2002, at 03:15 PM, Ben Cheng wrote: > I have a page within a frame that uses Header() to redirect to another > page. > However, I don't want the redirection to take place just within that > frame > set. I want the page that it redirects to to cover over the frame. Is > this > possible? Hm... I don't think that frames were ever intended to be manipulated at the level of headers! Otherwise you could use a "target" attribute or something. If you're willing to use a bit of JavaScript, you might be able to reference a new window or something like a target="_blank" and THEN call the header() function from there... but that's more of a workaround than a solution. Good luck, sorry I don't have any other ideas. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Targetted redirection?
I have a page within a frame that uses Header() to redirect to another page. However, I don't want the redirection to take place just within that frame set. I want the page that it redirects to to cover over the frame. Is this possible? -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php