473,545 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you put dynamic pages after the url?

1 New Member
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
2 7989
dev7060
639 Recognized Expert Contributor
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 Recognized Expert New Member
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 oversimplificat ion, 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
1473
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 built on the contents of querystrings, so search engines can only be directed to your first index.asp page since the search engine is unable to deduce...
1
1560
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 how to allow visitors to bookmark "pages" when the page is dynamic. I can use Apache-style pseudo-urls to parse out the location of the dynamic...
0
2120
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. After looking at the use of the OutputCache directive and tinkering with it a bit I found its usability.very limited. Think of it: it is okay for...
8
2239
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 to add comments at the bottom of each page, similar to the way the php, mysql, apache manuals work. PUNCHLINE_A:
1
1443
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 same network running Fedora Core 3, Apache 2.0.53 (fedora), PHP 4.3.9. MYSQL Server version is 4.0.27 and it is installed on the Linux machine. I’m...
2
1724
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 something like last.fm/users?username=drpolish just put me in the right direction, tom
1
2178
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 information from a page and after processing return data to page using jQuery. And also need testing object which in a constructor has methods which also...
1
1476
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
1247
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
1319
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 gets generated depending in the values from DB. and i have done url rewriting too like
0
7490
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7682
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7935
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7449
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7780
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6009
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3465
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.