Connecting Tech Pros Worldwide Help | Site Map

Redirect php file

  #1  
Old July 17th, 2005, 03:28 AM
Yue Zhang
Guest
 
Posts: n/a
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.
  #2  
Old July 17th, 2005, 03:28 AM
Chung Leong
Guest
 
Posts: n/a

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...[color=blue]
> 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.[/color]


  #3  
Old July 17th, 2005, 03:29 AM
Yue Zhang
Guest
 
Posts: n/a

re: Redirect php file


"Chung Leong" <chernyshevsky@hotmail.com> wrote in message news:<-5mdnXg4QoACG5Xd4p2dnA@comcast.com>...[color=blue]
> 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...[color=green]
> > 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.[/color][/color]
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.
  #4  
Old July 17th, 2005, 03:29 AM
Chung Leong
Guest
 
Posts: n/a

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...[color=blue]
> "Chung Leong" <chernyshevsky@hotmail.com> wrote in message[/color]
news:<-5mdnXg4QoACG5Xd4p2dnA@comcast.com>...[color=blue][color=green]
> > 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...[color=darkred]
> > > 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.[/color][/color]
> 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[/color]
what?[color=blue]
> Thanks.[/color]


  #5  
Old July 17th, 2005, 03:29 AM
Randy Webb
Guest
 
Posts: n/a

re: Redirect php file


Chung Leong wrote:[color=blue]
> 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.[/color]

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


--
Randy

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
redirect to a JSP file from a PHP file jonaki answers 2 May 18th, 2007 04:48 AM
PHP file download counter mistral answers 7 October 25th, 2006 11:25 PM
PHP File Transfers ending early - help! answers 5 July 17th, 2005 12:25 PM
How do I redirect to a new php file from the one I am in? C-man answers 12 July 17th, 2005 05:43 AM