Adding a new page

This is a discussion on "Adding a new page" within the PHP Forum section. This forum, and the thread "Adding a new page are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 8th, 2008, 09:01
crackafaza's Avatar
Resources Team
Join Date: Jun 2007
Location: UK
Posts: 453
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via MSN to crackafaza
Adding a new page

Hi all

I am creating my own personal CMS at the moment, but I am having difficulty at one of the tasks.

I want the CMS to be able to create a new page, how do I go about doing this? Any tutorials out there?

And what database fields are needed, if any?

Thanks
Cracka
__________________
Check out my Portfolio cfdesignz.co.uk and my blog at blog.cfdesignz.co.uk
Reply With Quote

  #2 (permalink)  
Old Feb 8th, 2008, 09:27
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Adding a new page

1. Make a database tabe for "Pages".
2. Create fields such a Title, body, by, time, etc.
3. When you want to add a new page, just run a INSERT query!
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Reply With Quote
  #3 (permalink)  
Old Feb 8th, 2008, 09:39
crackafaza's Avatar
Resources Team
Join Date: Jun 2007
Location: UK
Posts: 453
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via MSN to crackafaza
Re: Adding a new page

Hi

Thanks for the quick reply.

What are the exact fields in my database then? or does all this depend on what you are doing with the website?

What are the properties I need for each fields, such as varchar? etc!
Any help would be greatly received

Thanks

Cracka
__________________
Check out my Portfolio cfdesignz.co.uk and my blog at blog.cfdesignz.co.uk
Reply With Quote
  #4 (permalink)  
Old Feb 8th, 2008, 10:25
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Adding a new page

What field of what type is your choice. But remember the auto-incrementing field should be INT(integer) type, else it returns an error!
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Reply With Quote
  #5 (permalink)  
Old Feb 8th, 2008, 10:27
crackafaza's Avatar
Resources Team
Join Date: Jun 2007
Location: UK
Posts: 453
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via MSN to crackafaza
Re: Adding a new page

Sorry for not understanding!
But could you please rephrase, because I don't understand!

Sorry!
__________________
Check out my Portfolio cfdesignz.co.uk and my blog at blog.cfdesignz.co.uk
Reply With Quote
  #6 (permalink)  
Old Feb 8th, 2008, 10:53
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Adding a new page

In general, you would need following fields:
1. id - integer
2. title- varchar
3. date and time- varchar
4. by -varchar
5-body- text
and so on!
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Reply With Quote
  #7 (permalink)  
Old Feb 8th, 2008, 15:47
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: Adding a new page

Okay this should help, run this SQL query to create a table.
Code: Select all
create table pages (
id INT(50) not null auto_increment,
title VARCHAR(50) not null,
date int(13) not null,
user varchar(35) not null,
pagetext TEXT not null
)
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #8 (permalink)  
Old Feb 8th, 2008, 22:08
JustinStudios's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: USA
Posts: 406
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JustinStudios
Re: Adding a new page

Of course.. you can do this without using a database as well... Personally I steer clear of databases as much as possible because I'd rather it be there permanently.

You can do this by using PHP's file system. HERE is some good stuff on it.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding More Images crackafaza PHP Forum 0 Jan 3rd, 2008 13:18
Adding a new page...quick way to add to navigation bar? jotto Starting Out 11 Sep 23rd, 2007 17:05
Adding a calendar? Stefan83 Website Planning 1 May 8th, 2007 19:18
Adding music to a Web Page Towbar Introduce Yourself 4 Mar 12th, 2006 17:38


All times are GMT. The time now is 06:06.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43