In my page I have a table and I insert data into it from my DB with PHP. There are links in each row in the table. Each link directs the user to corresponding page. But these pages are like an exact copy of each other with just a small difference. A word.
Now that's stupid, to create bunch of pages for each link. Then change just a single word in them. Instead I want to create a single page. Post the data from the main page (in the url) and get the data (from url?) in the target page and do stuff. Well, I should just show do code:
<td class="align-left">
<a href="artist.php?artist=<?php echo $row['Link'] ?>"><?php echo $row['Name'] ?></a>
</td>
This is the row I'm talking about. This loops through the DB and $row['Link']
changes every iteration. Generated code would look like this:
<td class="align-left">
<a href="artist.php?artist=3doorsdown">3 Doors Down</a>
</td>
artist.php
page includes this code at the top:
<?php include('vars/3doorsdown.php'); ?>
This 3doorsdown.php
page includes some variables to be used in the page. What I want to do is get the 3doorsdown
from the url (artist.php?artist=3doorsdown
) and put it in the target page. Like this:
<?php
$postData = /*parse url and get data */;
include('vars/' .$postData. '.php');
?>
I don't know how to post and get data from url in php. So I need few pointers.