jhondoe144 Posted December 8, 2010 Share Posted December 8, 2010 I got a question regarding a news website content that i want to make ! my question is how do i call my contents without using a lot of page? i explain let's say i got 10 news how do i put this 10 news in different pages without using 10 pages ? ex: you can see some links having a number like this http://bbc.uk/news/murder_case-12 then the next page got http://bbc.uk/news/finance-13 the title and the number id change but the page news doesnt change thanks for your answer. Quote Link to comment https://forums.phpfreaks.com/topic/221008-how-to-create-dynamic-pages-for-a-news-content-website/ Share on other sites More sharing options...
Adam Posted December 8, 2010 Share Posted December 8, 2010 Those type of 'search engine friendly URLs' use the "mod_rewrite" Apache module (or Windows equivalent), to rewrite the URLs to pass in the values as parameters. For example if you have "example.com/page/my-page", the URL could be re-written to "example.com/page.php?name=my-page". The value is then retrieved within the PHP script (look into the $_GET and $_POST super globals) and the database is queried for a page with the name "my-page". If found the contents are retrieved are then 'dynamically' displayed within the page, to give the 'illusion' of multiple pages. Quote Link to comment https://forums.phpfreaks.com/topic/221008-how-to-create-dynamic-pages-for-a-news-content-website/#findComment-1144408 Share on other sites More sharing options...
jhondoe144 Posted December 8, 2010 Author Share Posted December 8, 2010 Thanks a lot it is exactly what i was looking for but you know i got this php script with pagination when i get my contents from my databases (mysql) with the script like (SELECT Title, News, Author , Date FROM eetc..) i realise that i also need some kind of link for each content so people will be able to click on it and be directly redirect to the full content !! i m just a beginer in php and i m kind of looking for script all over the net i understand and know our to manipulate them so i can use them !! Quote Link to comment https://forums.phpfreaks.com/topic/221008-how-to-create-dynamic-pages-for-a-news-content-website/#findComment-1144447 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.