Well I would not select from the table. You need to tell it a WHERE clause. like SELECT FROM booth WHERE something = something.
From there, make sure the url is formatted in a complete manner. For example, http://www.example.com. So lets say you have a id in the db you want to check and are going to send it to this script via script.php?booth=value. This is purely for me to show you and it may differ:
<?php
include ("../config/config.inc");
// start session and bring in session variables
session_start();
// forward to login page if the session is not valid
if(!isset($s_email))
{
header("Location: logon.htm");
exit();
}
$_GET = array_map('strip_tags', $_GET); //clean up $_GET from HTML data
if(!isset($_GET['booth']) {
//no booth set, lets just die
die('No booth id sent to script. goodbye!');
}
@$link = mysql_connect(SYSTEM,USERNAME,PASSWORD);
if(!$link)
{
echo "Database seems to be down";
exit;
}
mysql_select_db(DATABASE) or die( "Unable to select database");
$query = "SELECT app_link FROM booth WHERE booth='" . $_GET['booth'] . "'";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
$app_link=$row['0'];
header ("Location: " . $app_link);
flush(); //Flush Buffer to Browser so it immediately send headers and you script can continue peacefully.
?>