I'm trying to create a dynamic header redirect based on a query string variable but I can't get the header function to accept a variable. My code looks like this...
<?php
$id=$_GET['id'];
include('db.php');
$conn = db_connect();
$query="select * from florists where florist_id=$id";
$result= mysql_query($query, $conn) or die('Error, this query failed');
$array=mysql_fetch_array($result);
$url=$array['aff_link_redirect'];
//echo $url;
header( 'Location: $url' ) ;
?>
$url is the url I want to redirect to. Any help is much appreciated. You can probably see what I'm trying ot do. If there's a better way, please let me know.
Thanks,
Scott