PHP Version 7.2

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

PHP Version 7.2

Post by Starb7 »

Hi

I am told that older version of PHP will not be supported, ie 5.6 or less. That's not a problem as I can update my hosting to vsn 7.2 easily and cost free.

The problem is that web built-in form processor doesn't appear to work with 7.2 so is there a fix for this?

TIA
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

There are no known issues with PHP 7.2
The form processor should work with this version of PHP.
In most cases, if the form no longer works then it is related to a misconfiguration of PHP on the server.
For example, PHP mail may not have been setup.
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Hi, If I set my PHP to 5.6 it works, on 7.2 is doesn't! I'll ask the provider of the are any issues and relay your comments. Thanks
Last edited by Starb7 on Mon May 20, 2019 5:43 pm, edited 1 time in total.
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Hi

Sorry I haven't come back before now on this. I had taken the form off but now it's back on and using the built-in version. The hosting is running v7.2 of PHP and the main page is PHP and all works fine except that when you click the send button, an error is generated:

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

I have spoken with the hosting provider and they say all is working as it should be so I am back to you for help.

Any ideas - can you test the built-in form on 7.2 yourself? If you want see what happening, please click http://www.sutton-cum-duckmanton.org.uk/contactus.php and to see it working under PHP 5.6, click http://www.supake.co.uk/testing/contactus.php.

TIA

p.s. they asked me to ask you to check for any php code updates that have been discontinued that the form might use.
p.p.s. I have got them looking into other areas to make 100% sure all is ok with the hosting platform :)
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

UPDATE:

Had a reply from the hosting chaps with an error message:

PHP Warning: mail(): SMTP server response: 501 5.1.7 Bad sender address syntax 221 2.7.0 Error: I can break rules, too. Goodbye. in \\HP3-WINC2-SMB2.HOSTINGP3.LOCAL\DOMAINSZ\952\1944952\user\htdocs\sendform.php on line 79

Seems like the issue is the with the sender syntax in v7.2 which works fine in 5.6 - does this help?

TIA
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

The built-in form script has been tested with extensively PHP 7.2. There are no known issues otherwise they would have already been fixed.
I have spoken with the hosting provider and they say all is working as it should be
That is what they always say, at first! But if you browse through all the other related form issues on this forum then most of these cases are host related...
PHP Warning: mail(): SMTP server response: 501 5.1.7 Bad sender address syntax 221 2.7.0 Error: I can break rules, too. Goodbye. in \\HP3-WINC2-SMB2.HOSTINGP3.LOCAL\DOMAINSZ\952\1944952\user\htdocs\sendform.php on line 79
This indicates a configuration problem.

Note that I cannot see your settings.
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

I tend to agree with you and so I have them on the case now but to save 'egg on face' can you absolutely state there's no issue with the built-in form processor? I can go back to them and do some proverbial ar3e kicking as I have wasted so much time on this now. Cheers
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

If I was aware of any issues they would have already been fixed.

You will need to ask your host why this error occurs:
PHP Warning: mail(): SMTP server response: 501 5.1.7 Bad sender address syntax 221 2.7.0 Error: I can break rules, too. Goodbye. in \\HP3-WINC2-SMB2.HOSTINGP3.LOCAL\DOMAINSZ\952\1944952\user\htdocs\sendform.php on line 79
I assume you have configured a valid email address in the settings of the form processor?
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Yes, all valid. As I mentioned, the form works fine under 5.6 but not on 7.2 - same site, form, hosting, conditions, etc. They say there's nothing else for them to 'configure' and so must be an issue with the form submission system... hmm, not totally convinced!
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

What does the PHP of the page look like?
Did you also try PHPMailer?
bkjohns
 
 
Posts: 290
Joined: Wed Nov 14, 2018 5:54 pm

Re: PHP Version 7.2

Post by bkjohns »

