473,325 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How do you put dynamic pages after the url?

1
I am creating a website in PHP with articles, where articles can be added via a form. All data is stored in a MySQL database.

First I made a separate page of each article, eg article1.html, article2.html, ... but then I got a lot of pages.

Now I saw that on other websites the articles are behind the url, eg. https://mywebsite.com/article1

I've tried searching the internet for how they do this, but I'm not sure how to look this up as I don't know what this technique is called.

Do you know what this is called or how they do this?

I had already found things about dynamically generated page and then put the url in the sitemap, but i don't know if this is the right way?
Jan 30 '22 #1

✓ answered by dev7060

I am creating a website in PHP with articles, where articles can be added via a form. All data is stored in a MySQL database.

First I made a separate page of each article, eg article1.html, article2.html, ... but then I got a lot of pages.

Now I saw that on other websites the articles are behind the url, eg. https://mywebsite.com/article1

I've tried searching the internet for how they do this, but I'm not sure how to look this up as I don't know what this technique is called.

Do you know what this is called or how they do this?

I had already found things about dynamically generated page and then put the url in the sitemap, but i don't know if this is the right way?
You may be looking for path parameters or query parameters.

2 7884
dev7060
633 Expert 512MB
I am creating a website in PHP with articles, where articles can be added via a form. All data is stored in a MySQL database.

First I made a separate page of each article, eg article1.html, article2.html, ... but then I got a lot of pages.

Now I saw that on other websites the articles are behind the url, eg. https://mywebsite.com/article1

I've tried searching the internet for how they do this, but I'm not sure how to look this up as I don't know what this technique is called.

Do you know what this is called or how they do this?

I had already found things about dynamically generated page and then put the url in the sitemap, but i don't know if this is the right way?
You may be looking for path parameters or query parameters.
Feb 12 '22 #2
GazMathias
228 Expert 128KB
Hi,

I think you are referring to URL rewriting. In PHP it is common to make use of Apache's mod_rewrite for this functionality.

I won't go into detail here as there are a great many tutorials that can explain it better than I can but a basic explanation of the simple implementation in your question would see a user visiting https://mywebsite.com/article1, but would be translated by the rewrite engine to https://mywebsite.com/index.php?articleid=article1.

The index.php page would then interrogate the article parameter in the query string through $_GET['articleid'] and use it to query and render the article data from the database.

This is an oversimplification, as for for real-world scenarios you must consider secutity and validation. Most frameworks have handlers for parsing this type of parameter that take some care of such filtering for you.

I hope that points you in the right direction.

Gaz
Feb 14 '22 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: only_me | last post by:
Not a coding question as such but highly related to asp/dynamic pages issues : has anyone any suggestions on the following ASP sites are generally (always) of a dynamic nature, pages can be...
1
by: Razzbar | last post by:
I'm creating a site that is all on one page. The navigation of the site is enabled by a hidden iframe that fetches content from the server and re/places it in a div on the page. The problem is...
0
by: Martin | last post by:
Hi. I had a very frustrating afternoon and evening but I have got it all under control now so all of a sudden I am in a good mood. I want to share some insights on output caching with you lot. ...
8
by: Sandy Pittendrigh | last post by:
I have a how-to-do-it manual like site, related to fishing. I want to add a new interactive question/comment feature to each instructional page on the site. I want (registered) users to be able...
1
by: thavaht | last post by:
I recently began drawing dynamic pages using PHP + MYSQL. I’m developing the site on windows XP / Apache 1.3.34 / PHP 5.1.2 as a testing server. My publishing server is on another machine on the...
2
by: tomwans | last post by:
how do websites such as last.fm have dynamic pages when they dont use the standard $_GET url? for example, a dynamic page is generated from last.fm/users/drpolish, which looks alot cleaner than...
1
by: flashadow | last post by:
Who can explain. Can JsUnit test dynamic pages? A site uses Apache Tomcat for the start. A site consists of starting page in which is loaded 4 jsp pages. Functions that need testing take...
1
by: =?Utf-8?B?SklNLkgu?= | last post by:
Search engine; Dynamic pages I was reading a few articles that search engines do not support dynamic pages, is there any reference that talks about how we can overcome this issue?
0
by: heiro | last post by:
hi Everyone, Can you please help me on how to convert dynamic pages to statics web pages like in php without affecting your dynamic page? I'm using CGI Python... Thanks
1
pradeepjain
by: pradeepjain | last post by:
hi, I am developing a website where in all the pages are generated dynamically . like say www.example.com/mobile_rating.php?alias=nokia3310 when ever it gets alias value the page...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.