A Simple Way To Maintain Many Webpages Without A Cms

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

A Simple Way To Maintain Many Webpages Without A Cms

True2Earn
Here is a very simple way to maintain many webpages without using a content management system (CMS). One of the advantages to this is you can change templates very easily. Your article would be in a separate file, for an example we'll create a file called my_page_article.php

CODE
<?
$PageTitle = "My Page";
$articleDescription = "This is my page";
$articleTitle = "All about my page";
$articleKeywords = "my page";
$articleBody  ='<strong>Welcome to my page.<br>
This is <a href="http://www.google.com" target="_blank">Google</a>!</strong>';
?>

Next, we design a template and enter our variables where we want them. As an example and to save space, here is a very plain template. For our article above we'll name it my_page.php

CODE
<? include ("article.php"); ?>
<html>
<head>
<title><? echo "$pageTitle"; ?></title>
<META NAME="description" CONTENT="<? echo "$pageDescription"; ?>">
<META NAME="keywords" CONTENT="<? echo "$articleKeywords"; ?>">
<META NAME="revisit-after" CONTENT="7 days">
<META NAME="robots" CONTENT="index, follow">
<META NAME="rating" content="general">
<META NAME="distribution" content="global">
</head>
<body>
<p><? echo $articleTitle; ?></p>
<p><? echo $articleBody; ?></p>
</body>
</html>

Such a simple template system as the above can be expanded upon to use mySQL to store all the info instead of the first file listed above. But, for a quick and dirty way of getting a large number of pages up in a short time, this works pretty well.

But now you're probably saying, "ok, now I have 100 pages all ready to upload. What about an index page?" No problem! We'll make the index.php like this

CODE
<? $indexTitle = "My Page Index";
$pageDescription = "This is my page index";
$pageKeywords = "my page,my index';

$articleTitle1 = "My 1st Article";
$articleLink2 = "my_article_1.php;
$articleDecrip_1 = "Learn all about apples and oranges";

$articleTitle2 = "My 2nd Article";
$articleLink2 = "my_article_2.php;
$articleDecrip_2 = "Learn all about peaches and pears";

$articleTitle3 = "My 3rd Article";
$articleLink2 = "my_article_3.php;
$articleDecrip_2 = "Learn all about rocks and rolls";

<html>
<head>
<title><? echo "$indexTitle"; ?></title>
<META NAME="description" CONTENT="<? echo "$pageDescription"; ?>">
<META NAME="keywords" CONTENT="<? echo "$pageKeywords"; ?>">
<META NAME="revisit-after" CONTENT="7 days">
<META NAME="robots" CONTENT="index, follow">
<META NAME="rating" content="general">
<META NAME="distribution" content="global">
</head>
<body>
<a href="<? echo $articleLink1 ?>"><? echo $articleTitle1; ?><br>
<? echo $articleDescription1; ?><br><br>
<a href="<? echo $articleLink2 ?>"><? echo $articleTitle2; ?><br>
<? echo $articleDescription2; ?><br><br>
<a href="<? echo $articleLink3 ?>"><? echo $articleTitle3; ?><br>
<? echo $articleDescription3; ?><br><br>
<!-- you can add more pages by doing this -->
<a href="index.php">1</a> - <a href="index-2.php">2</a> - <a href="index-3.php">3</a>
</body>
</html>

and there's your template/guideline for making an index page for all your articles.

 

 

 


Reply

