Auto Create Pages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
svgmx5
Forum Newbie
Posts: 3
Joined: Sun Feb 22, 2009 12:51 am

Auto Create Pages

Post by svgmx5 »

So i've created the blog, as well as the archives, the only thing i'm having problems with is i can't figure out is how to create an automatic page creation.

so every time an entry is made it creates a whole new page for that entry in which it can hold the contents as well as the comments. I know how to do it manually, but i don't want that, i want the page to be created automatically

Hopefully i put this in the right section...if not let me know were i can go for this
semlar
Forum Commoner
Posts: 61
Joined: Fri Feb 20, 2009 10:45 pm

Re: Auto Create Pages

Post by semlar »

I don't understand what you mean by this, maybe you could elaborate a little more?

You want to output something into actual files?
svgmx5
Forum Newbie
Posts: 3
Joined: Sun Feb 22, 2009 12:51 am

Re: Auto Create Pages

Post by svgmx5 »

what i'm trying to say is to create something similar to a blog, in which you have the blog posts, and then when you click something like view comments it displays the comments for that entry and the entry itself.
semlar
Forum Commoner
Posts: 61
Joined: Fri Feb 20, 2009 10:45 pm

Re: Auto Create Pages

Post by semlar »

I think maybe this should be in theory and design, since it's not about specific code.
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: Auto Create Pages

Post by mattpointblank »

All you need to do is make a generic page like 'view_blog.php' which contains the basic layout code for your blog. Have a mysql query at the top of the page that loads the data for the page, eg the blog title, comment text, etc. You can tell the page which blog to load by using a URL variable: view_blog.php?blog=1 - you can then access this variable using $_GET['blog'] and put that (after cleaning it up to prevent SQL injection) in your query's WHERE clause. You can then (on a different page) display a list of your blog entries, linking them as shown above. Make sense?
Post Reply