Did you do a complete upload of the site or just changed items? Perhaps some old code is floating around on your host? And are you using the latest version of WWB?
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Yes and Yes :)

I uploaded a completely new page to a new test folder. I event created a simple web form in a new folder and that failed too. Still working on it now but as you say, I think it could be host related... will let you know, thanks for your help so far.. Cheers
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Spent some time on this now and as far as I can tell, the $HTTP_POST_VARS are not getting posted through from the form when running PHP7.2. Now, is this something WWB is doing or is it a setting on the Hosting provide that needs tweaking? Any help, as always, is appreciated. Cheers
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

I don't think this has anything to do with the error.
The error indicates that something is wrong with the email address.
So, either the configured email address is wrong or your host rejects the address for some reason.

What is the PHP code of the page?
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

If you mean what vsn, then it's set for 7. Odd thing is, it works fine on 5.6 and just updating to v7.2 breaks it. Got them looking for any settings they could change\check, etc. Cheers
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

No, I meant the PHP code of the page : Menu -> Page -> Page HTML
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Ah, sorry. Left work now so will get this posted up ASAP. Cheers
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

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: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

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: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

What does it use? I can go back with the info as they may be able to help. Thanks
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

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: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

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: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

What is the PHP code of the page?
bkjohns
 
 
Posts: 290
Joined: Wed Nov 14, 2018 5:54 pm

Re: PHP Version 7.2

Post by bkjohns »

Email address(es) in < > perhaps?
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

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: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

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: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

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: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

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: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

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: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

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
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

PHP has always been case sensitive and so it the built-in form script.

Note that I cannot see what the PHP code of the test page is, so I cannot say anything meaningful about why the forms work or not.
What is the PHP code of showvars2.php?
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Hi Pablo

Here's the HTML code of Showvars2.php:

Code: Select all

<?php

// ini_set("sendmail_from", "info@supake.co.uk");
ini_set("sendmail_from", "xxxxx@yyyyy.zzzzz");

$thevariables = $_POST['thevariables'];
$from = $_POST['from'];
$to = $_POST['to'];

$Subject = "Variable testing";
$EmailBody = "Variable tests - the body - " ."\n\n" ."External Domain Used" ."\n\n" .$thevariables ."\n\n";
$EmailBody .= "FROM FIELD Specified was: " .$from ."\n\n";
$EmailBody .= "TO FIELD Specified was: " .$to;

// $Headers = "From: info@supake.co.uk";
$Headers = "From: " .$from;

