Jump to content

Archived

This topic is now archived and is closed to further replies.

mrjameer

creating a php cms

Recommended Posts

i have written a php program with some css template and stored it in mysql db.when i retrieve it from db by writing another program, i see an web page, good.now i want to modify the contents of my web page.

what i want to know is how to get web contents on admin page for editing or updating and how the admin access and modify the contents which are in db.how to display the html code(column values) from different tables in to the textboxes or textares of admin page.

i want to know tutorials or sites which help me in developing my own site instead of using a readymade cms.

please help me,it's urgent


mrjameer

Share this post


Link to post
Share on other sites
Urgency is something that a project this large does not accomodate, this is not a quick fix/job and you will need to spend considerable time planning.

Start with: Everytime something needs retrieving, adding or modifying to your database tables, you'll need to generate and execute an SQL statement.

Share this post


Link to post
Share on other sites
I agree with Jenk, creating a CMS is not something that can be done within a day.

Like Jenk also said take a look at mysql.com (depending on the version of SQL you're runniong if its sql at all)

You'll need to know SELECT, INSERT, UPDATE, and probally DELETE queries at least.  Of course being able to do all that within PHP.

The CMS's that I work on rely on those SQL Commands as well as HTML forms with maybe a bit of javascrpt.    As for a website for a tutorial on making a CMS?  Not sure if there are any.  The books I used to start myself in PHP had at the end of each book a chapter or two on making a really simple CMS.  Books where Visual Quickstart Guide to PHP and Visual Quickpro (?) for Dynamic Websites in PHP and MySQL

Share this post


Link to post
Share on other sites
[quote author=Jenk link=topic=104490.msg416789#msg416789 date=1155733806]
Urgency is something that a project this large does not accomodate, this is not a quick fix/job and you will need to spend considerable time planning.

Start with: Everytime something needs retrieving, adding or modifying to your database tables, you'll need to generate and execute an SQL statement.
[/quote]

hi jenk

i have good knowledge of php/mysql programming.you dont catch my point.urgency in the sense that i need the info about getting html code from db into the textboxes of a form and this form is also retrived from db.iam getting maximum info about creating a cms.but i strucked at this point.i tried some techniques but none of use.if you know anything regarding this issue please help me.

mrjameer

Share this post


Link to post
Share on other sites
Hi,

Think of it as:

mainpage.php  =  select all from the database where the id is equal to the id that you want.
add.php          =  add new id and other info into the database.
edit.php          =  update all the values connected with the id.
delete.php        =  delete all of the values connected with the id.

add.php uploads the info into you database e.g:
[code]
          $title=addslashes($_POST['title']);
$date=addslashes($_POST['date']);
$art=addslashes(nl2br($_POST['art'])); //art is a comments box
$date = date("Y-m-d > H:i:s");

$sql = "INSERT INTO $db_tbl (title, date, art) VALUES ('$title', '$date', '$art')";
$result = mysql_query($sql) or die ("Could not update");
[/code]

edit.php
[code]
          $title=addslashes($_POST['title']);
$date = date("Y-m-d > H:i:s");
$art=addslashes(nl2br($_POST['art']));
$ID=$_POST['ID'];

mysql_query("UPDATE $db_tbl SET title = '$title', date = '$date', art = '$art' WHERE  ID = '$ID' LIMIT 1")
          or die(mysql_error());
[/code]

delete.php
[code]
$ID=$_POST['ID'];
mysql_query("DELETE FROM art WHERE ID =$ID LIMIT 1");
[/code]

mainpage.php
[code]
          $query = "SELECT * FROM $db_tbl WHERE ID='$ID'";
          $result = mysql_query($query) or die ("query 2 failed");
[/code]

Thats basically it. just keep throwing the id values around from page to page.

Share this post


Link to post
Share on other sites

×

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.