Jump to content

Simple blog help


Conf1

Recommended Posts

Im creating simple blog

 

I created admin login, page for inserting new post and other..

Now, I have in database:

id

title
short-text

long-text
 

And now, i want to display on index.php (homepage) only Title and short-text, then on press button to go on post page and show only title and long-text

 

But all posts to show by IDs

 

I have tried, but I failed, i dont know how to do it.. Just give me some ways to do it

Link to comment
https://forums.phpfreaks.com/topic/297021-simple-blog-help/
Share on other sites

All it seems like you would need to do on the home page is query the database for id, title and short-text. Then loop through the results and display the title, short text, and a link to the full post which would pass the id through a GET variable.

 

Then on the page that displays the post, you would read the GET variable with $_GET and query the database again. But this time you would get the title and long-text where the id is equal to the passed GET variable. Then you just display the post.

Link to comment
https://forums.phpfreaks.com/topic/297021-simple-blog-help/#findComment-1514895
Share on other sites

Archived

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

×
×
  • Create New...

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.