The list of all PHP and Mysql posts

How to Design a PHP website by the help of Frontpage

The easiest way to design a pretty website and not to deal with HTML tags is using Dreamweaver or Frontpage softwares . But these softwares are really weak to work with databases and professional security codes , to deal with these objectives , you can use a combination of PHP and Frontpage (or Dreamweaver).

This is my solution :
you make the website design and beauty by Frontpage and make the login and database access pages by php. But if a page needs both of beauty and php codes at the same time , add the html codes of the frontpage to php file , the browser interpret HTML codes when reach to them and the php codes effect would be send directly from the server to the browser.

For example:
This is the codes of  index1.php , the HTML codes has been written by Frontpage and then I added the HTML codes to the this file:

Code:
-------------------------------------------------------
<?php
session_start();
if(isset($_SESSION["auth_usr"])){
 echo "<p><a href=\"logout.php\">log out</a></p>";
}else{
 echo "<p><a href=\"login.php\">log in</a></p>";
 $_SESSION["d"] = "page1.php";
}
?>
<html dir="rtl">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Page1</title>
</head>

<body bgcolor="#CCFF99">
<p align="center"><font size="5" color="#FF0000">
<marquee>welcome</marquee></font></p>
<p align="center">
&nbsp;</p>
<div style="position: absolute; width: 972px; height: 28px; z-index: 1; right: 155px; top: 102px; border-style: solid; border-color: #009900; background-color: #009900" id="layer1">
 <p align="left"><font size="4"><a href="page1.php">
 <span style="text-decoration: none; background-color: #00FF00">main page</span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="my_games.php">
 <span style="text-decoration: none; background-color: #00FF00">my games</span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="my_photos.php">
 <span style="text-decoration: none; background-color: #00FF00">my photos
 </span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="my_musics.php">
 <span style="text-decoration: none; background-color: #00FF00">my music</span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="about_me.php">
 <span style="text-decoration: none; background-color: #00FF00">about me</span></a></font></div>
<p align="center">
&nbsp;</p>
<p align="center"><font size="5" color="#FF0000">vahid</font></p>
<p align="center">
<img border="0" src="images_1/Image1509.jpg" width="120" height="160"></p>
<p align="center">&nbsp;</p>
<p align="center"><a href="page1.php">main page</a></p>
<p align="center"><a href="my_games.php">my games</a></p>
<p align="center"><a href="my_photos.php">my photos</a></p>
<p align="center"><a href="my_musics.php">my musics</a></p>
<p align="center"><a href="about_me.php">about me</a> </p>
<p align="center">thanks to visit my webpage please spend some moments and send
me your valuable views about the website</p>

</body>
</html>
-----------------------------------------------------------------------------------


You can copy these codes in a php file and see the result:



As you can see all of the objects are on their place and the page is well arranged.I have done these things in Frontpage but at last I added the php codes to show the " LOG IN " sign , on the screen. So we escape from design by Frontpage software and we program our pages with php.
If a page didn't contain any php codes then you can just use Frontpage to design it and however to have more security I recommend you to add some php codes to all of the pages and change their suffix to php.
If you change php codes with Frontpage to make it beautiful , don't forget to uploud the hidden files (that are created by Frontpage) to the server unless many of the objects such as menu bar would not be shown by the server.

No comments:

Post a Comment