Hi,
I have a question about the following:
When a user clicks on a link in my index.html,
I want the corresponding URL to be selected from a database,
and to be put into the address-bar of a new opening window.
the db consists of column ID and column URL(text)
Sounds simple right ? But I have a lot of difficulty doing this.
First of all, the tag in the index.html looks like this now:
<a href="http://localhost/data_out.php3?ID=2">name_of_link</a>
Then data_out.php3 :
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("testdatabase",$db);
$sql= "select * from links where ID = ?????";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$url = $row["url"];
?>
and redir.php3 :
<?php
header("location:$url");
exit;
?>
So how do I get the ID=2 from the index.html to the data_out.php3 ?
And how do I get $url from data_out.php3 to redir.php3 ?
Can anyone help me with this or give me a clue ?
Best Regards,
Peter