Well, php doesn't {exactly} create links. After all, links are an HTML thing.
So, what is your question exactly?
You could:
echo "<a href=\"example.com/index.php?id=Link\">";
... but, as I said, what's the point, as it's just using PHP to echo some HTML to the browser.
Now, if the "id" variable above was constructed from, say, a database, then there would be some maneuvering behind the scenes prior to the presentation of the HTML to the browser.
But I'm not sure exactly what to tell you, since your question didn't exactly specify that.
Here's a short snippet from a project in continual development here:
<?php
if ($_GET['type']=="prospects") {
$tablename="prospects";
$nomen="Prospects";
$nome="Prospect";
$prospectstr="?type=prospect";
} else {
$tablename="custinfo";
$nomen="Customers";
$nome="Customer";
}
$PageTitle="Select $nomen to Delete/Edit";
include 'cohead.html';
$sql="select custid from $tablename order by custid";
$result=mysql_query($sql);
if (!$result) {
CoHead("Error!");
echo "No $nomen in database or db error...";
include 'cofoot.html';
}
// edit portion of form
echo "<table><tr><td><font size=4 color=blue><b>Edit $nome</b></font><br><br>Select one<br>\n";
echo "<form action=edit_customer_form.php$prospectstr method=post>\n";
echo "<select name=custid>\n";
$x=0;
while ($row=mysql_fetch_row($result)) {
echo "<option value=\"$row[$x]\">$row[$x]</option>\n";
}
?>
Now, aside from the goofy "old style" HTML in there, this looks at a variable to decide whether we are deleting someone from the customer db or the prospective customer db, and sends the appropriate information to the handler script, so that "edit_customer_form.php" knows which database to use ...
So, the form's action URI/query string were created dynamically.
But what did you really want to know? 🙂