PHP Version 7.2

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
User avatar
Pablo
 
Posts: 17990
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo » Fri May 17, 2019 8:04 pm

No, I meant the PHP code of the page : Menu -> Page -> Page HTML

User avatar
Starb7
 
 
Posts: 221
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 » Fri May 17, 2019 8:09 pm

Ah, sorry. Left work now so will get this posted up ASAP. Cheers

User avatar
Starb7
 
 
Posts: 221
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 » Fri May 17, 2019 8:12 pm

Just got this from the hosting folk.

PHP 7.2 no longer supports the $HTTP_POST_VARS, as this was removed in PHP 7, having been deprecated in PHP 5 by PHP's developers.

This has been replaced with $_POST - as such the code will need to change to reference $_POST instead.

As an example - if the variable $information was passed in the post for the form, and the document refers to itself on the post trigger, to acquire the variable you could use:

if($_SERVER["REQUEST_METHOD"] == "POST"){
$information = $_POST["information"];
}

As a comparison, HTTP_POST_VARS was not possible at a function level in PHP, only available at a file level, whereas _POST is available to all variables, hence HTTP_POST_VARS removal.

Does this help?

Cheers

User avatar
Pablo
 
Posts: 17990
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo » Sat May 18, 2019 6:32 am

No, this does not help because it is unrelated to the problem.
The WWB form script does not use $HTTP_POST_VARS !

User avatar
Starb7
 
 
Posts: 221
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 » Sat May 18, 2019 8:57 am

What does it use? I can go back with the info as they may be able to help. Thanks

User avatar
Pablo
 
Posts: 17990
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo » Sat May 18, 2019 9:53 am

WWB uses $_POST, but again, this is unrelated to the problem.
The server error indicates a problem related to the email address.

User avatar
Starb7
 
 
Posts: 221
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 » Sat May 18, 2019 10:01 am

That's odd because this is the code if manually created which works in 5.6. NOTE: I have commented out the variables and as you can see, at the bottom created 'test variables' and emailed those. This actually works fine so not an issue with the email address. if I then uncomment the lines (and remove the temp bits) it fails with the error and indicates the variables have no actually come through from the form. Also note, if I use the built-in form processor, at also fails under 7.2 and works in 5.6 with the same email address.

You say it's OK, the hosting people say there end is OK - I am passing the info between you to try and get it working so any idea's would be helpful and appreciated.

TIA.

<?php

ini_set("sendmail_from", " clerk@sutton-cum-duckmanton.org.uk ");

// $permission = $_POST['permission'];
// $name = $_POST['name'];
// $phone = $_POST['phone'];
// $email = $_POST['email'];
// $subject = $_POST['subject'];
// $message = $_POST['message'];

$thetimestamp = date("Y-m-d H:i:s");

// $EmailBody = "A Message from the S-c-D Web siteContact-Us \n\n";
// $EmailBody .= "On " .$thetimestamp ." this message was sent by " .$name ." as follows:" ."\n\n";
// $EmailBody .= "My Telephone number: " .$phone ."\n";
// $EmailBody .= "My Contact Email Address: " .$email ."\n\n";
// $EmailBody .= "My Message is:\n\n" .$message;
// $EmailBody .= "\n\n========== End of Message ==========\n\n";
// $EmailBody .= "[This email has been processed by the Supake Auto-Mailing System]";

// Get Status of Permission Box - and add msg if needed.

// Validate and send the message

$to = "info@supake.co.uk";
$subject = "a subject";
$emailBody = "hello world";

$headers = "From: clerk@sutton-cum-duckmanton.org.uk";

mail($to,$subject,$emailBody,$headers);

?>

User avatar
Pablo
 
Posts: 17990
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo » Sat May 18, 2019 12:27 pm

What is the PHP code of the page?

bkjohns
 
 
Posts: 65
Joined: Wed Nov 14, 2018 5:54 pm

Re: PHP Version 7.2

Post by bkjohns » Sun May 19, 2019 1:47 am

Email address(es) in < > perhaps?

User avatar
Starb7
 
 
Posts: 221
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 » Mon May 20, 2019 6:59 am

