php redirect to a variable url

Codes here !

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Wed Jan 09, 2013 9:31 pm

php redirect to a variable url

Postby antoniscy » Wed Jan 09, 2013 9:46 pm

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');

Return to “mySQL & php coding”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests