Redirect php file

This is a discussion on Redirect php file within the PHP Language forums, part of the PHP Programming Forums category; I'm developing a simple chat room box. The main chat room page is composed of three iframes, one for ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-17-2004
Yue Zhang
 
Posts: n/a
Default Redirect php file

I'm developing a simple chat room box. The main chat room page is
composed of three iframes, one for displaying messages posted, one for
displaying usernames registered online, and the other for typing in
messages. For each iframe there is a php file to handle it. I want to
know once the message is typed in, how to make the message iframe to
refresh and display the newest message. In other word, from one php
file redirected to another php file. I tried include .php, but it
fails because it refresh the wrong iframe ( the iframe for input
messages). Thanks.
Reply With Quote
  #2 (permalink)  
Old 01-17-2004
Chung Leong
 
Posts: n/a
Default Re: Redirect php file

Echo something like this at the beginning of your page:

<script>
top.frames['name_of_the_frame_you_want_to_refresh'].location.reload();
</script>

Uzytkownik "Yue Zhang" <JohnZhang448@hotmail.com> napisal w wiadomosci
news:c7d979ee.0401161613.312d286c@posting.google.c om...
> I'm developing a simple chat room box. The main chat room page is
> composed of three iframes, one for displaying messages posted, one for
> displaying usernames registered online, and the other for typing in
> messages. For each iframe there is a php file to handle it. I want to
> know once the message is typed in, how to make the message iframe to
> refresh and display the newest message. In other word, from one php
> file redirected to another php file. I tried include .php, but it
> fails because it refresh the wrong iframe ( the iframe for input
> messages). Thanks.



Reply With Quote
  #3 (permalink)  
Old 01-17-2004
Yue Zhang
 
Posts: n/a
Default Re: Redirect php file

"Chung Leong" <chernyshevsky@hotmail.com> wrote in message news:<-5mdnXg4QoACG5Xd4p2dnA@comcast.com>...
> Echo something like this at the beginning of your page:
>
> <script>
> top.frames['name_of_the_frame_you_want_to_refresh'].location.reload();
> </script>
>
> Uzytkownik "Yue Zhang" <JohnZhang448@hotmail.com> napisal w wiadomosci
> news:c7d979ee.0401161613.312d286c@posting.google.c om...
> > I'm developing a simple chat room box. The main chat room page is
> > composed of three iframes, one for displaying messages posted, one for
> > displaying usernames registered online, and the other for typing in
> > messages. For each iframe there is a php file to handle it. I want to
> > know once the message is typed in, how to make the message iframe to
> > refresh and display the newest message. In other word, from one php
> > file redirected to another php file. I tried include .php, but it
> > fails because it refresh the wrong iframe ( the iframe for input
> > messages). Thanks.

Can you explain to more in detail? The script should be javascript, right?
It should be added to the page that need refresh, right? top.frames is what?
Thanks.
Reply With Quote
  #4 (permalink)  
Old 01-18-2004
Chung Leong
 
Posts: n/a
Default Re: Redirect php file

No, you output it in the frame where the inputing occurs. Essentially, the
input frame is telling the message frame to refresh.

And yes, it's Javascript. Stick 'language="javascript"' into the script tag
if you feel like.

Uzytkownik "Yue Zhang" <JohnZhang448@hotmail.com> napisal w wiadomosci
news:c7d979ee.0401171255.59fed30b@posting.google.c om...
> "Chung Leong" <chernyshevsky@hotmail.com> wrote in message

news:<-5mdnXg4QoACG5Xd4p2dnA@comcast.com>...
> > Echo something like this at the beginning of your page:
> >
> > <script>
> > top.frames['name_of_the_frame_you_want_to_refresh'].location.reload();
> > </script>
> >
> > Uzytkownik "Yue Zhang" <JohnZhang448@hotmail.com> napisal w wiadomosci
> > news:c7d979ee.0401161613.312d286c@posting.google.c om...
> > > I'm developing a simple chat room box. The main chat room page is
> > > composed of three iframes, one for displaying messages posted, one for
> > > displaying usernames registered online, and the other for typing in
> > > messages. For each iframe there is a php file to handle it. I want to
> > > know once the message is typed in, how to make the message iframe to
> > > refresh and display the newest message. In other word, from one php
> > > file redirected to another php file. I tried include .php, but it
> > > fails because it refresh the wrong iframe ( the iframe for input
> > > messages). Thanks.

> Can you explain to more in detail? The script should be javascript, right?
> It should be added to the page that need refresh, right? top.frames is

what?
> Thanks.



Reply With Quote
  #5 (permalink)  
Old 01-18-2004
Randy Webb
 
Posts: n/a
Default Re: Redirect php file

Chung Leong wrote:
> No, you output it in the frame where the inputing occurs. Essentially, the
> input frame is telling the message frame to refresh.
>
> And yes, it's Javascript. Stick 'language="javascript"' into the script tag
> if you feel like.


And if you want it to be the best practice, use type="text/javascript"
as the language attribute has been deprecated.


--
Randy

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:22 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0