lcot Posted June 17, 2013 Share Posted June 17, 2013 Hello, Could someone help me out? I would like to simplify my life by providing a news page where I can simply have a template php doc with a blank content area that is filled by data from my news article. Rather than making a new page for every article I publish, I would like to be able to click a link that fills in the data from another php file with the article in. By this I mean so the domain is something like this: > domain.com/news.php?article1 rather > than /news/article1.php How can I go about this or where shall I go to read up about something like this. I was thinking of heading to a cms, however taking the time to learn to template my website just for one news page to regularly update seems a little too much effort than it's worth. I would rather not have to create a new page every time I add an article. I would simply just like to add a new template php file, that I can call upon to display the relevant information on a common news page. My problem is, I am learning at this moment and I do not know where to start. Any advice will be more than welcome! Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/279253-php-news-article-page-info-grab-from-template/ Share on other sites More sharing options...
Irate Posted June 17, 2013 Share Posted June 17, 2013 Start with a script that grabs all your recent articles via SQL. Quote Link to comment https://forums.phpfreaks.com/topic/279253-php-news-article-page-info-grab-from-template/#findComment-1436347 Share on other sites More sharing options...
lcot Posted June 17, 2013 Author Share Posted June 17, 2013 I am not using SQL as I have no cms and no forms to input into a database. I am trying to make this website usable for other users less experienced than me, but without using a cms like joomla. Only 2 parts of the website want to have variable content. Would you recommend I use SQL and if so, how shall I go about it? Quote Link to comment https://forums.phpfreaks.com/topic/279253-php-news-article-page-info-grab-from-template/#findComment-1436349 Share on other sites More sharing options...
ginerjm Posted June 17, 2013 Share Posted June 17, 2013 ok - you have a site available to you, but no sql database to use. Hmmm. You could easily create a script that browses a folder containing your articles - text files I presume, or pdfs perhaps. This script can then build a small paragraph of text, say the first 100 chars, from each article/file. The script finishes by creating an html page containing all those paragraphs in a grid perhaps and displays it. Now the user clicks on a "read more..." button and your script then builds a different page with all the text of that specific article in one textarea/div/paragraph or whatever. At the bottom you have a return button that takes you back to the previous page. Sound doable? Quote Link to comment https://forums.phpfreaks.com/topic/279253-php-news-article-page-info-grab-from-template/#findComment-1436386 Share on other sites More sharing options...
lcot Posted June 19, 2013 Author Share Posted June 19, 2013 This does sound doable yes. I do however have a news article page template I would like to use and to simply fill in the variables from whichever news article php file it has been clicked from. All the variables are common so don't change between articles. I believe a GET function may be useful here but I am not entirely sure how to implement this.. Quote Link to comment https://forums.phpfreaks.com/topic/279253-php-news-article-page-info-grab-from-template/#findComment-1436920 Share on other sites More sharing options...
ginerjm Posted June 19, 2013 Share Posted June 19, 2013 Get or post does not matter. U need to think some more Quote Link to comment https://forums.phpfreaks.com/topic/279253-php-news-article-page-info-grab-from-template/#findComment-1436937 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.