I need to write a php page that opens an existing url with customized query strings (essentially redirect).
"http://existingurl?test=pass&newparam=".$_REQUEST['u'];
How to do that?
Like so:
<?php
header('Location: http://existingurl?test=pass&newparam='.urlencode($_REQUEST['u']));
exit();
?>
You just have to use the header function. Don't forget to use urlencode to secure the user input comming from $_REQUEST['u'].
<?php
header('Location: http://existingurl?test=pass&newparam='.urlencode($_REQUEST['u']));
exit();
?>
For more information, next time you can check the official documentation. http://php.net/manual/fr/function.header.php
header('Location: http://existingurl?test=pass&newparam='.urlencode($_REQUEST['u']));
die();
If you perhaps mean that you need to build a Query string with more than one parameter from your POST/GET request you might need to look at http_build_query and append it to the url