Hi Pablo,

Sorry, I thought you meant the PHP code for the form. The page in on a standard php page that has an iFrame with the form and results page. The code of the page is:

Code: Select all

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact Us:: Sutton-cum-Duckmanton Parish Council</title>
<meta name="author" content="Supake Ltd   t: 01246 826557">
<meta name="generator" content="Supake Ltd   t: 01246 826557">
<link href="SuttonCD.css" rel="stylesheet">
<link href="contactus.css" rel="stylesheet">
</head>
<body>
<div id="container">
<div id="wb_Text2" style="position:absolute;left:23px;top:301px;width:305px;height:37px;z-index:4;">
<span style="color:#2D722F;font-family:Arial;font-size:32px;"><strong>Contact Us</strong></span></div>
<div id="wb_EmbeddedPage1" style="position:absolute;left:0px;top:0px;width:840px;height:299px;z-index:5;">
<div id="wb_Image1" style="position:absolute;left:26px;top:0px;width:385px;height:299px;z-index:0;">
<img src="images/Logo.jpg" id="Image1" alt=""></div>
<img src="images/img0003.png" id="Text1" alt="Sutton-cum-Duckmanton " style="position:absolute;left:313px;top:156px;width:527px;height:50px;z-index:1;">
<img src="images/img0001.png" id="MergedObject1" alt="" title="" style="border-width:0;position:absolute;left:314px;top:216px;width:484px;height:20px;z-index:2">
<div id="wb_CssMenu1" style="position:absolute;left:310px;top:254px;width:478px;height:29px;z-index:3;">
<ul role="menubar">
<li class="firstmain"><a role="menuitem" href="./index.html" target="_self" title="Home">Home</a>
</li>
<li><a role="menuitem" href="./Reports.html" target="_self" title="Reports">Reports</a>
</li>
<li><a role="menuitem" class="active" href="./contactus.php" target="_self" title="Contact Us">Contact&nbsp;Us</a>
</li>
</ul>
</div>
</div>
<div id="wb_Text5" style="position:absolute;left:23px;top:1373px;width:215px;height:14px;z-index:6;">
<span style="color:#A9A9A9;font-family:Verdana;font-size:12px;"><em><a href="./contactus.php">Go to top of page</a></em></span></div>
<iframe name="ContactUsForm" id="InlineFrame1" style="position:absolute;left:190px;top:477px;width:518px;height:466px;z-index:7;" src="./sendform.php" scrolling="no"></iframe>
<div id="wb_Contact_Us_text" style="position:absolute;left:23px;top:348px;width:801px;height:90px;z-index:8;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">You can contact us via the form below.&nbsp; Please complete the form, click the 'Consent' check box and press 'Send'.&nbsp; Alternatively, you can contact the Clerk on 01246 826955 during normal office hours.<br><br>You may also be able to contact any one of the current Councillors - to view the current list, please click <a href="http://sutton-cum-duckmanton.org.uk/docs/Councillors- website.pdf" target="_blank" title="Current Councillors in PDF Format">HERE</a> (to open or download) a list in PDF format. </span></div>
</div>
</body>
</html>
The Form (on a PHP PAGE) is this but please NOTE that I have turn off the built-in for testing and so the result page is handling the form at the moment but in both cases, the form is failing:

