Anyone know how to use php pages?

Discussion in 'PHP' started by Arkserver, Aug 1, 2006.

  1. #1
    Hi

    I'm not familiar with php / webdesign myself and i want to ask how i can make a page look like this:

    [​IMG]
    The layout must be centered and the content must be php pages something like php?id=blabla

    Does anyone know how to make these php pages? tips / hints are welcome
    i'm using dreamweaver Mx

    ps. i could have posted this in the PHP board but i also need to know how to make the layout so i thought that this was the best suited board to post in..
     
    Arkserver, Aug 1, 2006 IP
  2. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #2
    frankcow, Aug 1, 2006 IP
  3. rosytoes

    rosytoes Peon

    Messages:
    230
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Just do the layout normally in html and plug in the php sections with
    <? include("filename.php") ?>
    Code (markup):
     
    rosytoes, Aug 1, 2006 IP
  4. DavidF

    DavidF Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Roseytoes is right. Php is a server side scripting language, meaning that it can process information, variables, input, etc on the server side. Once your server is set up to run php, you can move in and out of php and html easily. Just use the
    <?php tag to start php code, and the ?> tag to close it. While in php, you can use the php "echo" command to send embedded html code to the browser as well.
     
    DavidF, Aug 1, 2006 IP
  5. fordP

    fordP Peon

    Messages:
    548
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I wouldn't strive for URLS that looked like that, you'd probably do better with mod_rewriting any of your URLS;
     
    fordP, Aug 1, 2006 IP
  6. picklemy

    picklemy Peon

    Messages:
    227
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    One mistake alot of new developers make is MAKE SURE the page your using the php includes in is saved as a PHP file itself. Simple mistake, but ive seen it happen many a time
     
    picklemy, Aug 2, 2006 IP
  7. candidindia

    candidindia Peon

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    That' a good reminder picklemy !!
     
    candidindia, Aug 2, 2006 IP
  8. Any

    Any Peon

    Messages:
    78
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    yeah as mentioned above the include will help you get the stuff without rewriting code much and with a css stylesheet file you can get the centering and block sizes quite easily. I don't see you planning for a footer but it'll work the same way. you might want to separate the menus and constant code like Header, menus and footer in one place and the content pages in another.
     
    Any, Aug 2, 2006 IP
  9. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #9
    The layout is done with HTML. If you know how to do that with HTML, do so and save it with a .php extension. For the pages you could do something like:

    
    <?php
    $pageRequested = $_GET['id'];
    $pageRequested = strtolower($pageRequested);
    
    switch ($pageRequested) {
    case "blabla":
       include 'blablah.php';
       break;
    case "forum":
       include 'forum.php';
       break;
    default:
       include 'news.php';
    }
    ?>
    
    PHP:
     
    Gordaen, Aug 2, 2006 IP
  10. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #10
    There are some great video tutorials on php at lynda.com, hope this helps
     
    bacanze, Aug 3, 2006 IP
  11. [*-AnOnYmOuS-*]

    [*-AnOnYmOuS-*] Active Member

    Messages:
    253
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #11
    OMG! Mod_rewrite is only for SE friendly links. On that a simple "id=x" shouldn't cause you to use mod_rewrite. On that mod_rewrite will cause extra strain on your server.
     
    [*-AnOnYmOuS-*], Aug 3, 2006 IP
  12. Arkserver

    Arkserver Banned

    Messages:
    2,533
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Thanks 4 all the tips, i'm a total webdesign noob so i'll try to make something out of this :D
     
    Arkserver, Aug 3, 2006 IP