How to echo-ing decoded url from GET method on php,
i have this link:
localhost/whatsapp?text=Hello%2C%20Who%20are%20U%3F%0AName%3A%20%0AAddress%3A%20%0AAge%3A%20
with this code
$text = $_GET['text'];
header("Location: https://web.whatsapp.com/send?phone=00000000&text=".$text);
but get error
Warning: Header may not contain more than a single header, new line detected in index.php on line
When you retrieve values from $_GET, they are URL decoded. If you want to pass it back, you need to encode it again, so that newlines, spaces and other weird characters gets encoded. Use urlencode($text) for this.
$text = $_GET['text'];
header("Location: https://web.whatsapp.com/send?phone=00000000&text=".urlencode($text));
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