Conf1 Posted June 25, 2015 Share Posted June 25, 2015 Im creating simple blog I created admin login, page for inserting new post and other..Now, I have in database:id titleshort-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 Quote Link to comment https://forums.phpfreaks.com/topic/297021-simple-blog-help/ Share on other sites More sharing options...
maxxd Posted June 25, 2015 Share Posted June 25, 2015 What have you tried so far? Show us what code you've tried and we can guide you from there. Quote Link to comment https://forums.phpfreaks.com/topic/297021-simple-blog-help/#findComment-1514894 Share on other sites More sharing options...
cyberRobot Posted June 25, 2015 Share Posted June 25, 2015 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. Quote Link to comment https://forums.phpfreaks.com/topic/297021-simple-blog-help/#findComment-1514895 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.