I am new to php and i am trying to have visitors redirect to urls saved in my database according to the query. What am i doing wrong?? Please note that the redirect works if it is not a variable, ie a specific url. Beforehand thanks
- Code: Select all
$value1 = $_POST ['town'];
$value2 = $_POST ['type'];
$value3 = $_POST ['beds'];
$url = $_POST ['url'];
$data = mysql_query ("SELECT * FROM properties WHERE town='$value1' AND type='$value2' AND beds='$value3' ") or die (mysql_error());
while($info = mysql_fetch_assoc( $data ))
{
header('Location: $url');
exit();
}