Code: Select all

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SendForm</title>
<meta name="author" content="Supake Ltd   t: 01246 826557">
<meta name="generator" content="Supake Ltd   t: 01246 826557">
<link href="SuttonCD.css" rel="stylesheet">
<link href="sendform.css" rel="stylesheet">
<script>
function ValidateContactUsForm()
{
   var regexp;
   var name = document.getElementById('name');
   if (!(name.disabled || name.style.display === 'none' || name.style.visibility === 'hidden'))
   {
      regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-',]*$/;
      if (!regexp.test(name.value))
      {
         alert("What is your name?");
         name.focus();
         return false;
      }
      if (name.value == "")
      {
         alert("What is your name?");
         name.focus();
         return false;
      }
      if (name.value.length < 3)
      {
         alert("What is your name?");
         name.focus();
         return false;
      }
      if (name.value.length > 100)
      {
         alert("What is your name?");
         name.focus();
         return false;
      }
   }
   var phone = document.getElementById('phone');
   if (!(phone.disabled || phone.style.display === 'none' || phone.style.visibility === 'hidden'))
   {
      regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-',]*$/;
      if (!regexp.test(phone.value))
      {
         alert("What is your Phone Number");
         phone.focus();
         return false;
      }
      if (phone.value == "")
      {
         alert("What is your Phone Number");
         phone.focus();
         return false;
      }
      if (phone.value.length < 3)
      {
         alert("What is your Phone Number");
         phone.focus();
         return false;
      }
      if (phone.value.length > 50)
      {
         alert("What is your Phone Number");
         phone.focus();
         return false;
      }
   }
   var email = document.getElementById('email');
   if (!(email.disabled || email.style.display === 'none' || email.style.visibility === 'hidden'))
   {
      regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
      if (!regexp.test(email.value))
      {
         alert("What is your Email Address?");
         email.focus();
         return false;
      }
      if (email.value == "")
      {
         alert("What is your Email Address?");
         email.focus();
         return false;
      }
      if (email.value.length < 3)
      {
         alert("What is your Email Address?");
         email.focus();
         return false;
      }
      if (email.value.length > 50)
      {
         alert("What is your Email Address?");
         email.focus();
         return false;
      }
   }
   var subject = document.getElementById('subject');
   if (!(subject.disabled || subject.style.display === 'none' || subject.style.visibility === 'hidden'))
   {
      regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-', ?]*$/;
      if (!regexp.test(subject.value))
      {
         alert("What is the Subject of your Query?");
         subject.focus();
         return false;
      }
      if (subject.value == "")
      {
         alert("What is the Subject of your Query?");
         subject.focus();
         return false;
      }
      if (subject.value.length < 3)
      {
         alert("What is the Subject of your Query?");
         subject.focus();
         return false;
      }
      if (subject.value.length > 50)
      {
         alert("What is the Subject of your Query?");
         subject.focus();
         return false;
      }
   }
   var message = document.getElementById('message');
   if (!(message.disabled || message.style.display === 'none' || message.style.visibility === 'hidden'))
   {
      regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-, . ? £]*$/;
      if (!regexp.test(message.value))
      {
         alert("What is your message?");
         message.focus();
         return false;
      }
      if (message.value == "")
      {
         alert("What is your message?");
         message.focus();
         return false;
      }
      if (message.value.length < 3)
      {
         alert("What is your message?");
         message.focus();
         return false;
      }
      if (message.value.length > 250)
      {
         alert("What is your message?");
         message.focus();
         return false;
      }
   }
   return true;
}
</script>
</head>
<body>
<div id="wb_contactusForm1" style="position:absolute;left:1px;top:0px;width:471px;height:433px;z-index:15;">
<form name="ContactUsForm" method="post" action="sentform.php" id="contactusForm1" onsubmit="return ValidateContactUsForm()">
<input type="text" id="name" style="position:absolute;left:126px;top:18px;width:335px;height:20px;z-index:0;" name="name" value="" maxlength="100" tabindex="10" spellcheck="false" title="What is your name?" placeholder="Your Preferred Contact Name">
<label for="contactusForm1" id="contactusLabel1" style="position:absolute;left:19px;top:12px;width:68px;height:35px;line-height:35px;z-index:1;" tabindex="0">Name *</label>
<input type="text" id="phone" style="position:absolute;left:126px;top:55px;width:335px;height:20px;z-index:2;" name="phone" value="" maxlength="100" tabindex="20" spellcheck="false" title="What is your Phone Number?" placeholder="A number can we call you on if needed">
<label for="contactusLabel1" id="contactusLabel2" style="position:absolute;left:19px;top:49px;width:68px;height:35px;line-height:35px;z-index:3;" tabindex="0">Phone *</label>
<input type="text" id="email" style="position:absolute;left:126px;top:92px;width:335px;height:20px;z-index:4;" name="email" value="" maxlength="100" tabindex="30" spellcheck="false" title="What is your Email Address?" placeholder="Your Preferred Email Address">
<label for="contactusLabel2" id="contactusLabel3" style="position:absolute;left:19px;top:86px;width:68px;height:35px;line-height:35px;z-index:5;">Email *</label>
<input type="text" id="subject" style="position:absolute;left:126px;top:129px;width:335px;height:20px;z-index:6;" name="subject" value="" maxlength="100" tabindex="40" spellcheck="false" title="What is the Subject of your Query?" placeholder="What do you want to contact us about?">
<label for="contactusLabel3" id="contactusLabel4" style="position:absolute;left:19px;top:122px;width:84px;height:35px;line-height:35px;z-index:7;">Subject *</label>
<label for="contactusLabel4" id="contactusLabel5" style="position:absolute;left:19px;top:234px;width:94px;height:35px;line-height:35px;z-index:8;">Message *</label>
<textarea name="message" id="message" style="position:absolute;left:126px;top:173px;width:335px;height:146px;z-index:9;" rows="7" cols="40" tabindex="50" spellcheck="false" title="Your Message" placeholder="Your Message up to a maximum of 250 characters. Some charactes are not allowed, if you cannot send your message please remove any special characters, eg ! ? @ # and so on, then try again."></textarea>
<label for="" id="contactusLabel6" style="position:absolute;left:121px;top:384px;width:330px;height:20px;line-height:20px;z-index:10;" title="(* All fields are required)">(* All fields are required)</label>
<input type="submit" id="contactusButton1" name="Send" value="Send" style="position:absolute;left:363px;top:386px;width:96px;height:25px;z-index:11;" title="Send your Query!">
<div id="wb_permission" style="position:absolute;left:126px;top:339px;width:33px;height:27px;z-index:12;">
<input type="checkbox" id="permission" name="permission" value="Permisson has been given to Contact this person." style="position:absolute;left:0;top:0;" title="Can we contact you if needed?"><label for="permission"></label></div>
<div id="wb_Text1" style="position:absolute;left:158px;top:345px;width:308px;height:36px;z-index:13;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">Consent - can we contact you if needed?</span></div>
<div id="wb_Text2" style="position:absolute;left:19px;top:403px;width:55px;height:10px;z-index:14;">
<span style="color:#696969;font-family:Verdana;font-size:8px;">v1.15</span></div>
</form>
</div>
</body>
</html>
and the Results (manual code) code this this:

Code: Select all

<?php

// All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS.

ini_set("sendmail_from", " clerk@sutton-cum-duckmanton.org.uk ");

// $permission = $_POST['permission'];
// $name = $_POST['name'];
// $phone = $_POST['phone'];
// $email = $_POST['email'];
// $subject = $_POST['subject'];
// $message = $_POST['message'];

$thetimestamp = date("Y-m-d H:i:s");

// $EmailBody = "A Message from the S-c-D Web siteContact-Us \n\n";
// $EmailBody .= "On " .$thetimestamp ." this message was sent by " .$name ." as follows:" ."\n\n";
// $EmailBody .= "My Telephone number: " .$phone ."\n";
// $EmailBody .= "My Contact Email Address: " .$email ."\n\n";
// $EmailBody .= "My Message is:\n\n" .$message;
// $EmailBody .= "\n\n========== End of Message ==========\n\n";
// $EmailBody .= "[This email has been processed by the Supake Auto-Mailing System]";

// Get Status of Permission Box -  and add msg if needed.

// Validate and send the message

$to = "info@supake.co.uk";
$subject = "a subject";
$emailBody = "hello world";

$headers = "From: clerk@sutton-cum-duckmanton.org.uk";

mail($to,$subject,$emailBody,$headers);

?>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>sentform</title>
<meta name="author" content="Supake Ltd   t: 01246 826557">
<meta name="generator" content="Supake Ltd   t: 01246 826557">
<link href="SuttonCD.css" rel="stylesheet">
<link href="sentform.css" rel="stylesheet">
</head>
<body>
<div id="wb_Image1" style="position:absolute;left:4px;top:2px;width:365px;height:283px;z-index:0;">
<img src="images/Logo.jpg" id="Image1" alt=""></div>
<div id="wb_Text1" style="position:absolute;left:21px;top:320px;width:445px;height:36px;text-align:center;z-index:1;">
<span style="color:#4F4F4F;font-family:Verdana;font-size:15px;">Your Message has been processed and sent.&nbsp; We will be in touch as soon as we can.&nbsp; Thank you for your interest.</span></div>
<img src="images/img0002.png" id="Text2" alt="Thank You " style="position:absolute;left:226px;top:194px;width:221px;height:50px;z-index:2;">
</body>
</html>
Happy to try anything and do any testing...

Thanks.

User avatar
Pablo
 
Posts: 17990
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo » Mon May 20, 2019 7:13 am

I'm sorry, but this is not the PHP code generated by the built-in form script.

1. Open the page in the software
2. Menu -> Page -> Page HTML

User avatar
Starb7
 
 
Posts: 221
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 » Mon May 20, 2019 8:27 am

Ok, I have changed it to use the built-in form now and here the page code:

Code: Select all

<?php
function ValidateEmail($email)
{
   $pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
   return preg_match($pattern, $email);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['formid']) && $_POST['formid'] == 'contactusform1')
{
   $mailto = 'clerk@sutton-cum-duckmanton.org.uk';
   $mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
   $subject = 'Web Page Contact Us Form';
   $message = 'A Message from the ScD Contact Us Form as follows:

';
   $success_url = './sentform.php';
   $error_url = './sentform.php';
   $error = '';
   $eol = "\n";
   $boundary = md5(uniqid(time()));

   $header  = 'From: '.$mailfrom.$eol;
   $header .= 'Reply-To: '.$mailfrom.$eol;
   $header .= 'MIME-Version: 1.0'.$eol;
   $header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
   $header .= 'X-Mailer: PHP v'.phpversion().$eol;
   if (!ValidateEmail($mailfrom))
   {
      $error .= "The specified email address is invalid!\n<br>";
   }

   if (!empty($error))
   {
      $errorcode = file_get_contents($error_url);
      $replace = "##error##";
      $errorcode = str_replace($replace, $error, $errorcode);
      echo $errorcode;
      exit;
   }

   $internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field", "g-recaptcha-response");
   $message .= $eol;
   $logdata = '';
   foreach ($_POST as $key => $value)
   {
      if (!in_array(strtolower($key), $internalfields))
      {
         if (!is_array($value))
         {
            $message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
         }
         else
         {
            $message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
         }
      }
   }
   $body  = 'This is a multi-part message in MIME format.'.$eol.$eol;
   $body .= '--'.$boundary.$eol;
   $body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol;
   $body .= 'Content-Transfer-Encoding: 8bit'.$eol;
   $body .= $eol.stripslashes($message).$eol;
   if (!empty($_FILES))
   {
       foreach ($_FILES as $key => $value)
       {
          if ($_FILES[$key]['error'] == 0)
          {
             $body .= '--'.$boundary.$eol;
             $body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
             $body .= 'Content-Transfer-Encoding: base64'.$eol;
             $body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
             $body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
          }
      }
   }
   $body .= '--'.$boundary.'--'.$eol;
   if ($mailto != '')
   {
      mail($mailto, $subject, $body, $header);
   }
   header('Location: '.$success_url);
   exit;
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SendForm</title>
<meta name="author" content="Supake Ltd   t: 01246 826557">
<meta name="generator" content="Supake Ltd   t: 01246 826557 - using a mix of technologies to get you results!">
<link href="SuttonCD.css" rel="stylesheet">
<link href="sendform.css" rel="stylesheet">
<script>
function ValidateContactUsForm()
{
   var regexp;
   var name = document.getElementById('name');
   if (!(name.disabled || name.style.display === 'none' || name.style.visibility === 'hidden'))
   {
      regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-',]*$/;
      if (!regexp.test(name.value))
      {
         alert("What is your name?");
         name.focus();
         return false;
      }
      if (name.value == "")
      {
         alert("What is your name?");
         name.focus();
         return false;
      }
      if (name.value.length < 3)
      {
         alert("What is your name?");
         name.focus();
         return false;
      }
      if (name.value.length > 100)
      {
         alert("What is your name?");
         name.focus();
         return false;
      }
   }
   var phone = document.getElementById('phone');
   if (!(phone.disabled || phone.style.display === 'none' || phone.style.visibility === 'hidden'))
   {
      regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-',]*$/;
      if (!regexp.test(phone.value))
      {
         alert("What is your Phone Number");
         phone.focus();
         return false;
      }
      if (phone.value == "")
      {
         alert("What is your Phone Number");
         phone.focus();
         return false;
      }
      if (phone.value.length < 3)
      {
         alert("What is your Phone Number");
         phone.focus();
         return false;
      }
      if (phone.value.length > 50)
      {
         alert("What is your Phone Number");
         phone.focus();
         return false;
      }
   }
   var email = document.getElementById('email');
   if (!(email.disabled || email.style.display === 'none' || email.style.visibility === 'hidden'))
   {
      regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
      if (!regexp.test(email.value))
      {
         alert("What is your Email Address?");
         email.focus();
         return false;
      }
      if (email.value == "")
      {
         alert("What is your Email Address?");
         email.focus();
         return false;
      }
      if (email.value.length < 3)
      {
         alert("What is your Email Address?");
         email.focus();
         return false;
      }
      if (email.value.length > 50)
      {
         alert("What is your Email Address?");
         email.focus();
         return false;
      }
   }
   var subject = document.getElementById('subject');
   if (!(subject.disabled || subject.style.display === 'none' || subject.style.visibility === 'hidden'))
   {
      regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-', ?]*$/;
      if (!regexp.test(subject.value))
      {
         alert("What is the Subject of your Query?");
         subject.focus();
         return false;
      }
      if (subject.value == "")
      {
         alert("What is the Subject of your Query?");
         subject.focus();
         return false;
      }
      if (subject.value.length < 3)
      {
         alert("What is the Subject of your Query?");
         subject.focus();
         return false;
      }
      if (subject.value.length > 50)
      {
         alert("What is the Subject of your Query?");
         subject.focus();
         return false;
      }
   }
   var message = document.getElementById('message');
   if (!(message.disabled || message.style.display === 'none' || message.style.visibility === 'hidden'))
   {
      regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-, . ? £]*$/;
      if (!regexp.test(message.value))
      {
         alert("What is your message?");
         message.focus();
         return false;
      }
      if (message.value == "")
      {
         alert("What is your message?");
         message.focus();
         return false;
      }
      if (message.value.length < 3)
      {
         alert("What is your message?");
         message.focus();
         return false;
      }
      if (message.value.length > 250)
      {
         alert("What is your message?");
         message.focus();
         return false;
      }
   }
   return true;
}
</script>
</head>
<body>
<div id="wb_contactusForm1" style="position:absolute;left:1px;top:0px;width:471px;height:433px;z-index:15;">
<form name="ContactUsForm" method="post" action="<?php echo basename(__FILE__); ?>" enctype="multipart/form-data" id="contactusForm1" onsubmit="return ValidateContactUsForm()">
<input type="hidden" name="formid" value="contactusform1">
<input type="text" id="name" style="position:absolute;left:126px;top:18px;width:335px;height:20px;z-index:0;" name="name" value="" maxlength="100" tabindex="10" spellcheck="false" title="What is your name?" placeholder="Your Preferred Contact Name">
<label for="contactusForm1" id="contactusLabel1" style="position:absolute;left:19px;top:12px;width:68px;height:35px;line-height:35px;z-index:1;" tabindex="0">Name *</label>
<input type="text" id="phone" style="position:absolute;left:126px;top:55px;width:335px;height:20px;z-index:2;" name="phone" value="" maxlength="100" tabindex="20" spellcheck="false" title="What is your Phone Number?" placeholder="A number can we call you on if needed">
<label for="contactusLabel1" id="contactusLabel2" style="position:absolute;left:19px;top:49px;width:68px;height:35px;line-height:35px;z-index:3;" tabindex="0">Phone *</label>
<input type="text" id="email" style="position:absolute;left:126px;top:92px;width:335px;height:20px;z-index:4;" name="email" value="" maxlength="100" tabindex="30" spellcheck="false" title="What is your Email Address?" placeholder="Your Preferred Email Address">
<label for="contactusLabel2" id="contactusLabel3" style="position:absolute;left:19px;top:86px;width:68px;height:35px;line-height:35px;z-index:5;">Email *</label>
<input type="text" id="subject" style="position:absolute;left:126px;top:129px;width:335px;height:20px;z-index:6;" name="subject" value="" maxlength="100" tabindex="40" spellcheck="false" title="What is the Subject of your Query?" placeholder="What do you want to contact us about?">
<label for="contactusLabel3" id="contactusLabel4" style="position:absolute;left:19px;top:122px;width:84px;height:35px;line-height:35px;z-index:7;">Subject *</label>
<label for="contactusLabel4" id="contactusLabel5" style="position:absolute;left:19px;top:234px;width:94px;height:35px;line-height:35px;z-index:8;">Message *</label>
<textarea name="message" id="message" style="position:absolute;left:126px;top:173px;width:335px;height:146px;z-index:9;" rows="7" cols="40" tabindex="50" spellcheck="false" title="Your Message" placeholder="Your Message up to a maximum of 250 characters. Some charactes are not allowed, if you cannot send your message please remove any special characters, eg ! ? @ # and so on, then try again."></textarea>
<label for="" id="contactusLabel6" style="position:absolute;left:121px;top:384px;width:330px;height:20px;line-height:20px;z-index:10;" title="(* All fields are required)">(* All fields are required)</label>
<input type="submit" id="contactusButton1" name="Send" value="Send" style="position:absolute;left:363px;top:386px;width:96px;height:25px;z-index:11;" title="Send your Query!">
<div id="wb_permission" style="position:absolute;left:126px;top:339px;width:33px;height:27px;z-index:12;">
<input type="checkbox" id="permission" name="permission" value="Permisson has been given to Contact this person." style="position:absolute;left:0;top:0;" title="Can we contact you if needed?"><label for="permission"></label></div>
<div id="wb_Text1" style="position:absolute;left:158px;top:345px;width:308px;height:36px;z-index:13;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">Consent - can we contact you if needed?</span></div>
<div id="wb_Text2" style="position:absolute;left:19px;top:403px;width:55px;height:10px;z-index:14;">
<span style="color:#696969;font-family:Verdana;font-size:8px;">v1.15</span></div>
</form>
</div>
</body>
</html>
Cheers

