In your db query, you have where app_link = '$s_app_link', and then you want to redirect to the field result from app_link, is this nescessary? You could just redirect to $s_app_link since it carries the same value.
But, to make things a little more clear for you, you need redirect to the field result, not the sql object, also need to add http:// if it doesn't exists:
PHP Code:
<?php include ("../config/config.inc"); // start this field in a session $s_app_link = $row['app_link']; session_register('$s_app_link'); // validate data // start session and bring in session variables session_start(); @$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 app_link = '$s_app_link' "; $result = mysql_query($query); if(!$result) { echo "Error - Could not get booth information from database."; mysql_close(); exit; } $row = mysql_fetch_object($result); if($row['app_link'] != '') { header('Location: ' . strstr($row['app_link'], 'http://') ? $row['app_link'] : 'http://' . $row['app_link'] ); } ?>
PS - In your above first example, $app_link was never defined so thats why it was redirecting to the root.
__________________
<mgraphic /> - I don't have a solution but I admire the problem.
Last edited by mgraphic; 05-24-2006 at 05:39 PM..
|