Dynamic Form Redirection

Discussion in 'Programming' started by saahil, Dec 19, 2007.

  1. #1
    Hi, I am a complete newbie in javascript and php, but I am trying to redirect a user based on their submission in a two field form. I am trying to redirect the user to a different site based on their email address. ie redirect them to:

    http://thissite.com/[the user's email here], but the only problem is that I am submitting this form to a third party website, so I have no control of the posted variables. Is there any way to do this.

    I have currently tried to put in js in the redirect value of the form, as well as calling a js function to return the url of the form, but I dont know how to do this. Is this possible? or is the only way to do this through post variables?

    Thanks in advance,

    I have pasted my code:
    <script type="text/javascript" src="optin/textfield.js"></script>
    <div id="squeezebox">
    <form method=post action="http://app.icontact.com/icp/signup.php" name="icpsignup" accept-charset="UTF-8" onsubmit="return verifyRequired();" >
    <input type=hidden name=redirect value="return redirect();" />
    <input type=hidden name=errorredirect value="http://www.icontact.com/www/signup/error.html" />
    <script language=javascript>
    function redirect(){
    return "http://www.lynxtrack.com/afclick.php?o=1220&b=pdmfsr81&p=18327&l=2&e=(document.icpsignup["fields_email"].value)";}
    </script>
    <script language=javascript>
    function verifyRequired() {
    if (document.icpsignup["fields_email"].value == "") {
    document.icpsignup["fields_email"].focus();
    alert("The Email field is required.");
    return false;
    }


    return true;
    }
    </script>
    <div id="SignUp">
    <table width="199" class="signupframe" border="0" cellspacing="0" cellpadding="5">
    <tr>
    <td width="189" align=right valign=top>
    <div align="left">
    <input type= text name="fields_email" id="email" value="Email" onfocus="clearText(this);" onblur="putText(this);" />
    </div> </tr>
    <td valign=top align=right>
    <div align="left">
    <input type= text name="fields_fname" id="name" value="First Name" onfocus="clearText(this);" onblur="putText(this);" />
    </div> </tr>
    <input type=hidden name="listid" value="9029">
    <input type=hidden name="specialid:9029" value="O9W7">

    <input type=hidden name=clientid value="194108">
    <input type=hidden name=formid value="770">
    <input type=hidden name=reallistid value="1">
    <input type=hidden name=doubleopt value="0">
    <TR>
    <TD height="217"><input name="submit" type="image" src="optin/button.gif" border="0" id="button" /></TD>
    </TR>
    <TR>
    <TD><div align="right"><span class="style3">We value your privacy and we will never sell your email! </span></div></TD>
    </TR>
    <TR>
    <TD><div align="right"><img src="http://regionhell.files.wordpress.com/2007/10/xbox360black.jpg" width="175" height="199" /></div></TD>
    </TR>
    </table>
    </div>
    </form>
     
    saahil, Dec 19, 2007 IP