p.s. Built-in or manual, neither work :(

User avatar
Pablo
 
Posts: 17990
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo » Mon May 20, 2019 8:58 am

I do not see any errors in the code.
And as you can see, there are no refferences to $HTTP_POST_VARS anywhere!

The only reason I can think of why this code does not work is an issue on the server side.

User avatar
Starb7
 
 
Posts: 221
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 » Mon May 20, 2019 9:05 am

Thanks for the update. Yes, I know (from previous posts) it's using the right POST format. I have asked them to check again... thanks for your help. Cheers

User avatar
Starb7
 
 
Posts: 221
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 » Mon May 20, 2019 1:57 pm

Hi Pablo

Been on this all morning (with the hosting folks) and have got to this point. If you go to
http://sutton-cum-duckmanton.org.uk/bogstandardmail/ and use the top form which is a Built-In form processor, it fails but if you use the lower form, which send it to showvars2.php and processes the code manually it works.

Note that you can use any From and To email address and so probably not a security issue.

The only thing we noticed while testing is that the code is now case sensitive, ie if you use $to = $_POST['to']; (using the form data) and then try and use such as mail($To,$Subject,$EmailBody,$Headers); ie, a cap T, then it fails.

Could it be that the built-in form is changing the case and has PHP7.2 got more case sensitive?

Any further pointers help would be appreciated but as we can now use manually processed form date, we have a work-around for now.

Cheers

Post Reply