I have a page single-colur.html
and it can take a variety of set query strings as can be seen below:
single-colur.html?id=1
single-colur.html?id=2
single-colur.html?id=3
single-colur.html?id=4
The id
above is referenced to a colour
table which has the following columns:
id
name
content
When people come to single-colur.html
and they request a specific ID, I'd like to get the respective ID from the URL and send an AJAX request to a PHP page which will get the corresponding row from my table based on the ID that is provided, this is currently implemented.
My question is: Is it possible that if someone goes to single-colur.html?id=1
then all the data is fetched and displayed in a new URL based on the name
field which is referenced by the ID e.g. single-colur.html?id=1
points you to a dynamically created file called red.html
and it shows the data from the colour
table for this ID?
My restriction is that I must create the new file dynamically and it cannot be done statically.
EDIT
Currently i have two pages .
1)archive-colour.html
2)single-colour.html
in archive-colour.html
<div>
<a href="single-colour.html?id=1">Red</a>
<a href="single-colour.html?id=2">Green</a>
<a href="single-colour.html?id=3">Blue</a>
</div>
in single-colur.html?id=anynumber
<div class="result">
</div>
In single-colur.html i am doing ajax and fetch details from database using requested id and display in class result .
This is the current process . But what i need is
in single-colur.html?id=anynumber
i have to replace the current page url with colour-name.html
and show the details . [BUT the thing is there is no colour-name.html page in server . ie there is no red.html, green.html,blue.html in server . It have to be virtually created by jquery . ]