I have begun work on a website for a family member and am integrating it with MySQL, i am fine with that part however at the moment i am going through and creating php pages, such as index.php, contact.php etc...
My question regards the code below as i am not 100% sure if this is the way you are meant to integrate php and html together. For instance in the links section <ul><li>#</li></ul> i will be pulling pages from the database, same with the content sections. As of current i am using echo ''; to display html tags and format the page using my css, although each pages is relatively small. I think for future web coding it would be good to get a bit of perspective on the correct way to approach what i am doing. So i will post the code below.
<?php echo '<head>'; echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'; echo '<link rel="stylesheet" media="all" type="text/css" href="css/mysite.css" />'; echo '<title>MySite</title>'; echo '<div id="banner"><h1></h1></div>'; echo '</head>'; echo '<body>'; echo '<div class="menu">'; echo '<ul>'; echo '<li><a href="index.php">Main</a></li>'; echo '<li><a href="#">Services</a></li>'; echo '<li><a href="products.php">Products</a></li>'; echo '<li><a href="gallery.php">Photos</a></li>'; echo '<li><a href="#">Qualifications</a></li>'; echo '<li><a href="#">Affiliates</a></li>'; echo '<li><a href="#">About Me</a></li>'; echo '</ul>'; echo '</div>'; echo '<div class="content"><br>'; echo '<h2>Introduction</h2>'; echo '<img src="assorted-images/image.jpg" />'; echo '</div>'; echo '</div>'; echo '<div id="footer"><br><br>This Site is © 2010 MemorableMakeup<br>Webdesign By : <a href="http://www.examplesite.org" target="_blank">bbq</a></div>'; echo '</body>'; ?>
As you can see i have not bothered connecting to the DB, however once i confirm whether this is the right or wrong method i will move on to that.
Cheers for the advice in advance

New Topic/Question
Reply




MultiQuote





|