The following statement doesn't seem to work. I am not getting any error messages either.
header("Location: /home/shaliu/Projects/Nominatim/website/search.php?q="+$query);
I am using file_put_contents() in search.php file.
Is there a way to figure out what could be wrong?
change this:
+$query
to this:
.$query
Because:
+ is the concatenation operator for JavaScript, where as . is the concatenation argument for php
Also, the path you are sending seems to be incorrect. The parameters inside the header function should be a complete web address, for example starting with http
:
header('Location: http://www.example.com/');
While your answer is using a local file path: "Location: /home/shaliu/Projects/Nominatim..."
.
Please try:
You can use:
header("Location: http://www.example.com/search.php?q=".$query);
exit();
Or if your search.php file is on root directory:
header("Location: /search.php?q=".$query);
exit();
It may help you.
put error_reporting(E_ALL);
use relative path.
change this with
header("Location: /home/shaliu/Projects/Nominatim/website/search.php?q="+$query);
In php for concatenation use ".","+" is used in javascript not in php
header("Location: /home/shaliu/Projects/Nominatim/website/search.php?q=".$query);
Please make Your path correct for file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With