Bradley
Looks good though some people dont like to use single quotes will have to slash their double quotes (EX: " will be \") which you will have to do if you use the code from my_page_article.php
CODE
$articleBody  ='<strong>Welcome to my page.<br>
This is <a href="http://www.google.com" target="_blank">Google</a>!</strong>';

The easisest and most user friendly way would to have the information they want as the body to be stored in a MySQL database. Then just retrieve the data and set it as $articleBody and it'd work just as great but with no hassle smile.gif.

Reply

hujtec
Yes this is a nice solution. But please think about it for a second. Is it really worth the time and effort? That method could be viable if your time costs nothing. In any other case you are better off using mysql. God forbid that your site would be successful and would become bigger in size. Who would administer all that content I do not know.
Still - a nice exercise in clean design.

Reply

truefusion
If you think about it. This is like manual-CMS. Nice planned-out alternative, though. May be useful for many.

Reply

bapplay
QUOTE(True2Earn @ May 1 2006, 03:12 PM) *

Here is a very simple way to maintain many webpages without using a content management system (CMS). One of the advantages to this is you can change templates very easily. Your article would be in a separate file, for an example we'll create a file called my_page_article.php

CODE
<?
$PageTitle = "My Page";
$articleDescription = "This is my page";
$articleTitle = "All about my page";
$articleKeywords = "my page";
$articleBody  ='<strong>Welcome to my page.<br>
This is <a href="http://www.google.com" target="_blank">Google</a>!</strong>';
?>

Next, we design a template and enter our variables where we want them. As an example and to save space, here is a very plain template. For our article above we'll name it my_page.php

CODE
<? include ("article.php"); ?>
<html>
<head>
<title><? echo "$pageTitle"; ?></title>
<META NAME="description" CONTENT="<? echo "$pageDescription"; ?>">
<META NAME="keywords" CONTENT="<? echo "$articleKeywords"; ?>">
<META NAME="revisit-after" CONTENT="7 days">
<META NAME="robots" CONTENT="index, follow">
<META NAME="rating" content="general">
<META NAME="distribution" content="global">
</head>
<body>
<p><? echo $articleTitle; ?></p>
<p><? echo $articleBody; ?></p>
</body>
</html>

Such a simple template system as the above can be expanded upon to use mySQL to store all the info instead of the first file listed above. But, for a quick and dirty way of getting a large number of pages up in a short time, this works pretty well.

But now you're probably saying, "ok, now I have 100 pages all ready to upload. What about an index page?" No problem! We'll make the index.php like this

CODE
<? $indexTitle = "My Page Index";
$pageDescription = "This is my page index";
$pageKeywords = "my page,my index';

$articleTitle1 = "My 1st Article";
$articleLink2 = "my_article_1.php;
$articleDecrip_1 = "Learn all about apples and oranges";

$articleTitle2 = "My 2nd Article";
$articleLink2 = "my_article_2.php;
$articleDecrip_2 = "Learn all about peaches and pears";

$articleTitle3 = "My 3rd Article";
$articleLink2 = "my_article_3.php;
$articleDecrip_2 = "Learn all about rocks and rolls";

<html>
<head>
<title><? echo "$indexTitle"; ?></title>
<META NAME="description" CONTENT="<? echo "$pageDescription"; ?>">
<META NAME="keywords" CONTENT="<? echo "$pageKeywords"; ?>">
<META NAME="revisit-after" CONTENT="7 days">
<META NAME="robots" CONTENT="index, follow">
<META NAME="rating" content="general">
<META NAME="distribution" content="global">
</head>
<body>
<a href="<? echo $articleLink1 ?>"><? echo $articleTitle1; ?><br>
<? echo $articleDescription1; ?><br><br>
<a href="<? echo $articleLink2 ?>"><? echo $articleTitle2; ?><br>
<? echo $articleDescription2; ?><br><br>
<a href="<? echo $articleLink3 ?>"><? echo $articleTitle3; ?><br>
<? echo $articleDescription3; ?><br><br>
<!-- you can add more pages by doing this -->
<a href="index.php">1</a> - <a href="index-2.php">2</a> - <a href="index-3.php">3</a>
</body>
</html>

and there's your template/guideline for making an index page for all your articles.

nice

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : maintain webpages cms


    Looking for simple, maintain, webpages, cms

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for simple, maintain, webpages, cms

*MORE FROM TRAP17.COM*
advertisement



A Simple Way To Maintain Many Webpages Without A Cms



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE