Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Basic Formmail PHP Help Needed!

    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

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    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() function. If you use the header() function you can't have any output before it.

  • #3
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Quote Originally Posted by Inigoesdr View Post
    you can't use an input to do a redirect by itself. You have to use a meta tag or PHP's header() function.
    Google "meta redirect" to see more about the meta tag.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •