"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

Go Back   Webmaster Forums > Code Forum > PHP Forum

Reply
 
Thread Tools Rate this Webmaster Discussion
Old 10-04-2009, 08:43 PM   #1
rebz01
New Member
 
Join Date: Oct 2009
Webmaster Discussions: 5
Rep Power: 6
rebz01 is on a distinguished road
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


rebz01 is offline   Reply With Quote
Old 10-04-2009, 09:34 PM   #2
rebz01
New Member
 
Join Date: Oct 2009
Webmaster Discussions: 5
Rep Power: 6
rebz01 is on a distinguished road
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
rebz01 is offline   Reply With Quote
Old 10-05-2009, 05:33 PM   #3
jthayne
 
jthayne's Avatar
 
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21
jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.
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";
}
?>
__________________
Be sure to click the reputation icon to give rep to the person who helped you.
For web design/development services, check Silentium Designs.
jthayne is offline   Reply With Quote
Old 10-05-2009, 11:10 PM   #4
rebz01
New Member
 
Join Date: Oct 2009
Webmaster Discussions: 5
Rep Power: 6
rebz01 is on a distinguished road
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
rebz01 is offline   Reply With Quote
Old 10-13-2009, 10:58 AM   #5
jthayne
 
jthayne's Avatar
 
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21
jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.
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.
__________________
Be sure to click the reputation icon to give rep to the person who helped you.
For web design/development services, check Silentium Designs.
jthayne is offline   Reply With Quote
Old 10-13-2009, 10:05 PM   #6
rebz01
New Member
 
Join Date: Oct 2009
Webmaster Discussions: 5
Rep Power: 6
rebz01 is on a distinguished road
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
rebz01 is offline   Reply With Quote
Old 10-20-2009, 05:49 PM   #7
jthayne
 
jthayne's Avatar
 
Join Date: Aug 2008
Location: Texas
Webmaster Discussions: 501
Rep Power: 21
jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.jthayne is the hardest working person in the biz.
Re: php noob needs help

Place it in the following line:

<TABLE WIDTH=764 BORDER=0 ALIGN="CENTER" CELLPADDING=0 CELLSPACING=0>
__________________
Be sure to click the reputation icon to give rep to the person who helped you.
For web design/development services, check Silentium Designs.
jthayne is offline   Reply With Quote
Reply

Bookmarks

Tags
php

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Webmaster Discussions
Thread Webmaster Discussion Starter Forum Replies Last Post
want to echange links noob here need help zrohder Link Exchange 0 08-13-2007 06:28 AM
guestbook help (noob) Trinthakis CGI Perl Forum 1 12-05-2005 05:04 PM
Noob coder deadfinger04 HTML Forum 2 08-10-2004 02:29 PM
What do you think of my site... (noob) interpim Show it off! 1 06-11-2004 04:06 PM
I'm starting a webpage( and i'm a noob) bombsledder HTML Forum 6 12-30-2003 11:49 PM


All times are GMT -5. The time now is 08:53 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.