1

I have problem in redirecting my url.

I have url:-

http://example.com/r/index.php?id=1234

it gives me value of url from database.I store the value of url in $url_link.

On the same page,after db operation.I add the redirect code in body part.

<?php    
header('Location: http://$url_link');    
?>

which doesnt take the value $url_link.

1
  • Going to need to see alot more code than that. Commented Jan 10, 2014 at 12:12

2 Answers 2

3

It should be something like this.

<?php    
  header('Location: http://'.$url_link);    
?>
Sign up to request clarification or add additional context in comments.

Comments

2

Enclose in double quotes.. Variables inside single quotes will not get interpreted.

Do like this...

<?php    
header("Location: http://$url_link");    
?>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.