let´s say that I have a url that is parametrized to redirect to other url.
example:
http://XxxXX.net/redirect.php?param1={param1}¶m2={param2}¶m3={param3}¶m4={param4}
and I have the following in redirect.php
<html><head>
<script>
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, null])[1] || ''
);
}
</script>
<script>
var param1 = getURLParameter('param1');
var param2 = getURLParameter('param2');
var param3 = getURLParameter('param3');
var param4 = getURLParameter('param4');
var url = 'http://xxxx.xxxxx.net/yyyy/'+param1+'?param2='+param2+'¶m3='+param3+'¶m4='+param4';
</script>
</head>
<?php
header('Location: url');
?>
<body>
</body></html>
now, the idea is that the parameters that comes from the first url calling redirect.php works to fill what I want that recirect.php do.
to then redirect to a dynamic url based on the parameters received.
is this possible?
maybe there is something wrong in my code, please help me.