We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,965 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Seperate Page Posts.

Hey.

I've have been attempting to create a website and I was just wondering something.

On my page's I have post's like this..

<h3>This Post</h3>
<p>Content of post</p>

How do you make it so when I click the title, it will show just that post and then if I want it to, Also show a comment box underneath.
A bit like Tumblr or Wordpress, So when you click the post title, it shows that post plus a comment box.

The only way I can think of is using

<?php include("filename.php")?>

but wouldn't that mean seperate .php files for each post?

Thanks in advance.

3
Contributors
5
Replies
2 Days
Discussion Span
2 Years Ago
Last Updated
7
Views
vmpchris
Deleted Member

Yes, separate your different 'views' into different php files, because that's essentially what you want. When you click the title of a post you want to go to it's standalone 'view' or 'page' with just the post on it, with a comment box as well. What you can do is do a php check to see if the user is on the main page when clicking the link, if they are, then take them to the view that you want (which would be a singular post with a comment box).

papanyquiL
Junior Poster
168 posts since May 2009
Reputation Points: 55
Solved Threads: 18
Skill Endorsements: 0

How would that be done?

Do you have any sample code?


Thanks.

vmpchris
Deleted Member

I would set it up similar to the way wordpress does things. It's very orginized that way. Look through the hierarchy here to get a basic overview of how to arrange your php files. Code samples can also be found there.

papanyquiL
Junior Poster
168 posts since May 2009
Reputation Points: 55
Solved Threads: 18
Skill Endorsements: 0

Wordpress gives you all the options in their configuration panel to display or hide the comment boxes as the part of CMS.

rajarajan07
Nearly a Posting Virtuoso
1,450 posts since May 2008
Reputation Points: 167
Solved Threads: 241
Skill Endorsements: 1

I've already managed to sort it.

Thanks for the reply.

vmpchris
Deleted Member

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0887 seconds using 2.67MB