Forum Moderators: open
For example, a call to:
[mywebsite...] needs to transfer to:
[newwebsite...]
*****************************
I have tried using
<script language="javascript"><!--
location.replace("http://newwebsite/startpage.php)
</script>
This transfers control to the desired webpage, but the parameters are not passed.
*****************************
Thank you in advance for any help you can provide.
function getURLParam(strParamName){
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?"));
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
}
return strReturn;
}
Then you can setup your redirect like this:
<script type="text/javascript">
window.location.href='http://newwebsite/startpage.php?parm1='+getURLParam('parm1')+'&parm2='+getURLParam('parm2')+'&parm3='+getURLParam('parm3');
</script>
Hope that helps and you get it figured out.