Jump to content

How to create dynamic pages for a news content website ?


jhondoe144

Recommended Posts

 

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 !! 

Link to comment
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.