PHP Form Redirect without Header function

I need help with a PHP form that needs to redirect to a thankyou page upon sending. I have tried the header function but it doesnt work because i have multiple PHP references throughout the page that prevent the header function from working. Is there another way to redirect once the email sends? I am leaving out the rest of the form and functions but this is what i have currently that affects the message sending:
In form page requestquote.php:
<? include('sendemail.php'); if($cmsg) echo"<h1>".$cmsg."</h1>"; else { ?>
In sendemail.php:
mail($recipient, $subject, $formcontent, $mailheader) or die("There was an error in your request. Please go back and try again.");
$cmsg="Thank for you requesting a quote. A Blue Grace Representative will contact you shortly." ;
Thanks,
Ben

I need the thankyou page for conversion tracking on the website, which cant be done with a simple message. Thats what i have currently in the form.
If i put the code in the form action area, will it redirect only upon sending? I want to make sure it goes through the process of validating all the fields and sending the email before it redirects.
Thanks,
Ben

Similar Messages

  • DW cs4 php form redirects to index, not thank you

    Hi, I want my form to go to the thank you page and it goes to the homepage. Thanks for your help in advance!
    Libby
          <td bgcolor="#FFFFFF"><form id="form1" name="form1" method="post" action="/gdform.php">
            <span id="sprytextfield1">
            <label for="Name">Name</label>
            <input name="Name" type="text" id="Name" size="60" />
            <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span>
            <p><span id="sprytextfield2">
            <label for="Address">Address</label>
            <input name="Address" type="text" id="Address" size="58" />
            <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span></p>
            <p><span id="sprytextfield3">
            <label for="City">City</label>
            <input name="City" type="text" id="City" size="35" />
            <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span></p>
            <p><span id="sprytextfield4">
            <label for="State">State</label>
            <input name="State" type="text" id="State" size="6" />
            <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span></p>
            <p><span id="sprytextfield5">
            <label for="Zip">Zip</label>
            <input name="Zip" type="text" id="Zip" size="10" />
            <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span></p>
            <p><span id="sprytextfield6">
            <label for="Name on PayPal Account">Name on PayPal Account</label>
            <input type="text" name="Name on PayPal Account" id="Name on PayPal Account" />
            <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span></p>
            <p>
              <label for="Message">Message</label>
              <textarea name="Message" id="Message" cols="55" rows="5"></textarea>
            </p>
            <p>
              <label for="Submit"></label>
              <input type="submit" name="button" id="button" value="Submit" />
            </p>
            <input type="hidden" name="receipient" id="receipient" />
            <input name="hiddenField" type="hidden" id="hiddenField" value="thankyou.html" />
          </form>

    Gary,
    Here is the code that I have for another site. This file was NOT in the site folder that I am working on now. I just copied one there in case needed.
    Lib
    <?php
        $request_method = $_SERVER["REQUEST_METHOD"];
        if($request_method == "GET"){
          $query_vars = $_GET;
        } elseif ($request_method == "POST"){
          $query_vars = $_POST;
        reset($query_vars);
        $t = date("U");
        $fp = fopen("../data/gdform_$t","w");
        while (list ($key, $val) = each ($query_vars)) {
         fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
         fputs($fp,"$val\n");
         fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
         if ($key == "redirect") { $landing_page = $val;}
        fclose($fp);
        if ($landing_page != ""){
    header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
        } else {
    header("Location: http://".$_SERVER["HTTP_HOST"]."/");
    ?>

  • Need to add senders email address into the subject header of my PHP form (somehow)

    Hello one and all,
    I have a PHP form which is working fine and sends our support team an email with the subject header 'Support'.
    I have been asked to fix this form to include the senders email address into the Subject header so that the support team can filter them easier and reply quicker.
    Any help would be very much appreciated indeed. The form code is below, let me know if you need the whole page.
    Thanks in advance,
    Bradley
    My current form PHP part looks like this: (and the HTML part is below in blue)
    <?php
        if($_GET["action"] == "email")
            $msg = "The following person need support:\n\n";
            $msg = $msg . "First Name: " . $_POST["FirstName"] . " " . $_POST["LastName"] . "\n";
            $msg = $msg . "Tel: " . $_POST["Tel"] . "\n";
            $msg = $msg . "Email: " . $_POST["FROM"] . "\n";
            $msg = $msg . "Support: " . $_POST["Support"] . "\n";
            $msg = $msg . "Model: " . $_POST["Model"] . "\n";
            $msg = $msg . "Comments: " . $_POST["Comments"] . "\n";
            $to ="[email protected]";
            $subject = "Support";
            $from = "From: " . $_POST["FROM"];
            mail($to, $subject, $msg, $emailFrom, $from);
            header("Location:support2.php");
    ?>
    and the HTML part of the fom is like this:
    <form id="form1" name="form1" method="post" action="support.php?action=email">
      <table width="700" border="0" cellspacing="10" cellpadding="10">
        <tr>
          <td valign="middle" class="formtext">*First name:</td>
          <td width="455" valign="middle"><label>
            <input name="FirstName" type="text" class="form-textbox" id="FirstName" />
          </label></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Last name:</td>
          <td valign="middle"><input name="LastName" type="text" class="form-textbox" id="LastName" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Email:</td>
          <td valign="middle"><input name="FROM" type="text" class="form-textbox" id="FROM" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Telephone:</td>
          <td valign="middle"><input name="Tel" type="text" class="form-textbox" id="Tel" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext"> </td>
          <td valign="middle"> </td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Support required:</td>
          <td valign="middle"><label>
            <select name="Support" class="form-dropdown" id="Support">
              <option selected="selected">Please select...</option>
              <option value="Connection Issues">Connection Issues</option>
              <option value="Technical Issues">Technical Issues</option>
              <option value="Furniture Faults">Furniture Faults</option>
              <option value="Other">Other</option>
            </select>
          </label></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">Chair model:</td>
          <td valign="middle"><input name="Model" type="text" class="form-textbox" id="Model" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Please describe your issue:</td>
          <td valign="middle"><textarea name="Comments" rows="5" class="form-textarea" id="Comments"></textarea></td>
        </tr>
        <tr>
          <td valign="middle" class="maintext"> </td>
          <td valign="middle" class="maintext"></td>
        </tr>
        <tr>
          <td valign="middle"> </td>
          <td valign="middle"><label>
            <input name="Submit" type="submit" class="form-submit-button" value="Submit" />
          </label></td>
        </tr>
      </table>
      </form>

    MurraySummers you sir, are an absolute legend! This worked perfect straight off the bat!
    I really apreciate your lightning fast reply!
    Thanks again.
    Bradley

  • Header () Function

    Hi All
    I want to use the header function to redirect to another page after information from a form has been submitted and processed. I can do this without any problem, but I need to pass a variable that is needed by the destination page with the header information.
    I trying to do it using the code below, and it's the part in orange that's causing the trouble!
    if ($done || !isset($gallery_id)) {
    header('Location: http://localhost/photo_gallery/admin/year_view.php?year_id="$year_id"');
    exit;
    What is the correct syntax to enable me to pass the variable? Any ideas would be greatly appreciated.
    Thanks.

    Found the answer.
    if ($done || !isset($gallery_id)) {
    header('Location: http://localhost/photo_gallery/admin/year_view.php?year_id='.$_GET['year_id']);
    exit;

  • PHP form submission Problem

    Dear all,
    PHP enquiry form submission some error is comes
    "Parse error: syntax error, unexpected T_STRING in /home/newtocli/public_html/en45/send_form_email.php on line 11"
    Please help me
    WEBLINK
    PHP goes like this
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>PHP Form</title>
    </head>
    <body><?php
    if(isset($_POST['email'])) {
        // EDIT THE 2 LINES BELOW AS REQUIRED
        $email_to = "[email protected]";
        $email_subject = "Your email subject line";
        function died($error) {
            // your error code can go here
            echo "We are very sorry, but there were error(s) found with the form you submitted. ";
            echo "These errors appear below.<br /><br />";
            echo $error."<br /><br />";
            echo "Please go back and fix these errors.<br /><br />";
            die();
        // validation expected data exists
        if(!isset($_POST['first_name']) ||
            !isset($_POST['email']) ||
            !isset($_POST['telephone']) ||
                        !isset($_POST['company_name']) ||
            !isset($_POST['comments'])) {
            died('We are sorry, but there appears to be a problem with the form you submitted.');      
        $first_name = $_POST['first_name']; // required
        $email_from = $_POST['email']; // required
        $telephone = $_POST['telephone']; // not required
              $last_name = $_POST['company_name']; // required
        $comments = $_POST['comments']; // required
        $error_message = "";
        $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      if(!preg_match($email_exp,$email_from)) {
        $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
        $string_exp = "/^[A-Za-z .'-]+$/";
      if(!preg_match($string_exp,$first_name)) {
        $error_message .= 'The First Name you entered does not appear to be valid.<br />';
      if(!preg_match($string_exp,$company_name)) {
        $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
      if(strlen($comments) < 2) {
        $error_message .= 'The Comments you entered do not appear to be valid.<br />';
      if(strlen($error_message) > 0) {
        died($error_message);
        $email_message = "Form details below.\n\n";
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        $email_message .= "First Name: ".clean_string($first_name)."\n";
        $email_message .= "Email: ".clean_string($email_from)."\n";
        $email_message .= "Telephone: ".clean_string($telephone)."\n";
              $email_message .= "Company Name: ".clean_string($company_name)."\n";
        $email_message .= "Comments: ".clean_string($comments)."\n";
    /* Redirect visitor to the thank you page */
    header('Location:gt.html');
    exit();
    // create email headers
    $headers = 'From: '.$email_from."\r\n".
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers); 
    ?>
    <!-- include your own success html here -->
    Thank you for contacting us. We will be in touch with you very soon.
    <?php
    ?>
    </body>
    </html>

    some error now
    Parse error: syntax error, unexpected T_STRING in /home/newtocli/public_html/send_form_email.php on line 5
    My form like this
    <form name="contactform" method="post" action="send_form_email.php">
                                                                                                                                                <div class="field text">
                                                            <input  type="text" name="first_name" maxlength="50" size="30" value="Name*:">
                                                            </div>
                                                                                                                                                <div class="field text">
                                                            <input  type="text" name="email" maxlength="80" size="30" value="E-mail*:">
                                                           </div>
                                                                          <div class="clear"><!-- --></div>
                                                                                                                                                <div class="field text">
                                                            <input  type="text" name="telephone" maxlength="30" size="30" value="Phone.:">
                                                            </div>
                                                                                                                                                <div class="field text">
                                                            <input  type="text" name="company_name" maxlength="50" size="30" value="Company:">
                                                            </div>
                                                                          <div class="clear"><!-- --></div>
                                                                          <div class="field textarea"><div>
                                                                            <textarea  name="comments"></textarea>
                                </div></div>
                                                                          <div class="submit">
                                                                                    <p>* - Required fields</p>
                                                                                    <input type="submit" value="Send" />
                                                                          </div>
                                                                </form>

  • How can I open a url in oracle form 9i without toolbar and menubar

    I want to create a button in my form. When I click on the button it should open url without toolbar and menubar.
    I tried with web.show_document. but I am not able to remove the toolbar and menubar. plus not able to specify width and height. Any way to achieve this.
    Thanks,
    Mansoor

    Dear Frank,
    I have done as follows
    created a form with a button, and in my button pressed event I wrote
    WEB.SHOW_DOCUMENT('javascript:openMyURL("http://192.168.1.34/HELP/ADMF0005.html");', '_Self');
    and in my formsweb.cfg I have the following
    HTMLbeforeForm=<script> function OpenMyURL(page){window.open(page,"myURL","width=700,width=400,top=0,left=0,toolbar=no,menubar=no"); } </script>
    When I click on the button it is coming with toolbar , etc as well as no page found is coming with the following in the address bar.
    javascript:openMyURL("http://192.168.1.34/HELP/ADMF0005.html");
    My html view source comes as below for the form
    <HEAD><TITLE>Oracle9iAS Forms Services</TITLE></HEAD>
    <BODY >
    <script> function OpenMyURL(page){window.open(page,"myURL","width=700,width=400,top=0,left=0,toolbar=no,menubar=no"); } </script>
    <!-- Forms applet definition (start) -->
    <OBJECT classid="clsid:CAFECAFE-0013-0001-0009-ABCDEFABCDEF"
    codebase="/forms90/jinitiator/jinit.exe#Version=1,3,1,9"
    WIDTH="1000"
    HEIGHT="660"
    HSPACE="0"
    VSPACE="0">
    <PARAM NAME="TYPE" VALUE="application/x-jinit-applet;version=1.3.1.9">
    <PARAM NAME="CODEBASE" VALUE="/forms90/java">
    <PARAM NAME="CODE" VALUE="oracle.forms.engine.Main" >
    I am using Forms [32 Bit] Version 9.0.2.7.0

  • PHP Form mail

    I used this script
    http://www.visibilityinherit.com/code/php-form-validation.php
    to produce a form and everything worked fine on my site, which I
    was using for testing. When I transferred over to the client's site
    it doesn't send the email. The error and thank you messages work,
    but no email. As I have heard that some hosts block some php files
    with the name 'formmail' I called it something else.
    I have checked and rechecked all the data and only my email
    address and the URLs for the error and thank you pages had to be
    changed, my email is correct, but still not email.
    Any ideas as to what is happening and how I can get around it
    please?
    Rosalind

    I have been sent the following information and code, but have
    not succeeded in working out where to add it. The code I am using
    is underneath. Many thanks
    - to send emails through our servers you must comply with one
    of the following rules
    a. The sending email must be from your domain
    b. The receiving email must be from your domain
    This account could/should be [email protected]
    - To avoid a wrong use of our scripts by spammers you must
    had a line before you call the “mail” functionality
    ini_set("sendmail_from", " [email protected] ");
    - Please add to the email send code a functionality
    “-f” in the fifth parameter of the function send mail
    - This is the simple configuration of sending emails in php
    <?php
    ini_set("sendmail_from", [email protected]);
    mail($email_to, $email_subject, $email_message, $headers,
    '-f'[email protected]);
    ?>
    my php code is
    <?php
    // Input Your Personal Information Here
    $mailto = '[email protected]' ;
    $from = "FormosaParadise.com" ;
    $formurl = "
    http://formosaparadise.com/correios.php"
    $errorurl = "
    http://formosaparadise.com/formmailerror.php"
    $thankyouurl = "
    http://formosaparadise.com/thankyou.php"
    // End Edit
    // prevent browser cache
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "
    GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    function remove_headers($string) {
    $headers = array(
    "/to\:/i",
    "/from\:/i",
    "/bcc\:/i",
    "/cc\:/i",
    "/Content\-Transfer\-Encoding\:/i",
    "/Content\-Type\:/i",
    "/Mime\-Version\:/i"
    if (preg_replace($headers, '', $string) == $string) {
    return $string;
    } else {
    die('You think Im spammy? Spammy how? Spammy like a clown,
    spammy?');
    $uself = 0;
    $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" :
    "\n" ;
    if (!isset($_POST['email'])) {
    header( "Location: $errorurl" );
    exit ;
    // Input Your Personal Information Here
    $name = remove_headers($_POST['name']);
    $email = remove_headers($_POST['email']);
    $phone = remove_headers($_POST['phone']);
    $comments = remove_headers($_POST['comments']);
    $http_referrer = getenv( "HTTP_REFERER" );
    // End Edit
    if
    (!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i",$email))
    header( "Location: $errorurl" );
    exit ;
    // Input Your Personal Information Here
    if (empty($name) || empty($email) || empty($phone)
    ||empty($comments)) {
    header( "Location: $errorurl" );
    exit ;
    // End Edit
    if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
    header( "Location: $errorurl" );
    exit ;
    if (get_magic_quotes_gpc()) {
    $comments = stripslashes( $comments );
    // sets max amount of characters in comments area (edit as
    nesesary)
    if (strlen($comments) > 1250) {
    $comments=substr($comments, 0, 1250).'...';
    // End Edit
    $message =
    "This message was sent from:\n" .
    "$http_referrer\n\n" .
    // Input Your Personal Information Here
    "Name: $name\n\n" .
    "Email: $email\n\n" .
    "Phone No: $phone\n\n" .
    "Comments: $comments\n\n" .
    "\n\n------------------------------------------------------------\n"
    // End Edit
    mail($mailto, $from, $message,
    "From: \"$name\" <$email>" . $headersep . "Reply-To:
    \"$name\" <$email>" . $headersep );
    header( "Location: $thankyouurl" );
    exit ;
    ?>

  • PHP forms submitted as an attachment rather than email?

    How do I get my PHP forms submitted as an attachment rather than email?
    Meaning, if I set up a form on my website and someone completes and submits it, how can I get the responses as an attachment rather than in email text?
    Much appreciated.
    G

    Hi Gunter
    I have spent so much time on this now.
    I have tried to convert the php to an attached .txt or .csv file.
    Learnt a lot but still can not seem to get the form data to be submitted as an attached file.
    Here are two of my attempts, please assist:
    <?php
    $email=$_REQUEST['email'];
    $firstName=$_REQUEST['firstName'];
    $lastName=$_REQUEST['lastName'];
    //The Attachment
    $cr = "\n";
    $data = "Email" . ',' . "First Name" . ',' . "Last Name" . $cr;
    $data .= "$email" . ',' . "$firstName" . ',' . "$lastName" . $cr;
    $fp = fopen('reservationTest.csv','a');
    fwrite($fp,$data);
    fclose($fp);
    // Mail to
    $email = "myemailaddress";
    //subject
    $subject = "Test Budget reservation";
    //Header
    $headers("Content-type: application/octet-stream");
    $headers("Content-Disposition: attachment; filename=reservationTest.csv");
    $headers("Pragma: no-cache");
    $headers("Expires: 0");
    //Message
    $message = "".
    "Email: $email" . "\n" .
    "First Name: $firstName" . "\n" .
    "Last Name: $lastName";
    mail($email, $subject, $message, $headers);
    ?>
    <html>
    <body>
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <div align="center">Guperman Your Test Message Has Been Submitted</div>
    </td>
    </tr>
    </table>
    </body>
    </html>
    EOD;
    echo "$theResults";
    OR
    <?php
    /* subject and email variables */
    $email = $_POST['email'];
    $lastname = $_POST['lastname'];
    $firstname = $_POST['firstname'];
        $to = 'myemailaddress';
        $emailSubject = 'Test Form';
        $headers = "From: $email\n";
    $message = "A new reservation test.\n
    Last Name</b>: $lastname
    Name</b>: $firstname
    Email</b>: $email
        mail($to,$emailSubject,$headers,$message);
    //open the file and choose the mode
    $fh = fopen("reservationTest.txt", "a");
    fwrite($fh, $email);
    //close the file
    fclose($fh);
    ?>
    <html>
    <body>
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <div align="center">Guperman Your Test Message Has Been Submitted</div>
    </td>
    </tr>
    </table>
    </body>
    </html>
    On both accounts when I test these files I get the following types of messages.
    Warning:  fopen(reservationTest.csv) [function.fopen]: failed to open stream: Permission denied in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 11
    Warning:  fwrite(): supplied argument is not a valid stream resource in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 12
    Warning:  fclose(): supplied argument is not a valid stream resource in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 13
    Fatal error:  Function name must be a string in \\HOSTING\DFS\20\1\9\1\2028751191\user\sites\mywebsite.com\www\reservationTest.php on line 22
    And then to give the .php files permission I left click on the already uploaded files and try and set the permission to 777, but then I get a response like: Setting Access Properties failed for:
    Your assistance is much appreciated. Regards

  • Insert PHP-form into XHTML-div

    Maybe a noobish question but i cannot find the solution on the web...
    I have a XHTML based index.html.
    I use Spry tabbed panels.
    In 1 Panel (Contact Panel) i like to have a email form displayed.
    How do i show my Form.php inside this div?
    I want the Content div to display the php form without putting the php code in the div.
    Header
    Menu
    Content [here do i want to display the form]
    Footer

    Best to use an external PHP page and link the form to it. Something like:
    <form action="php/sendform.php" method="post" name="contactForm" id="contactForm">
    Then lay the form out the way you want in the DIV.

  • Need help with PHP form with checkboxes, radio buttons and file attachment

    Hi guys,
    I'm having a nightmare with this PHP form where a user can fill it in, attach a doc/pdf and submit. After trying to sort it out with previous code I've used, I've stripped it out and think I should just start again in the hope you geniuses can help!
    Here is the HTML of contact.php:
    <form action="" method="post" name="contact" id="contact">
        <p>Job Title:*<br />
        <input name="position" type="text" /></p>
        <p>Nationality:*<br />
        <select name="nationality">
          <option value="">-- select one --</option>
          <option value="Afghan">Afghan</option>
          <option value="Albanian">Albanian</option>
          <option value="Algerian">Algerian</option>
          <option value="Zambian">Zambian</option>
          <option value="Zimbabwean">Zimbabwean</option>
        </select>
        </p>
        <p>Which country are you currently living in?*<br />
        <select name="country">
        <option value="">-- select one --</option>
        <option value="United Kingdom">United Kingdom</option>
        <option value="Afghanistan">Afghanistan</option>
        <option value="Africa">Africa</option>
        <option value="Zambia">Zambia</option>
        <option value="Zimbabwe">Zimbabwe</option>
        </select>
        </p>
        <label class="radio" for="checkRight">Yes/No question?</label><br />
        <input class="radio" type="radio" name="right" value="Yes" /> Yes
        <input class="radio" type="radio" name="right" value="No" /> No
        <input class="radio" type="radio" name="right" value="N/A" /> Not applicable
        <p>Yes/No question?<br />
        <select name="continue">
        <option value="">-- select one --</option>
        <option value="Yes">Yes</option>
        <option value="No">No</option>
        </select>
        </p>
        <p>Select your resorts:<br />
        Resort 1<input name="res1" type="checkbox" value="Resort 1" />
        Resort 2<input name="res2" type="checkbox" value="Resort 2" />
        Resort 3<input name="res3" type="checkbox" value="Resort 3" />
        Resort 4<input name="res4" type="checkbox" value="Resort 4" />
        Resort 5<input name="res5" type="checkbox" value="Resort 5" />
        Resort 6<input name="res6" type="checkbox" value="Resort 6" />   
        </p>
        <p>Don't send form unless this is checked:* <input type="checkbox" name="parttime" value="Yes" /></p>
        <p>Date of arrival: <input name="arrive" id="datepick" /><br />
        Date of departure: <input name="depart" id="datepick2" /></p>
        <script type="text/javascript" src="assets/scripts/datepickr/datepickr.js"></script>
        <link href="assets/scripts/datepickr/datepickr.css" rel="stylesheet">
        <script type="text/javascript">
        new datepickr('datepick');
        new datepickr('datepick2', {
        </script>
        <p>Name:*<br />
        <input name="name" type="text" /></p>
        <p>E-mail:*<br />
        <input name="email" type="text" /></p>
        <p>Telephone:*<br />
        <input name="telephone" type="text" class="ctextField" /></p>
        <p>Upload CV (Word of PDF formats only):<br />
        <input type="file" name="cv" class="textfield"></p>
        <p><input name="submit" value="Submit Enquiry" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
    </form>
    By the way, the date boxes work so excuse the Javascript in there!
    To prevent SPAM I've used a trick where there's a hidden URL field which must be left blank for the form to submit which you can see in the PHP.
    Below is where I'm at with the PHP which is placed above the header of contact.php...
    <?php
    if (array_key_exists('submit', $_POST)) {
        $position = $_POST['position'];
        $arrive = $_POST['arrive'];
        $nationality = $_POST['nationality'];
        $parttime = $_POST['parttime'];
        $depart = $_POST['depart'];
        $name = $_POST['name'];
        $email = $_POST['email'];
        $telephone = $_POST['telephone'];
    $to = "[email protected]";
    $subject = "Recruitment Application";
    $message = $headers;
    $message .= "Name: " . $_POST["name"] . "\r\n";
    $message .= "E-mail: " . $_POST["email"] . "\r\n";
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= 'From: My Website <[email protected]>' . "\r\n";
    $message= "
    $url = stripslashes($_POST["url"]);
    if (!empty($url)) {
    header( 'Location: http://www.go-away-spam-robots.com' );
    exit();
    if (!isset($warning)) {
    mail($to, $subject, $message, $headers);
    header( 'Location: http://www.mywebsite.co.uk/sent.php' );
    ?>
    I would like to make pretty much all the field compulsory so if a field is left empty (other than the hidden URL field), a warning message is displayed next to that field.
    Also I would like the file upload field to attach to the email that is sent to me and have the results come through to me in a table format.
    Can anyone help me get my form working?
    Thank you and I hope to hear from you!
    SM

    Hi Nancy,
    Great stuff, thank you for the reply.
    I've managed to get the Formm@iler working and running as I need it to.
    The only thing I'm struggling with is when the user clicks submit, they are taken to a page of whatever results the form returned but it is just a white background with Times New Roman text.
    How can I have it so the user is taken to the form results in the websites' page layout?
    I tried sending them to a generic 'thank you' page by adding the following code but it just took them there whatever the results of the form so that's no good...! I have a feeling it's a bit more complicated than that...
    header( 'Location: http://www.nofussbus.co.uk/test/sent.php' );
    Thank you for your help!

  • PHP form layout issue

    Hi all, I have a basic php form on a page, it works great,
    and my email recieves the content as required, BUT, when the form
    submits and the page shows the forms content, it throws out my
    layout ocmpletely. My white maincontent dissapears, and the footer
    div is all misaligned, my code is attached. Can anyone help please?
    many thanks

    On Thu, 7 Feb 2008 16:34:22 +0000 (UTC), "simbull"
    <[email protected]> wrote:
    >Thanks for the response gary, I have tried that (and just
    did again), that
    >means the user is not presented with the php output,
    which I do want them to be
    >ideally. Anyhow, that aside, it still throws my layout
    out..?
    Impossible to give you a better answer without knowing what
    you want to
    accomplish, but it sounds like your layout might be too
    fragile.
    Gary

  • Can you auto-attach files in a PHP form?

    Hi there,
    Have been looking over everywhere for a solution to my problem. I am going to try and be as clear as I can about the problem.
    I have had some experience making simple PHP forms that let the user put their name, email, subject and body text and send it in an email using the form.
    But for a project I am currently undertaking - the client has requested a form that will pre-attach a particular document to the email when it is sent. All the user has to do is input the email address of the adressee and their name/email address and all the other fields are custom made (i.e. subject, body text) - and the email will be sent to the selected recepient with the file already attached.
    I was envisaging the PHP script would collect the reference for a file that is already sitting on the web server and attach it in the function.
    Is there anyway to do this? Because if it isn't I may as well tell the client to go and use outlook - because the web form will really have no purpose.
    Thanks in advance

    Hi have proceeded along the path of inserting links
    into PHP generated email but I am having trouble in outputting the body message in HTML - All I get out
    in the output email is the HTML tags with the text (plain text).
    Did some research and found out that I have to determine the content type/charset.
    I have tried to do this in my PHP but to no avail. Also I am not getting the email or name of the sender in the email that is generated....
    Anyway, there is the PHP code (and it's not that tight but it works):
    AND SOME DEFAULT TEXT THAT WILL CONTAIN LINKS TO NECESSARY FILES TO DOWNLOAD:
    link to PDF '.$field_message; $headers = 'From: '.$cf_yremail."\r\n"; $headers .= 'Reply-To: '.$cf_yremail."\r\n"; /* If your e-mail is not valid show error message */ if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $mail_to)) { ?>
    Any help on this would be much appreciated....
    Thanks

  • Code issue in php form - submit button not sending email

    Created a form that was originally supposed to open up to 2 pages depending on what was clicked. Clear would send you to an error page, and submit would send you to a thank you page. Decided that was a waste and so did not create the html pages. BUT, wanted the form info for the contact page.
    Here is the issue: it will not submit when submit is clicked. It clears when you click clear, but there's no email coming from the site via submit.
    Do I need to edit the php form code if I don't want the other pages? I've looked at what I have but I don't see if there is a form error or anything here. Here is the code for anyone who wants to have a look. Thanks in advance.
    <?php
    // get posted data into local variables
    $EmailFrom = "EMAIL FROM WEP PAGE - CONTACT - ";
    $EmailTo = "[email protected]";
    $Subject = "EMAIL FROM jennylowhar.com - CONTACT -";
    $name = Trim(stripslashes($_POST['name']));
    $telephone = Trim(stripslashes($_POST['telephone']));
    $email = Trim(stripslashes($_POST['email']));
    $comments = Trim(stripslashes($_POST['comments']));
    // validation
    $validationOK=true;
    if (Trim($name)=="") $validationOK=false;
    if (Trim($email)=="") $validationOK=false;
    if (!$validationOK) {
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
      exit;
    // prepare email body text
    $Body = "";
    $Body .= "name: ";
    $Body .= $name;
    $Body .= "\n";
    $Body .= "telephone: ";
    $Body .= $telephone;
    $Body .= "\n";
    $Body .= "email: ";
    $Body .= $email;
    $Body .= "\n";
    $Body .= "comments: ";
    $Body .= $comments;
    $Body .= "\n";
    // send email
    $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
    // redirect to success page
    if ($success){
      print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou.html\">";
    else{
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.php\">";
    ?>

    I'm confused by that, but I know this works.
    $fname=STRIPSLASHES($_POST['fname']);
    $lname=STRIPSLASHES($_POST['lname']);
    $title=STRIPSLASHES($_POST['title']);
    $company=STRIPSLASHES($_POST['company']);
    $street=STRIPSLASHES($_POST['street']);
    $town=STRIPSLASHES($_POST['town']);
    $zip=STRIPSLASHES($_POST['zip']);
    $phone=STRIPSLASHES($_POST['phone']);
    $fax=STRIPSLASHES($_POST['fax']);
    $county=STRIPSLASHES($_POST['county']);
    $phone=STRIPSLASHES($_POST['phone']);
    $email=STRIPSLASHES($_POST['email']);
    $comments=STRIPSLASHES($_POST['comments']);
    $date=STRIPSLASHES($_POST['date']);
    $time=STRIPSLASHES($_POST['time']);
    $location=STRIPSLASHES($_POST['location']);
    $from="$email";
    $to="putemailhere";
    $subject="Submission from Contact Form";
    $msg= "This is a submission from yoururl.com.\n\n"
    . "Clients Name: $fname . $lname \n"
    . "Title: $title\n"
    . "Company Name: $company\n"
    . "Street Address: $street\n"
    . "Town:$town\n"
    . "Zip: $zip\n"
    . "Telephone: $phone\n"
    . "Email Address: $email\n"
    . "Comments: $comments\n";
    mail($to, $subject, $msg, 'From:' .$from);
    PS, go back and edit your origial post and REMOVE your email.
    Gary

  • PHP Form Filtering

    Hey Guys,
    I'm curious as to some of the best solutions to help filter out spamming through a php form.  Should I add captcha?  Is there another way?  I want to be able to filter out the erroneous requests or advertising of selling email lists from the real customers trying to fill out the form.
    Thanks for the help!

    That's what I was more or less looking for; options.  I looked at recaptcha.net and that seems like a viable option.  I don't mind if users have to enter captcha characters.  I'm assuming that filter class is a way to do it without captcha characters.  It sounds like it's mainly coding on the server side that I would have to implement?

  • PHP form to output in PDF

    I was wondering if there is a php function or some type of
    code where you can make a php form and when the user clicks on a
    button it transfers their information to another page which opens
    up and displays it in PDF in the web browser. I remember seeing
    this done under Coldfusion MX, is there something similar for it in
    PHP?

    AdonaiEchad wrote:
    > I was wondering if there is a php function or some type
    of code where you can
    > make a php form and when the user clicks on a button it
    transfers their
    > information to another page which opens up in PDF.
    Look for example at fpdf (
    http://www.fpdf.org/) or ezpdf
    http://www.ros.co.nz/pdf/).
    Leolux

Maybe you are looking for

  • Feature set difference between FI-AR and FI-CA

    Hi, While I am trying to do a comparison analysis between FI-AR/AP and FI-CA for Insurance Industry, I can deduce various facts like FI-CA been developed for transaction extensive industries like telecom/insurance which might often need automated pro

  • Reinstall a MAS purchase... How?

    I deinstalled a MAS purchase and would like to reinstall it. How can I do this? EDIT:  The purchase still shows in the MAS list of purchases even though all files related to the app have been deinstalled (except for 'bom' receipt of course).

  • Can't get JLayeredPane to work

    Hi, I'm trying to use the JLayeredPane as part of a large application, but I can't get a small example to work... What else do I need to set before I can see my JLabel? package views; import java.awt.Dimension; import javax.swing.JFrame; import javax

  • How to go back to firefox 4 lost java, plugins & acrobat in 5 firefox4 worked

    firefox 4 was working just fine. I'm not sure what happened but it updated to 5 and everything quit working - Java, plugins and most annoying Adobe acrobat. I try to watch a movie, ie weather channel, and it says I don't have acrobat so I download it

  • Will there be an Ergotron MX Desk Mount arm for the IPAD 2?

    Having trouble finding a functional AND attractive clamping desk mount for a drafting table (which sits at an incline). The Ergotron is pefect but only made for computer monitors. After having researched this for a couple of weeks, Im here to tell yo