Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Web Hosting Services

Notices

Reply
 
Thread Tools
  #1  
Old 10-17-2010, 07:45 PM
LeeV18 LeeV18 is offline
Hatchling Croc
 
Join Date: Mar 2010
Posts: 18
Default learning php

So, i've been trying to learn php by watching this tutorial video: http://www.youtube.com/watch?v=mnf0zemQpEI

I follow the video instructions and created all files (index.php header.php footer.php sidebar.php and style.css) just like in the video tutorial.

After creating the files and uploading them to my webhost server to test it, i've expected the page to look like this (like in the video):


but instead, the page looks like this:


Do i have do enable something first, or did I do something wrong.
__________________
leev18.com |
Reply With Quote
  #2  
Old 10-17-2010, 08:35 PM
citawds's Avatar
citawds citawds is offline
Swamp Croc
 
Join Date: Oct 2008
Location: Colorado
Posts: 210
Default Re: learning php

Looks like you need to add a style sheet (css) to style the page ;-)

Steve
Reply With Quote
  #3  
Old 10-17-2010, 08:47 PM
GvilleRick's Avatar
GvilleRick GvilleRick is offline
Emperor Croc
 
Join Date: Jan 2007
Location: Greenville, SC
Posts: 3,130
Default Re: learning php

You also need to check the code. Several of the HTML tags are incorrect. For example, you have :
Code:
<head>
</link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</title>leev18.com</title>
<body>
You should try:

Code:
<head>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<title>leev18.com</title>
</head>
<body>
Reply With Quote
  #4  
Old 10-17-2010, 09:19 PM
LeeV18 LeeV18 is offline
Hatchling Croc
 
Join Date: Mar 2010
Posts: 18
Default Re: learning php

Doesn't work. Here's the source code I used, from the video tutorial.

index.php
Code:
<?php include('header.php'); ?>

<div id="content">
<div id="contentleft">
<p>contentleft</p>
</div>

<?php include('sidebar.php'); ?>
</div>

<?php include('footer.php'); ?>

header.php
Code:
<html>
<head>
</link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</title>leev18.com</title>
</head>
<body>
<div id="header">
<div id="logo">
<p>LOGO</p>
</div>
<div id="hsubscribe">
<p>Header Subscribe</p>
</div>
</div>
</div id="navbar">
</p>navbar</p>
</div>
footer.php
Code:
<div id="footer">
<p>footer</p>
</div>
</body>
</html>
sidebar.php
Code:
<div id="sidebar">
<p>sidebar</p>
</div>
style.css
Code:
# body {
	margin: 0px;
	padding: 0px;
	font-family: Calibri, Arial, Tahoma;
}

# header {
	width: 900px;
	margin: 0px auto 0px auto;
	border: 1px solid #000;
	clear: both;
}
	
# logo {
	width: 400px;
	float: left;
	boarder: 1px solid #000;
}

# hsubscribe {
	width: 400px;
	float: right;
	boarder: 1px solid #000;
}

# navbar {
	width: 900px;
	margin: 0px auto 0px auto;
	border: 1px solid #000;
	clear: both;
}

# content {
	width: 900px;
	margin: 0px auto 0px auto;
	border: 1px solid #000;
	clear: both;
}

# contentleft {
	width: 550px;
	float: left;
	boarder: 1px solid #000;
}

# sidebar {
	width: 300px;
	float: right;
	boarder: 1px solid #000;
}

# footer {
	width: 900px;
	margin: 0px auto 0px auto;
	border: 1px solid #000;
	clear: both;
}
__________________
leev18.com |

Last edited by LeeV18; 10-17-2010 at 09:23 PM.
Reply With Quote
  #5  
Old 10-18-2010, 01:07 AM
Pazeh Pazeh is offline
King Croc
 
Join Date: Jan 2005
Posts: 1,327
Default Re: learning php

fix the errors that rick told you about and change to </div id="navbar"> to <div id="navbar">
Reply With Quote
  #6  
Old 10-19-2010, 08:31 AM
chelle64 chelle64 is offline
Hatchling Croc
 
Join Date: Oct 2008
Posts: 47
Default Re: learning php

Besides the errors mentioned above, you need to fix your stylesheet - remove the space between the # and the style name so # header becomes #header.
Reply With Quote
Reply

Bookmarks

Thread Tools

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Your insight on reflection, redirection, learning IM/AM Craig Mattice Shared Hosting Support 2 05-09-2009 07:57 AM
Learning PHP: beginners' resources gwyneth Shared Hosting Support 12 03-05-2008 10:00 PM

All times are GMT -5. The time now is 11:24 AM.