SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Oct 2002
    Location
    Yorkshire, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Replacing frames with PHP

    Hi there -

    I'm using frames as the moment, but intrigued by the idea of updating by using some PHP.

    I've no programming training, but have had to learn to deal with simple scripts and HTML.

    Thing is, how easy is it going to be to use PHP? Am I going to need to set up a database, etc?

    Thanks for any replies,

    Brian

  2. #2
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP can be used without a dB so don't worry on that account.

    PHP in its simplest form should be able to help you, for example, if you wanted the page to be split into a header and a footer which woudl always stay the same then instead of using frame you could do this:

    create three files
    index.php
    header.php
    footer.php


    index.php would look like this:
    PHP Code:
    <?php
    //include the header file in here
    include("header.php");
    ?>
    some main text here which would display only on index page.
    <?php
    // include the footer file in here
    include("footer.php");
    ?>
    and then header.php would look like this
    PHP Code:
    this is the header 
    and footer.php would look like this
    PHP Code:
    this is the footer 
    when you view the index.php page you will see the header text followed by the index text then the footer text.

    Now this a very simple example, what I do is create one single page with headers and footer using tables so it looks exactly right then literlly cut and paste out each header and footer section into the php files and voila done

    Does that help explain it a little?

    Sarah
    Regular user

  3. #3
    SitePoint Member
    Join Date
    Oct 2002
    Location
    Yorkshire, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sarah -

    Ah...most excellent!

    And well explained!

    If it's as simple as that then with a basic template established, it would therefore be possible to assign a separate page.php for the content of the tables, yes?

    Thinking I could do the nav bar the same, yes?

    [sorry, have to ask because I don;t think I have access to running php yet, so I won't be able to experiment until I get a host]

    Brian

  4. #4
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Brian,

    yes and yes to all your questions. I quite often create my nav bars as seperate and then include them. and also yes you can have as many includes as you want so table info definitly.

    Now you don't actually need to have a host to test this you can install php and a server on yorru local machine very easily.

    for windows IIS or sambar server and then install php and mysql all free and away you go.

    Apache and php and mysql for unix and its as easy as that. If you pop into the PHP section of the forum there are tutorials on how to get everything set up and links to set up packages etc.

    anyway yes it is that easy and believe me it won't be long before you are branching out into dB sites too

    Good luck

    Sarah
    Regular user

  5. #5
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    running apache under windows is also nice and - relatively - painless to install. http://httpd.apache.org
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  6. #6
    SitePoint Member
    Join Date
    Oct 2002
    Location
    Yorkshire, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, it works! And that wasn't hard at all - just a little concentration required to make sure all relevant info is included in the right place after breaking up into PHP.

    Thanks for that...and yes, be nice to learn my way into dbs soon! One step at a time [gotta learn CSS first - got links].


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •