45 users online (1 members and 44 guests)  


  Results 1 to 7 of 7

Related

  1. want to echange links noob here need help    Forum: Link Exchange
    Replies: 0
  2. guestbook help (noob)    Forum: CGI Perl Forum
    Replies: 1
  3. Noob coder    Forum: HTML Forum
    Replies: 2
  4. What do you think of my site... (noob)    Forum: Show it off!
    Replies: 1
  5. I'm starting a webpage( and i'm a noob)    Forum: HTML Forum
    Replies: 6
  1. #1
    rebz01's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2009
    Posts
    5

    php noob needs help

    ok when yall finish laughing at me can you help with what may be a simple solution

    i have made a lil website for my gaming clan (its weak and in so many ways probably coded wrong)

    but anyway here goes

    link >> http://bf.gravediggaz.org

    my question >>
    i have index.php home.php links.php etc...
    how do i get home.php to load in index.php by default as it stands now to view the home page you need to go to http://bf.gravediggaz.org/index.php?site=home

    Code:
    <?php
    ob_start();
    if($_GET['site'] == 'home')
    {
    include ("home.php"); 
    }
    ?> <?php
    ob_start();
    if($_GET['site'] == 'videos')
    {
    include ("videos.php"); 
    }
    ?> <?php
    ob_start();
    if($_GET['site'] == 'images')
    {
    include ("images.php"); 
    }
    ?> <?php
    ob_start();
    if($_GET['site'] == 'links')
    {
    include ("links.php"); 
    }
    ?>
    any help will be much appreciated

    ty in advance

    rebz

  2. #2
    rebz01's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2009
    Posts
    5

    Re: php noob needs help

    oh and a quick addition i did some googling before posting and found
    MY CODE
    Code:
    <?php
    ob_start();
    if($_GET['site'] == 'home')
    {
    include ("home.php"); 
    }
    ?>
    NEW CODE I GOOGLED
    Code:
    <?php include("home.php"); ?>
    if i replace min with this it does work home loads inside index.php by default but.... when i click videos home is still there and the videos load underneath

    so this is my dilemma how do i get rid of home.php when i click a different page or how do i edit my original code so it loads untill i want to click a link to fgo to a diff page

    the site is functional i just want to get rid of the ?site=home so i can dirext ppl to bf.gravediggaz.org and the page is all there in index.php

  3. #3
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: php noob needs help

    My recommendation:

    PHP Code:
    <?php
    switch ($_GET['site']) {
    case 
    'videos':
        include 
    "videos.php";
        break;
    case 
    'images':
        include 
    "images.php";
        break;
    case 
    'links':
        include 
    "links.php";
        break;
    default:
        include 
    "home.php";
    }
    ?>

  4. #4
    rebz01's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2009
    Posts
    5

    Re: php noob needs help

    okay that works a treat thanx

    1 last newbie question

    my front page is all but done

    Code:
    <HTML>
    <HEAD>
    <TITLE>[TGDZ] The GraveDiggaZ</TITLE>
    <style type="text/css">
    body {
    	background-image: url(images/bg.jpg);
    	background-repeat: no-repeat;
    }
    </style>
    </HEAD>
    <body>
    <TABLE WIDTH=764 BORDER=0 ALIGN="CENTER" CELLPADDING=0 CELLSPACING=0>
    ============================================
    ==============MY TABLE CONTENTS=============
    ============================================
    </TABLE>
    </BODY>
    </HTML>
    how do i vertically center that table?
    http://bf.gravediggaz.org
    its centered but only horizontally

    thanx so much for your help so far

  5. #5
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: php noob needs help

    Do valign='middle'. It will only center the content, so you may need to set the height to 100% as well.

  6. #6
    rebz01's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2009
    Posts
    5

    Re: php noob needs help

    yer but where would i put the height at 100% im too much like a nub ere

    this is the first php site i made html for that matter too

  7. #7
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: php noob needs help

    Place it in the following line:

    <TABLE WIDTH=764 BORDER=0 ALIGN="CENTER" CELLPADDING=0 CELLSPACING=0>



Tags for this Thread