Thread: Designing a Web Interface

Designing a Web Interface

From
"mmcgillick"
Date:

Good Morning:

 

I’ve set up a PostgreSQL database on my Red Hat Linux 7.3 box. I’m trying to figure out how to put together a web page to administer records in the database. I’d like my web site to behave in the manner of a software application where the page itself is updated when I submit changes, and I don’t have to go to a new page to see the change, and then click to get back to the main page.

 

From my experience with HTML, I understand I can use frames and a target=<frame name> to make an html page appear in a particular frame. From reading through PHP, in order to get it to work, you usually make the .php page the target, and this leaves me in the strange position that I can’t direct where the output of the page should go.

 

I’m curious if someone has implemented this type of layout, or if any has some pointers on where I might be able to do some further reading. Any pointers to examples would also be really appreciated.

 

Thanks for your time.

 

- Michael

Re: Designing a Web Interface

From
"mike"
Date:
You do nothing special in the PHP page.  It loads where you instructed the
browser to load it.  The only thing you need to specify in the html you send
to the browser is the 'target' for future pages.  If you want to learn more
about frames, search google and you will find tons of reference sites.

Michael J. Upchurch
Partner2Partner Communications  mike@partner2partner.com  615.286.2199

mmcgillick writes:

> Good Morning:
>
>
>
> I've set up a PostgreSQL database on my Red Hat Linux 7.3 box. I'm
> trying to figure out how to put together a web page to administer
> records in the database. I'd like my web site to behave in the manner of
> a software application where the page itself is updated when I submit
> changes, and I don't have to go to a new page to see the change, and
> then click to get back to the main page.
>
>
>
> From my experience with HTML, I understand I can use frames and a
> target=<frame name> to make an html page appear in a particular frame.
> From reading through PHP, in order to get it to work, you usually make
> the .php page the target, and this leaves me in the strange position
> that I can't direct where the output of the page should go.
>
>
>
> I'm curious if someone has implemented this type of layout, or if any
> has some pointers on where I might be able to do some further reading.
> Any pointers to examples would also be really appreciated.
>
>
>
> Thanks for your time.
>
>
>
> - Michael
>


Re: Designing a Web Interface

From
Keary Suska
Date:
on 6/9/02 9:08 AM, mmcgillick@attbi.com purportedly said:

> I¹ve set up a PostgreSQL database on my Red Hat Linux 7.3 box. I¹m trying to
> figure out how to put together a web page to administer records in the
> database. I¹d like my web site to behave in the manner of a software
> application where the page itself is updated when I submit changes, and I
> don¹t have to go to a new page to see the change, and then click to get back
> to the main page.

If I understand you correctly, which I am not certain since your description
is ambiguous, you want a page that displays database row fields in an
editable form, and you want to submit the form which returns to the form
with the new updated values, yes? If so, frames are unnecessary. You would
only want some kind of frame implementation if you want some part of the
display to *not* change when a form is submitted or a link clicked in some
context.

I often use the logic:

if( $_SERVER['REQUEST_METHOD'] == 'GET' ) {
  // get database info, store in associative array: I will use $data
  // you may need to distinguish between editing and adding
}
elseif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
  // untaint data, store in $data; update/insert as the case may be
}

// here, display the form with default values according to $data
__END__

If you want to account for multi-user access, where a different user may
have also changed the data after you have but before the page is displayed,
you can redirect to the same page:
    header( "Location: /page/URL" );
This will force the script to re-read from the database, instead of just
using the submitted data. If performance is an issue, this step may be
avoided since the situation would not occur too frequently.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"


Re: Designing a Web Interface

From
hodges@xprt.net
Date:
A good example of setting up a web site in php is
"_PHP fast&easy web development_" by Julie C Meloni

http://www.thickbook.com/index.html

It uses MySQL but can easily be adapted for postgresql
(I did it as my first php project).

Tom Hodges

On 9 Jun 2002 at 15:38, mike wrote:

> You do nothing special in the PHP page.  It loads where you instructed the
> browser to load it.  The only thing you need to specify in the html you send to
> the browser is the 'target' for future pages.  If you want to learn more about
> frames, search google and you will find tons of reference sites.
>
> Michael J. Upchurch
> Partner2Partner Communications  mike@partner2partner.com  615.286.2199
>
> mmcgillick writes:
>
> > Good Morning:
> >
> >
> >
> > I've set up a PostgreSQL database on my Red Hat Linux 7.3 box. I'm
> > trying to figure out how to put together a web page to administer
> > records in the database. I'd like my web site to behave in the manner of
> > a software application where the page itself is updated when I submit
> > changes, and I don't have to go to a new page to see the change, and
> > then click to get back to the main page.
> >
> >
> >
> > From my experience with HTML, I understand I can use frames and a
> > target=<frame name> to make an html page appear in a particular frame.
> > From reading through PHP, in order to get it to work, you usually make
> > the .php page the target, and this leaves me in the strange position
> > that I can't direct where the output of the page should go.
> >
> >
> >
> > I'm curious if someone has implemented this type of layout, or if any
> > has some pointers on where I might be able to do some further reading.
> > Any pointers to examples would also be really appreciated.
> >
> >
> >
> > Thanks for your time.
> >
> >
> >
> > - Michael
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>