Jump to content

how to build a simple CMS? one web page


foevah

Recommended Posts

Hi everyone,

 

I would like to a very simple CMS.

 

Simple as in:

The ability to edit one page - not a whole site.

 

The content of the site will have main image which will be uploaded, resized and put  into the database. This will then be displayed on the web page. The text in the content will also be editable via a CMS.

 

This sounds simple but yet I have no idea on how to do this..

 

Please can someone help me achieve this?

Are there any online tutorials that teach this 'simple' CMS or could someone here help me step by step on how to do this?

Link to comment
Share on other sites

I gather you have knowledge of databases already as you've mentioned them.

 

If you create a simple table for the page you want to be editable with fields for each piece of editable content e.g image1, title, body text

 

Then create a record within this table with the information defined.

 

You can then create a form in PHP, that gets this record from the table, then when you submit the form it simply updates the record.

 

This would be a start if you understand how to do that...then it would just remain to secure the page behind a login which i;m sure there are numerous tutorials on the web for.

 

You want to look at using MySQL with PHP, possibly with the aid of PHPMyAdmin to simplify creating the table and records.

 

Regards,

Scott

Link to comment
Share on other sites

just a suggestion...

... if I was starting from scratch I would look at using CSS for layout etc rather than using tables...since it's only one page it should not be too much trouble to test on all the popular browsers and once it's done the content is easy to edit and your site/code should be easy to validate....

Link to comment
Share on other sites

slawrence10 > That makes perfect sense to me. Thanks for breaking it down. I do have some knowledge of MySQL databases and some PHP knowledge.

 

Once I have created the database table and added all the records for the main image, content, title ect.. I then need to echo this data out onto the web page. I also need to have forms for each record which updates the database entries if the users edits and submits the form..

 

Question is how can I echo data into a form (text area?) and then when the user submits the form it updates the records in the database? This sounds hard to me.. Are there any tutorials on this? I did a quick google search for 'php form text area echo' / other variations and nothing seems to appear. Is there a known saying for what I am trying to search for?

 

 

rhock_95 > course im using see and no tables.. I think you got confused when slawrance10 said table as in a database table..

Link to comment
Share on other sites

I would advise going through a good beginners book such as Sam's Teach Yourself PHP/MYSQL in 24 hours - it will give you a reasonable understanding of PHP/MYSQL and you will learn everything you need to do this through practical examples. You can skim the early stuff and get to the database part quickly.

Link to comment
Share on other sites

Question is how can I echo data into a form (text area?) and then when the user submits the form it updates the records in the database? This sounds hard to me.. Are there any tutorials on this? I did a quick google search for 'php form text area echo' / other variations and nothing seems to appear. Is there a known saying for what I am trying to search for?

Link to comment
Share on other sites

  • 4 weeks later...

actually is easy ;)

first make a query that select what you need from DB,then echo it using

<?=$your_variable_name?>

or

<?php echo $variable_name; ?>

 

Ok I have some PHP that gets data the database contact_table:

<?php
$query  = "SELECT name, subject, message FROM contact_table";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
    echo "Name :{$row['name']} <br>" .
         "Subject : {$row['subject']} <br>" .
         "Message : {$row['message']} <br><br>";
}
?>

 

How do I echo this info using <?php echo $variable_name; ?> ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.