Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.