• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Simple form not working

New Here ,
Dec 29, 2022 Dec 29, 2022

Copy link to clipboard

Copied

Can someone let me know where I screwed up here?

 

http://angelscancleaning.com/booking-page.html

 

<?php
 
$emailSubject = 'Bin Washing';
$webMaster = 'service@angelsjunkremoval.com';
 
$user_name = $_POST['name'];
$user_address = $_POST['address'];
$user_city = $_POST['city'];
$user_email = $_POST['email'];
$user_phone = $_POST['phone']
$user_frequency = $_POST['frequency'];
$user_bins = $_POST['bins'];
$user_notes = $_POST['notes'];
 
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Address: $address <br>
City: $city <br>
Email: $email <br>
Phone: $phone <br>
Frequency: $frequency <br>
Bins: $bins <br>
Notes: $notes <br>
EOD;
 
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
 
/* Results rendered as HTML */
 
$theResults = <<<EOD
<html>
<head>
<title>You're Booked</title>
</head>
<body>
<h1>Booked</h1>
<p>Thank you for booking with us. We clean the day after your trash day. We will contact you soon to let you know the date of your next appointment</p>
</body>
</html>
EOD;
echo "$theResults";
 
?>

 

Views

107

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2022 Dec 29, 2022

Copy link to clipboard

Copied

BenPleysier_0-1672356516548.png

Looks like you have not included the jQuery library for your JavaScript starting at line 13

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2022 Dec 29, 2022

Copy link to clipboard

Copied

I highly recommend using HTML5 contact forms with a secure processing script.  The PHP script you're using now is not nearly secure enough for today's web.   See the secure script below.

https://github.com/PHPMailer/PHPMailer

 

PHP Mailer is what most hosting providers recommend because it sanitizes form input data before it reaches your server.  There's less chance of hackers exploiting your forms and using your server as a spam relay.

 

If you can't work with code, use a 3rd party form-to-email service like Wufoo.com or Jotform.com   The form data is processed by their servers, not yours.

 

Hope that helps.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 29, 2022 Dec 29, 2022

Copy link to clipboard

Copied

Thanks for the help. Yes, I'm using an older style PHP.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 30, 2022 Dec 30, 2022

Copy link to clipboard

Copied

LATEST

All of your php variables are inconsistent, you use $user_name to get the information from the form field and then try to output that as $name for example. 

 

Also do you specifically know that your server supports the php mail function? If you can clarify it does then l can most probably help.

 


 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines