doogy Posted February 19, 2011 Share Posted February 19, 2011 i have apache 2.2 and php 5.0 installed on my pc, i have a html page and i need to turn it into php and also i need to include a header and a footer, i tryed doing it but the webpage won't display, what am i doing wrong? here is my page which i tryed turning into php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!--index.html is basically an introductory page to this website, this page introduce us to this website. This page tell us, this page is called index.html because that's the name of the first page on any website, this page tell us wat type of website this is, name of this website, name of the person(in this case that's me) who made it, a light description of what type of contents we will find inside this website etc. This page tell us the name of this lab assignment which is " --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>INTN2201 - Lab 1</title><!--title of this page --> <link href="./css/intn2201.css" rel="stylesheet" type="text/css" /></head> <body> <table border="1" > <tr> <td class="navmenu"><img src="images/my_logo.jpg" alt="My Logo" /></td> <td class="page_header"><h1>INTN 2201: Lab Assignment 1: HTML Pages</h1></td> </tr> <tr> <td valign="top"> <a href="index.html" >MY HOME PAGE</a> <br /> <a href="lab1.html" >LAB 1:HTML Intro</a> <br /> <a href="lab2.html" >LAB 2:HTML Tables</a> <br /> <a href="lab3.html" >LAB 3:CSS Styles</a> </td> <td class="main_body"><h2> Purpose of this website</h2> <p class="p1"> This website was created for first lab assignment of <a href="http://opentech.durhamcollege.ca/~pufferd/intn2201">INTN2201</a>, <a href="http://opentech.durhamcollege.ca/~pufferd/intn2201">INTN2201</a> is the course code for "INTERNET DEVELOPMENT I" course, at <a href="http://www.durhamcollege.ca">Durham College</a> every first year student<br/> of Computer System Technology program(3 years) have to take this course, main purpose of this site is to get a first feel for creating a basic html website<br/> but also to get a feel of how to use it in website creation, during the creation of this page i get to know programs like notepad++,<br/> WINSCP, learned how to login to course webserver(opentech.durhamcollege.ca), another purpose for this site is to test webpage creator's( in this case that's me)<br/> knowledle about HTML tags, XHTML, W3C validator, HTML stands for Hyper Text,it is not a programming language it is a Markup Language,<br/> I(creater of this website) wanted to learn about differen't html tags and one of the best ways to learn about html tags is to try create<br/> a html webpage. </p> <hr/> <h2>ol { margin-left : 200px; } </h2> <p class="p2"> in this style tag i used Margine properties to define a list in lab2.html, bottom of the page u will see lists, so margine basically sets all the margin properties in one declaration.</p> <hr/> <a href="http://www.durhamcollege.ca/"> <img width="300" src="images/durham_college_logo.jpg" alt="My Logo" /></a> <hr/> </td> </tr> <tr> <td class="navmenu" colspan="2" align="right"> ©2011 <p> <a href="http://validator.w3.org/check?uri=referer"> <img style="width:88px; height:31px; position:fixed; bottom: 81px; left:50px;" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" /> </a> </p> <p> <a href="http://jigsaw.w3.org/css-validator/check/referer"> <img style="width:88px; height:31px; position:fixed; bottom: 45px; left:50px; " src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /> </a> </p></td> </tr> </table> </body> </html> how do i turn this into php page and what goes in the header and footer? Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/ Share on other sites More sharing options...
cunoodle2 Posted February 19, 2011 Share Posted February 19, 2011 File > Save As > "index.php" Done Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1176919 Share on other sites More sharing options...
doogy Posted February 19, 2011 Author Share Posted February 19, 2011 the instruction says i have to do the following: # To ease web site maintenance you will pull the banner and nav bar off of your standardized pages, and place them in a file called "header.php" # You will pull any bottom of the page and/or right side nav bar and place it in a file name "footer.php". This footer.php should include the XHTML and CSS validation images. i am not sure wat part i need to edit and remove and put it in header or footer files. Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1176927 Share on other sites More sharing options...
karimali831 Posted February 19, 2011 Share Posted February 19, 2011 I would tidy the script first, I wouldn't want to work on that! After that, you can easily locate your header, body etc. Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1176929 Share on other sites More sharing options...
doogy Posted February 19, 2011 Author Share Posted February 19, 2011 this is the only thing i have so i have to work with this Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1176932 Share on other sites More sharing options...
doogy Posted February 19, 2011 Author Share Posted February 19, 2011 do i need to delete the top part and bottom part from my index.html page and add them to footer.php and header.php pages? Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1176945 Share on other sites More sharing options...
BlueSkyIS Posted February 19, 2011 Share Posted February 19, 2011 yes, if you need to use the same HTML at the top and bottom of other pages on your website. Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1176946 Share on other sites More sharing options...
Pikachu2000 Posted February 19, 2011 Share Posted February 19, 2011 When posting code, please enclose it within the forum's . . . BBCode tags. Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1176961 Share on other sites More sharing options...
doogy Posted February 20, 2011 Author Share Posted February 20, 2011 ok sorry about that, btw this my html page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!--index.html is basically an introductory page to this website, this page introduce us to this website. This page tell us, this page is called index.html because that's the name of the first page on any website, this page tell us wat type of website this is, name of this website, name of the person(in this case that's me) who made it, a light description of what type of contents we will find inside this website etc. This page tell us the name of this lab assignment which is " --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>INTN2201 - Lab 1</title><!--title of this page --> <link href="./css/intn2201.css" rel="stylesheet" type="text/css" /></head> <body> <table border="1" > <tr> <td class="navmenu"><img src="images/my_logo.jpg" alt="My Logo" /></td> <td class="page_header"><h1>INTN 2201: Lab Assignment 1: HTML Pages</h1></td> </tr> <tr> <td valign="top"> <a href="index.html" >MY HOME PAGE</a> <br /> <a href="lab1.html" >LAB 1:HTML Intro</a> <br /> <a href="lab2.html" >LAB 2:HTML Tables</a> <br /> <a href="lab3.html" >LAB 3:CSS Styles</a> </td> <td class="main_body"><h2> Purpose of this website</h2> <p class="p1"> This website was created for first lab assignment of <a href="http://opentech.durhamcollege.ca/~pufferd/intn2201">INTN2201</a>, <a href="http://opentech.durhamcollege.ca/~pufferd/intn2201">INTN2201</a> is the course code for "INTERNET DEVELOPMENT I" course, at <a href="http://www.durhamcollege.ca">Durham College</a> every first year student<br/> of Computer System Technology program(3 years) have to take this course, main purpose of this site is to get a first feel for creating a basic html website<br/> but also to get a feel of how to use it in website creation, during the creation of this page i get to know programs like notepad++,<br/> WINSCP, learned how to login to course webserver(opentech.durhamcollege.ca), another purpose for this site is to test webpage creator's( in this case that's me)<br/> knowledle about HTML tags, XHTML, W3C validator, HTML stands for Hyper Text,it is not a programming language it is a Markup Language,<br/> I(creater of this website) wanted to learn about differen't html tags and one of the best ways to learn about html tags is to try create<br/> a html webpage. </p> <hr/> <h2>ol { margin-left : 200px; } </h2> <p class="p2"> in this style tag i used Margine properties to define a list in lab2.html, bottom of the page u will see lists, so margine basically sets all the margin properties in one declaration.</p> <hr/> <a href="http://www.durhamcollege.ca/"> <img width="300" src="images/durham_college_logo.jpg" alt="My Logo" /></a> <hr/> </td> </tr> <tr> <td class="navmenu" colspan="2" align="right"> ©2011 <p> <a href="http://validator.w3.org/check?uri=referer"> <img style="width:88px; height:31px; position:fixed; bottom: 81px; left:50px;" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" /> </a> </p> <p> <a href="http://jigsaw.w3.org/css-validator/check/referer"> <img style="width:88px; height:31px; position:fixed; bottom: 45px; left:50px; " src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /> </a> </p></td> </tr> </table> </body> </html> this is wat i did to turn it into php header.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!--index.html is basically an introductory page to this website, this page introduce us to this website. This page tell us, this page is called index.html because that's the name of the first page on any website, this page tell us wat type of website this is, name of this website, name of the person(in this case that's me) who made it, a light description of what type of contents we will find inside this website etc. This page tell us the name of this lab assignment which is " --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Rahat Amin INTN2201 - Lab 1</title><!--title of this page --> <link href="./css/intn2201.css" rel="stylesheet" type="text/css" /></head> <body> <table border="1" > <tr> <td class="navmenu"><img src="images/my_logo.jpg" alt="My Logo" /></td> <td class="page_header"><h1>INTN 2201: Lab Assignment 1: HTML Pages</h1></td> </tr> <tr> <td valign="top"> <a href="index.html" >MY HOME PAGE</a> <br /> <a href="lab1.html" >LAB 1:HTML Intro</a> <br /> <a href="lab2.html" >LAB 2:HTML Tables</a> <br /> <a href="lab3.html" >LAB 3:CSS Styles</a> </td> footer.php <hr/> <a href="http://www.durhamcollege.ca/"> <img width="300" src="images/durham_college_logo.jpg" alt="My Logo" /></a> <hr/> </td> </tr> <tr> <td class="navmenu" colspan="2" align="right"> ©2011 <p> <a href="http://validator.w3.org/check?uri=referer"> <img style="width:88px; height:31px; position:fixed; bottom: 81px; left:50px;" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" /> </a> </p> <p> <a href="http://jigsaw.w3.org/css-validator/check/referer"> <img style="width:88px; height:31px; position:fixed; bottom: 45px; left:50px; " src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /> </a> </p></td> </tr> </table> </body> </html> and this is my main page index.php <td class="main_body"><h2> Purpose of this website</h2> <p class="p1"> This website was created for first lab assignment of <a href="http://opentech.durhamcollege.ca/~pufferd/intn2201">INTN2201</a>, <a href="http://opentech.durhamcollege.ca/~pufferd/intn2201">INTN2201</a> is the course code for "INTERNET DEVELOPMENT I" course, at <a href="http://www.durhamcollege.ca">Durham College</a> every first year student<br/> of Computer System Technology program(3 years) have to take this course, main purpose of this site is to get a first feel for creating a basic html website<br/> but also to get a feel of how to use it in website creation, during the creation of this page i get to know programs like notepad++,<br/> WINSCP, learned how to login to course webserver(opentech.durhamcollege.ca), another purpose for this site is to test webpage creator's( in this case that's me)<br/> knowledle about HTML tags, XHTML, W3C validator, HTML stands for Hyper Text,it is not a programming language it is a Markup Language,<br/> I(creater of this website) wanted to learn about differen't html tags and one of the best ways to learn about html tags is to try create<br/> a html webpage. </p> <hr/> <h2>ol { margin-left : 200px; } </h2> <p class="p2"> in this style tag i used Margine properties to define a list in lab2.html, bottom of the page u will see lists, so margine basically sets all the margin properties in one declaration.</p> <hr/> <a href="http://www.durhamcollege.ca/"> <img width="300" src="images/durham_college_logo.jpg" alt="My Logo" /></a> But when i try to load index.php on browser, it says page can't be found... Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1176997 Share on other sites More sharing options...
Joshua F Posted February 20, 2011 Share Posted February 20, 2011 File > Save As > "index.php" Done This ^. Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1176998 Share on other sites More sharing options...
doogy Posted February 20, 2011 Author Share Posted February 20, 2011 File > Save As > "index.php" Done This ^. read my last 3 posts bro Quote Link to comment https://forums.phpfreaks.com/topic/228228-how-do-i-turn-my-html-page-to-php/#findComment-1177000 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.