Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

php redirect to a variable url

Codes here !

Moderators: macek, egami, gesf

php redirect to a variable url

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

Hi,
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();
}
antoniscy
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Jan 09, 2013 9:31 pm

Return to mySQL & php coding

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.