hello, looking for php form script with redirect pages features. also need to capture data into either txt file or mysql database. when user input info, like name, email, address, etc.. and several options like link1, link2, link3.. and click submit. script need to capture info like name, email, address into mysql database and depends on options that user choose, if link1, need to redirect to url1 if link2, need to redirect to url2 if link3, need to redirect to url3. anybody know this kind a script? I'm looking for free script. Mike
A quick and dirty version : <?php $add=$_POST['add']; $name=$_POST['name']; $redirect=$_POST['redirect']; //connect to db first - this is a sample query mysql_query("insert into users (`id`,`name`) values ('','$name');"); if($redirect) { header('Location: '.$redirect.''); } ?> <form name="form3" action="2.php" method="post"> <table width="95%" border="0"> <tr> <td width="20%">Your Name </td> <td><input type="text" name="name" /></td> </tr> <tr> <td><span class="style6">Redir</span> </td> <td><select name=redirect> <option value="http://www.msn.com" selected>Msn</option> <option value="http://www.google.com">Google</option> <option value="http://www.yahoo.com">Yahoo</option> </td> </tr> <tr> <td colspan="2"><input type="submit" class="formbox" name="Submit" /> <input type="hidden" name="add" value="1"> </td> </tr> </table> </form> PHP:
lol sorry my bad totally disregarded the variable in the header call ;-) good stuff maiahost. here i was throwing in a switch.
No problem at all - hope this helps to the thread starter - By the way this was taken from a website of mine so there's some extra code (class="formbox") etc that you can remove.