This is what I am using so far:
<?
$hostname="localhost";
$user="username";
$password="password";
$usertable="links";
$dbname="database";
mysql_connect($hostname, $user, $password) or die("Could not connect");
mysql_select_db($dbname) or die("Could not select db $dbname");
$sql = "SELECT www from the_table where id=$id LIMIT 1";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$url=$row['www'];
header("Location: $url");
exit();
?>
I get this message:
Warning: Supplied argument is not a valid MySQL result resource in /basedirectory/test.php on line 13
Warning: Cannot add header information - headers already sent by (output started at /basedirectory/test.php:13) in /basedirectory/test.php on line 17
I'm very new at PHP, but I was studying the code and have a few questions. When searching, it only searches the database. What if I want it to search a particular table. As you can see, I added a variable $usertable to the code.
Also, does using header("Location: $url"); simply redirects to the www address? I want to come out like what phpbuilder.com has.
At last, what exactly do you call this process? Dynamic links?