Page 1 of 1
Auto Create Pages
Posted: Sun Feb 22, 2009 1:01 am
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
Re: Auto Create Pages
Posted: Sun Feb 22, 2009 1:52 am
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?
Re: Auto Create Pages
Posted: Sun Feb 22, 2009 1:55 am
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.
Re: Auto Create Pages
Posted: Sun Feb 22, 2009 1:57 am
by semlar
I think maybe this should be in
theory and design, since it's not about specific code.
Re: Auto Create Pages
Posted: Mon Feb 23, 2009 3:09 am
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?