Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'form handling'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. We have been using the following script (based on the book script) to deliver a booking form very successfully for some time. However, just recently occasionally a customer submits a form that is not delivered, despite them coming to the "thank you" confirmation. We do not receive the form, does not go to spam, etc. Despite repeated attempts, these customers cannot send the form successfully, while we receive many other forms without problems. Is there anything in the code that would allow the customer to get through to the "confirmation" part while the "send" is not executed successfully? Or could the only explanation be a problem in the delivery chain rather than our implementation of the form? Any advice would be appreciated, thank you. Our script is: <?php # Script 12.1 - email.php #2 // Check for form submission: if (isset($_POST['submitted'])) { /* The function takes one argument: a string. * The function returns a clean version of the string. * The clean version may be either an empty string or * just the removal of all newline characters. */ function spam_scrubber($value) { // List of very bad values: $very_bad = array('to:', 'cc:', 'bcc:', 'content-type:', 'mime-version:', 'multipart-mixed:', 'content-transfer-encoding:', '#'); // If any of the very bad strings are in // the submitted value, return an empty string: foreach ($very_bad as $v) { if (stripos($value, $v) !== false) return ''; } // Replace any newline characters or link code characters with spaces: $value = str_replace(array( "\r", "\n", "%0a", "%0d", "http://", "www.", "<a", "</a>"), ' ', $value); // Return the value: return trim($value); } // End of spam_scrubber() function. // Clean the form data: $scrubbed = array_map('spam_scrubber', $_POST); // Minimal form validation: if (!empty($scrubbed['accept_conditions'])) { // Create the body: $body = 'Sent At ' . date("H:i:s") . ' on ' . date("d/m/Y") . "\n\nSent By {$scrubbed['contact_name']} {$scrubbed['email']}\n\n-----------------\n\nEXPERIENCE 1\n\nExperience Name: {$scrubbed['experience_name']}\n\nStart Date: {$scrubbed['experience_start']}\n\nEnd Date: {$scrubbed['experience_end']}\n\n\n\nEXPERIENCE 2\n\nExperience Name 2: {$scrubbed['experience_name_2']}\n\nStart Date 2: {$scrubbed['experience_start_2']}\n\nEnd Date 2: {$scrubbed['experience_end_2']}\n\n\n\nPERSONAL DETAILS\n\nPERSON ONE\n\nName: {$scrubbed['one_first_name']} {$scrubbed['one_surname']}\n\nNationality: {$scrubbed['one_nationality']}\n\nDOB: {$scrubbed['one_dob']}\n\nGender: {$scrubbed['one_gender']}\n\nHealth-Diet: {$scrubbed['one_extras']}\n\nInsurer, Policy Number, Expiry date): {$scrubbed['one_ins_co']}, {$scrubbed['one_pol_no']}, {$scrubbed['one_exp_date']}\n\n\nPERSON TWO\n\nName: {$scrubbed['two_first_name']} {$scrubbed['two_surname']}\n\nNationality: {$scrubbed['two_nationality']}\n\nDOB: {$scrubbed['two_dob']}\n\nGender: {$scrubbed['two_gender']}\n\nHealth-Diet: {$scrubbed['two_extras']}\n\nInsurer, Policy Number, Expiry date): {$scrubbed['two_ins_co']}, {$scrubbed['two_pol_no']}, {$scrubbed['two_exp_date']}\n\n\nPERSON THREE\n\nName: {$scrubbed['three_first_name']} {$scrubbed['three_surname']}\n\nNationality: {$scrubbed['three_nationality']}\n\nDOB: {$scrubbed['three_dob']}\n\nGender: {$scrubbed['three_gender']}\n\nHealth-Diet: {$scrubbed['three_extras']}\n\nInsurer, Policy Number, Expiry date): {$scrubbed['three_ins_co']}, {$scrubbed['three_pol_no']}, {$scrubbed['three_exp_date']}\n\n\nPERSON FOUR\n\nName: {$scrubbed['four_first_name']} {$scrubbed['four_surname']}\n\nNationality: {$scrubbed['four_nationality']}\n\nDOB: {$scrubbed['four_dob']}\n\nGender: {$scrubbed['four_gender']}\n\nHealth-Diet: {$scrubbed['four_extras']}\n\nInsurer, Policy Number, Expiry date): {$scrubbed['four_ins_co']}, {$scrubbed['four_pol_no']}, {$scrubbed['four_exp_date']}\n\n\nPERSON FIVE\n\nName: {$scrubbed['five_first_name']} {$scrubbed['five_surname']}\n\nNationality: {$scrubbed['five_nationality']}\n\nDOB: {$scrubbed['five_dob']}\n\nGender: {$scrubbed['five_gender']}\n\nHealth-Diet: {$scrubbed['five_extras']}\n\nInsurer, Policy Number, Expiry date): {$scrubbed['five_ins_co']}, {$scrubbed['five_pol_no']}, {$scrubbed['five_exp_date']}\n\n\nPERSON SIX\n\nName: {$scrubbed['six_first_name']} {$scrubbed['six_surname']}\n\nNationality: {$scrubbed['six_nationality']}\n\nDOB: {$scrubbed['six_dob']}\n\nGender: {$scrubbed['six_gender']}\n\nHealth-Diet: {$scrubbed['six_extras']}\n\nInsurer, Policy Number, Expiry date): {$scrubbed['six_ins_co']}, {$scrubbed['six_pol_no']}, {$scrubbed['six_exp_date']}\n\n\n\nOPTIONAL EXTRAS\n\n{$scrubbed['optional_extras']}\n\n\n\nCLIMATE CARE OR CHARITY DONATION\n\nPerson 1: {$scrubbed['one_charity']}\n\nPerson 2: {$scrubbed['two_charity']}\n\nPerson 3: {$scrubbed['three_charity']}\n\nPerson 4: {$scrubbed['four_charity']}\n\nPerson 5: {$scrubbed['five_charity']}\n\nPerson 6: {$scrubbed['six_charity']}\n\n\n\nCONTACT DETAILS\n\nContact Name: {$scrubbed['contact_name']}\n\nContact Address: {$scrubbed['contact_address']}\n\nContact Town: {$scrubbed['contact_town']}\n\nContact Postcode: {$scrubbed['contact_postcode']}\n\nContact Telephone: {$scrubbed['contact_tel']}\n\nContact Mobile: {$scrubbed['contact_mobile']}\n\nContact Email: {$scrubbed['email']}\n\nNewsletter: {$scrubbed['newsletter']}\n\n\n\nEMERGENCY CONTACT\n\nEmergency Name: {$scrubbed['emergency_name']}\n\nEmergency Telephone: {$scrubbed['emergency_tel']}\n\nEmergency Mobile: {$scrubbed['emergency_mobile']}\n\nPAYMENT INFORMATION\n\nDeposit Total: {$scrubbed['deposit_total']}\n\nDonation Total: {$scrubbed['climate_care_total']}\n\nTotal Amount: {$scrubbed['total_amount']}\n\nPaying By: {$scrubbed['payment_option']}\n\n\n\nOTHER INFORMATION\n\nNotes: {$scrubbed['notes']}\n\nAccept Conditions: {$scrubbed['accept_conditions']}\n\n"; $body = wordwrap($body, 90); // Send the email: mail('OUR EMAIL ADDRESS REMOVED HERE', 'Online Booking Form', $body, "From: {$scrubbed['email']}"); // Print a message: echo 'OUR THANK YOU MESSAGE REMOVED HERE'; // Clear $_POST (so that the form's not sticky): $_POST = array(); } } // End of main isset() IF. ?> <?php if (isset($_POST['submitted'])) { if (empty($scrubbed['accept_conditions'])) { echo '<p class="make_red"><span class="highlighted_text">Please tick the "I accept" box at the bottom of the form to agree to booking conditions</span></p>'; } } ?>
×
×
  • Create New...