mail($to,$Subject,$EmailBody,$Headers);

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Page</title>
<link href="PHPMailIssues.css" rel="stylesheet">
<link href="showvars2.css" rel="stylesheet">
</head>
<body>
<div id="wb_Text1" style="position:absolute;left:27px;top:28px;width:900px;height:54px;z-index:0;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">Nothing to see here - the email has been sent using PHP and not the built-in form.<br><br>NOTE: '$To' and '$FROM' are variably coded to an email address taken from the form.</span></div>
</body>
</html>
and the code of the forms page:

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'] == 'form1')
{
   $mailto = 'info@supake.co.uk';
   $mailfrom = 'info@supake.co.uk';
   $subject = 'Test Bog Standard';
   $message = 'Values submitted from web site form:';
   $success_url = '#';
   $error_url = '#';
   $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>bogstandardemail</title>
<link href="PHPMailIssues.css" rel="stylesheet">
<link href="index.css" rel="stylesheet">
<script>
function ValidatebogstandardmailForm()
{
   var regexp;
   var Editbox1 = document.getElementById('Editbox1');
   if (!(Editbox1.disabled || Editbox1.style.display === 'none' || Editbox1.style.visibility === 'hidden'))
   {
      regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
      if (Editbox1.value.length != 0 && !regexp.test(Editbox1.value))
      {
         alert("Please enter a valid email address.");
         Editbox1.focus();
         return false;
      }
   }
   var Editbox2 = document.getElementById('Editbox2');
   if (!(Editbox2.disabled || Editbox2.style.display === 'none' || Editbox2.style.visibility === 'hidden'))
   {
      regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
      if (Editbox2.value.length != 0 && !regexp.test(Editbox2.value))
      {
         alert("Please enter a valid email address.");
         Editbox2.focus();
         return false;
      }
   }
   return true;
}
</script>
<script>
function ValidatebogstandardmailForm()
{
   var regexp;
   var Editbox7 = document.getElementById('Editbox7');
   if (!(Editbox7.disabled || Editbox7.style.display === 'none' || Editbox7.style.visibility === 'hidden'))
   {
      regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
      if (Editbox7.value.length != 0 && !regexp.test(Editbox7.value))
      {
         alert("Please enter a valid email address.");
         Editbox7.focus();
         return false;
      }
   }
   var Editbox8 = document.getElementById('Editbox8');
   if (!(Editbox8.disabled || Editbox8.style.display === 'none' || Editbox8.style.visibility === 'hidden'))
   {
      regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
      if (Editbox8.value.length != 0 && !regexp.test(Editbox8.value))
      {
         alert("Please enter a valid email address.");
         Editbox8.focus();
         return false;
      }
   }
   return true;
}
</script>
</head>
<body>
<div id="wb_Form1" style="position:absolute;left:51px;top:22px;width:447px;height:193px;z-index:15;">
<form name="bogstandardmailForm" method="post" action="<?php echo basename(__FILE__); ?>" enctype="multipart/form-data" id="Form1" onsubmit="return ValidatebogstandardmailForm()">
<input type="hidden" name="formid" value="form1">
<input type="text" id="Editbox1" style="position:absolute;left:189px;top:17px;width:216px;height:18px;z-index:0;" name="from" value="" spellcheck="false">
<div id="wb_Text1" style="position:absolute;left:71px;top:22px;width:56px;height:18px;z-index:1;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">From</span></div>
<div id="wb_Text2" style="position:absolute;left:71px;top:61px;width:56px;height:18px;z-index:2;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">To</span></div>
<div id="wb_Text3" style="position:absolute;left:71px;top:95px;width:90px;height:18px;z-index:3;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">Message</span></div>
<input type="text" id="Editbox2" style="position:absolute;left:189px;top:56px;width:216px;height:18px;z-index:4;" name="to" value="" spellcheck="false">
<input type="text" id="Editbox3" style="position:absolute;left:189px;top:95px;width:216px;height:18px;z-index:5;" name="message" value="Hello World - Auto Form" spellcheck="false">
<input type="submit" id="Button1" name="Send" value="Submit" style="position:absolute;left:312px;top:139px;width:96px;height:25px;z-index:6;">
</form>
</div>
<div id="wb_Text4" style="position:absolute;left:641px;top:164px;width:124px;height:18px;z-index:16;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">V1.17</span></div>
<div id="wb_Text9" style="position:absolute;left:540px;top:65px;width:249px;height:54px;z-index:17;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">Note the <strong>From </strong>and <strong>To </strong>not used here as the Built-in code has that defined</span></div>
<div id="wb_Text11" style="position:absolute;left:548px;top:365px;width:249px;height:72px;z-index:18;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">Note the<strong> Built-In form </strong>is <strong>not </strong>used here as the php code is used to process the form data and sends it to showvars2.php</span></div>
<div id="wb_Form3" style="position:absolute;left:51px;top:244px;width:447px;height:312px;z-index:19;">
<form name="bogstandardmailForm" method="post" action="showvars2.php" id="Form3" onsubmit="return ValidatebogstandardmailForm()">
<div id="wb_Text12" style="position:absolute;left:37px;top:40px;width:335px;height:18px;z-index:7;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">Variables to send (some text):</span></div>
<input type="submit" id="Button3" name="Send" value="Submit" style="position:absolute;left:319px;top:236px;width:96px;height:25px;z-index:8;">
<input type="text" id="Editbox7" style="position:absolute;left:182px;top:87px;width:216px;height:18px;z-index:9;" name="from" value="" spellcheck="false">
<div id="wb_Text13" style="position:absolute;left:51px;top:141px;width:97px;height:18px;z-index:10;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">To</span></div>
<div id="wb_Text14" style="position:absolute;left:44px;top:87px;width:56px;height:18px;z-index:11;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">From</span></div>
<input type="text" id="Editbox8" style="position:absolute;left:182px;top:136px;width:216px;height:18px;z-index:12;" name="to" value="" spellcheck="false">
<input type="text" id="Editbox9" style="position:absolute;left:182px;top:188px;width:216px;height:18px;z-index:13;" name="thevariables" value="Hello World - PHP Coded" spellcheck="false">
<div id="wb_Text15" style="position:absolute;left:51px;top:193px;width:90px;height:18px;z-index:14;">
<span style="color:#000000;font-family:Verdana;font-size:15px;">Message</span></div>
</form>
</div>
</body>
</html>
Cheers
Last edited by Starb7 on Mon May 20, 2019 5:39 pm, edited 3 times in total.
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

p.s. any of the
// ini_set("sendmail_from", "info@supake.co.uk");
work. Also, are you able to send to and from a selection of email addresses using the form (to eliminate security issues)? Cheers
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

Do you mean that it also works when you remove this?

Code: Select all

ini_set("sendmail_from", "clerk@sutton-cum-duckmanton.org.uk");
Note that you can define the 'from' address in the form's properties.
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

I hadn't tried commenting that out so just gave it a go and yes, if you comment it out, it still works as expected. :) Cheers

Update: I have noticed that I can only send from (to anywhere) Fasthosts based email adders to there is some check going on...

p.p.s. having a lots of problems with the forum page, keeps timing out and very slow to load.
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

Update: I have noticed that I can only send from (to anywhere) Fasthosts based email adders to there is some check going on...
Do you get the same error if you use another email address?
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Yes, I get
PHPWarning: mail(): SMTP server response: 554 5.7.1 <info@supake.co.uk>: Recipient address rejected: Access denied in \\HP3-WINC2-SMB2.HOSTINGP3.LOCAL\DOMAINSZ\952\1944952\user\htdocs\bogstandardmail\showvars2.php on line 18
Line 18 being: mail($to,$Subject,$EmailBody,$Headers);

Cheers
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

So, this confirm that it's a server issue?

As mentioned you can set the 'from' address in the form's properties.

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

Re: PHP Version 7.2

Post by Starb7 »

No, not really. I knew that you could do that (and did try that) in the Built-in forms but it doesn't work. I have just edited and added it back in to verify and it still fails. Cheers
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Well here's an oddity, if you go into the settings and choose 'Mail Engine' and select 'mail' the built-in form works as expected, why would that be? Cheers

EDIT: its gets better - it appears I can actually 'send from' any email address, even fictitious email addresses, eg foo@bar.com will send email. Give it a go, the bottom form... does it work for you?
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Version 7.2

Post by Pablo »

No, not really.
Yes, it does!
The script does not care which email address you use, so somewhere on the server sode there is a filter that checks which email address issue as 'from'.

[quotwhy would that be?[/quote]
Because it uses php mailer instead of standard PHP mail. This works different and may bypass some server specific configuration.
User avatar
Starb7
 
 
Posts: 281
Joined: Tue Sep 05, 2006 12:35 pm
Location: Derbyshire

Re: PHP Version 7.2

Post by Starb7 »

Sorry, when you put
So, this confirm that it's a server issue?
, with a ? mark, I thought you were asking me. In any case, as I can either use 'hand coded' or 'PHP Mailer' for built-in forms, it's a win-win for me. Many thanks for your help and patience and as always, a top service. Thanks.
Post Reply