Jump to content


Photo

Need help converting HTML to PHP


  • Please log in to reply
2 replies to this topic

#1 seederekrun

seederekrun
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 06 April 2006 - 03:41 AM

Ok heres the deal. I have been working on a squadron website for quite some time now and realized that html just isn't the way to go. It seems to be dead so I want to shift towards a PHP ran site. My site is really simple and I am sure that my question is going to be retarded but I have been toying with it for far too long.

At www.puggo.com you can see my website. The goal is to keep everything in union except for the text in the middle of the page which will change when you click on any of the links. Also the menu on the lefthand side needs submenus. The problem I face is that I want to have a "Recent Articles" section and it just seems difficult to figure out how to keep a template for every page. It seems if I make any change I have to change all the pages which is a lot of work. Anyone got any solutions even if it isn't php?

Thanks for your help in advance!

-Derek, the confused one

#2 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 06 April 2006 - 09:43 PM

If you have no programming experience, you are probably best off using an existing content management system (CMS), that allows you to change/edit the content of your site easily. There are tons of PHP/MySQL options out there. Of course, another option is to code it in PHP yourself. There is really no "conversion" from HTML-to-PHP involved, as much as it is just writing the code from scratch. An HTML page is static and the content does not change. You lay out the tables, type in the text manually, and define what your layout is going to be. PHP gives you the ability to dynamically generate the content, and even display it conditionally.

Good luck.
PHP Ninja

#3 Rahnetjera

Rahnetjera
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 07 April 2006 - 06:44 PM

<?php

///   Header.php
?>
<html><head>Head specific content here</head>
<title>Page Title</title>
<body><table 1>Banner upper barlinks etc</table>
<table 2>Left side nav bar</table>




<?php

/// whatever page index for arguement sake.
// index.php

include "header.php";  // includes your upper logo, and left hand navmenu
?>
<table>Main site content</table>
<?php
include "footer.php";  // includes right hand nav menu and lower site info
?>

<?php

// footer.php
?>
<table 3>Right hand menu</table>
<table 4>bottom site specs/author shouts whatever</table>
</body></html>

From creating a header.php and footer.php you can simply include those two at the start and end of your script and keep all pages uniform. I know the explanation was haphazard, but I hope I gave you some inspiration.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users