RE: [PHP-DB] Dynamic Website Question!

From: Bronislav Klucka (Bronislav.Klucka_at_pro2-soft.com)
Date: 11/30/03


To: "JeRRy" <jusa_98@yahoo.com>, "PHP Konference" <php-general@lists.php.net>
Date: Sun, 30 Nov 2003 10:19:26 +0100


****index.php
<html>
        <frameset rows="100%,*" border="0" frameborder="no">
                <frame name="first" src="first.php" noresize>
                <frame name="second" src="second.php" noresize>
        </frameset>
</html>
****first.php
<html>
<body>
        <div id="text"></div>
</body>
</html>
****second.php
<html>
<head>
        <meta http-equiv="refresh" content="10;URL=second.php">
<script>
function PSBrowser(){
        this.ns4 = (window.document.layers);
        this.ie4 = (window.document.all && !window.document.getElementById);
        this.ie5 = (window.document.all && window.document.getElementById);
        this.ns6 = (!window.document.all && window.document.getElementById);
        this.op = window.navigator.appName.indexOf('Opera')!=-1;
}

function PSGetElementById(frame,id){
        var b=new PSBrowser();
        var new_obj=null;
        if(b["ns4"]){
                new_obj=frame.document.layers[id];
        } else if(b["ie4"]){
                new_obj=frame.document.all[id];
        } else if(b["ie5"] || b["ns6"]){
                new_obj=frame.document.getElementById(id);
        }
        return new_obj;
}

function DoOnLoad(){
        ele=PSGetElementById(parent.frames[0],"text");
        ele.innerHTML="<?=date("Y-m-d H:i:s");?>";
}
</script>
</head>
<body OnLoad="javascript:DoOnLoad();">

</body>
</html>

is that clear?

>
> Hi,
>
> I am not familiar with DHTML and how it can be used to
> talk to PHP to update a certain part of a page. That
> is all I need, is one section of the page, not the
> entire page, to be refreshed. The part is just text
> from a database. However on the page I want
> backgrounds, images etc but I don't want these to
> refresh, just the text from the database.
>
> What you have said below seems exactly what I want.
> But I have never used DHTML. Could you show me a
> example of both frames (just the source) of how one
> talks to another please?
>
> Jerry
>
> --- Bronislav Klucka <Bronislav.Klucka@pro2-soft.com>
> wrote: > > I want to have a PHP website that feeds
> > information
> > > off a mysql database. But generally changes
> > occour
> > > and instead of asking users to refresh the page to
> > get
> > > the updates is there a way to provide the updates
> > > without them needing to refresh the page?
> > >
> > > E.G. For like shooping Carts, Chat rooms, etc...
> > >
> > > Is there a way in PHP or something to make updates
> > > show up live as they happen instead of the yucky
> > meta
> > > refresh tag in HTML?
> > >
> > > Thanks for your time in advance.
> >
> > I'm sorry, I always dissapoint you, but what ever
> > you want to send to
> > browser must be demend by the browser. I mean you
> > can tell browser to reload
> > part of the page, browser has to ask for it, you can
> > send more information
> > to the browser and then use DHTML to provide the
> > showing, or hiding...
> >
> > There is only one way how to do, what you want (but
> > it always ask the
> > server, only user will not see reloading). The way
> > is to have 2 frames: 1st
> > for showing the content and the second to refresh
> > every 1 min. (or as you
> > want), receive informations and using DHTML change
> > the content of the first
> > frame, the secomd frame could be at the bootom of
> > the browser, 1pixel
> > height, to be "invisible"
> >
> >
> >
> > Brona
> >
>
> http://personals.yahoo.com.au - Yahoo! Personals
> New people, new possibilities. FREE for a limited time.



Relevant Pages

  • Re: Frames: links from one page to another are ignoring "target" attribute
    ... FP is a hell of a lot cheaper than DreamWeaver and *appears* to do a good ... I could understand if it created HTML that was optimised for IE, ... attribute in the <frame> tag? ... What version of OS and browser are you using. ...
    (uk.net.web.authoring)
  • Re: WWW::Mechanize with frames
    ... If I load this on the browser it returns a page with three frames one ... In the script it returns this HTML: ... The frame with name="flat" is the one I want so I next make a query ... I don't know enough Javascript to know if this reveals anything, ...
    (comp.lang.ruby)
  • Re: Simple question ??
    ... A web page is basically an HTML document. ... a technology that, at the most basic level, delivers HTML to a web browser. ... Internet Explorer, for example, can display Word documents, ... file format to a browser in its native state. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Toward WYSIWYG Web Page Authoring
    ... HTML and the web browser, ... Of course, even at the time of the first GUIs for developing HTML, WYSIWYG ... The best answer has emerged in the form of XML. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Mulberry gone, now what?
    ... > browsers is about reading broken HTML. ... It's easier for a browser to be backwards ... bear on web developers ("My son at college says the page looks different ...
    (comp.mail.imap)