Jump to content

Location Header Question


Asperon

Recommended Posts

As in, use the double quptes inside the header function:

<?php

$search = 'random';
$location = 'mysite.com/myfile.php?search='.$search; // mysite.com/myfile.php?search=random
header("Location: $location");
?>

 

Strings inside single quotes are treated as literals: you are litterally trying to send the browser to $location - not the value of $location.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.