...

View Full Version : Basic Formmail PHP Help Needed!



alisacki
11-09-2007, 12:26 AM
I have a formail php script, and need it to redirect to: www.gowoburn.com/join/1 . I have tried the hidden value redirect option, as you can see below, but when I click submit, it e-mails the form, but the url of the redirect page it goes to is the .php formail file itself. Any ideas on what I am doing wrong?

<INPUT TYPE="HIDDEN" NAME="redirect" VALUE="http://www.gowoburn.com/join/1/">

<?php
$name=addslashes($_POST['name']);
$email=addslashes($_POST['email']);
$BusinessName=addslashes($_POST['BusinessName']);
$Address=addslashes($_POST['Address']);
$City=addslashes($_POST['City']);
$Phone=addslashes($_POST['Phone']);
$Fax=addslashes($_POST['Fax']);
$Logo=addslashes($_POST['Logo']);
$sun=addslashes($_POST['sun']);
$mon=addslashes($_POST['mon']);
$tues=addslashes($_POST['tues']);
$wed=addslashes($_POST['wed']);
$thur=addslashes($_POST['thur']);
$fri=addslashes($_POST['fri']);
$sat=addslashes($_POST['sat']);
$NoHours=addslashes($_POST['NoHours']);
$aboutus=addslashes($_POST['aboutus']);
$NoAbout=addslashes($_POST['NoAbout']);
$products=addslashes($_POST['products']);
$NoProducts=addslashes($_POST['NoProducts']);
$coupons=addslashes($_POST['coupons']);
$NoCoupons=addslashes($_POST['NoCoupons']);
$comments=addslashes($_POST['comments']);
$redirect=addslashes($_POST['redirect']);

// you can specify which email you want your contact form to be emailed to here

$toemail = "info@gowoburn.com";
$subject = "Business Registration - 1 YEAR";

$headers = "MIME-Version: 1.0\n"
."From: \"".$name."\" <".$email.">\n"
."Content-type: text/html; charset=iso-8859-1\n";

$body = "Business Name: ".$BusinessName."<br>\n"
."Contact Name: ".$name."<br>\n"
."Address: ".$Address."<br>\n"
."City: ".$City."<br>\n"
."Phone: ".$Phone."<br>\n"
."Fax: ".$Fax."<br>\n"
."Email: ".$email."<br>\n"
."Logo Source: ".$Logo."<br>\n"
."Sunday: ".$sun."<br>\n"
."Monday: ".$mon."<br>\n"
."Tuesday: ".$tues."<br>\n"
."Wednesday: ".$wed."<br>\n"
."Thursday: ".$thur."<br>\n"
."Friday: ".$fri."<br>\n"
."Saturday: ".$sat."<br>\n"
."Do Not Include Hours: ".$NoHours."<br>\n"
."About Our Company: ".$aboutus."<br>\n"
."Do Not Include About Us: ".$NoAbout."<br>\n"
."Products: ".$products."<br>\n"
."Do Not Include Products: ".$NoProducts."<br>\n"
."Coupons: ".$coupons."<br>\n"
."Do Not Include Coupons: ".$NoCoupons."<br>\n"
."Additional Comments: ".$comments;

if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
{
echo "That is not a valid email address. Please return to the"
." previous page and try again.";
exit;
}


?>

Thanks

Inigoesdr
11-09-2007, 01:18 AM
If the script you're using already provides this functionality then you'll have to post that script. Otherwise you can't use an input to do a redirect by itself. You have to use a meta tag or PHP's header() (http://php.net/header) function. If you use the header() function you can't have any output before it.

alisacki
11-09-2007, 01:23 AM
You'll have to excuse me.. But what you just posted,Inigoesdr, may have been in a foreign language. Could you "dumb it down" so to speak please.

Inigoesdr
11-09-2007, 01:28 AM
you can't use an input to do a redirect by itself. You have to use a meta tag or PHP's header() (http://php.net/header) function.

Google "meta redirect" to see more about the meta tag.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum