Go Back   CP Web Hosting - reseller hosting > Server Scripting > PHP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-28-2007, 09:43 AM
Senior Member
 
Join Date: Mar 2007
Posts: 193
Default script that redirect pages

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?
Reply With Quote
  #2 (permalink)  
Old 06-28-2007, 09:44 AM
Senior Member
 
Join Date: Apr 2007
Posts: 347
Lightbulb

Quote:
Originally Posted by stevon View Post
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?

try this script

Code:
<?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>
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:48 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0