• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

PHP Problem

WilcoW

New Pleskian
After upgrading to 10.4.4 mail send script does not work anymore. The PHP version stayed the same 5.2.17....

Weird problem, anyone an idea?

<?php
$Owner_email = "*********@hpeprint.com";
$Owner = "Snackbar Friecoenda";
// process.php
if(isset($_POST['saveForm']))
{
/*
* Specify the field names that are in the form. This is meant
* for security so that someone can't send whatever they want
* to the form.
*/
$allowedFields = array(
'FirstName',
'LastName',
'Email',
'Phone',
'StreetAddress',
'City',
'Zip',
'Pickdel'
);

// Specify the field names that you want to require...
$requiredFields = array(
'FirstName',
'LastName',
'Email',
'Phone',
'StreetAddress',
'City',
'Zip',
'Pickdel'
);

//fill the prduct name array
//global $PRODUCTS;
$PRODUCT_NAME = array();
foreach($PRODUCTS as $prod)
{
$PRODUCT_NAME[$prod[0]] = $prod[1] ;
}

$order_tbl = new HTML_Table(null, 'display', 0, 2, 0);
$order_tbl->addRow();
$order_tbl->addCell('Produkt ', 'first', 'header');
$order_tbl->addCell('Prijs', null, 'header');
$order_tbl->addCell('Aantal', null, 'header' );
$order_tbl->addCell('Totaal', null, 'header' );

// Loop through the $_POST array, which comes from the form...
$errors = array();
foreach($_POST AS $key => $value)
{
// first need to make sure this is an allowed field
if(in_array($key, $allowedFields))
{
$$key = $value;

// is this a required field?
if(in_array($key, $requiredFields) && $value == '')
{
$errors[] = "The field $key is required.";
}
}

//Collect the ordered dishes
$exp_arr = explode("_",$key);
if(($exp_arr[1] == 'qty')&&($value != 0))
{
$sel_price = $_POST[($exp_arr[0] . '_price')];
$sel_tot = $sel_price * $value;
$order_tbl->addRow();
$order_tbl->addCell($PRODUCT_NAME[$exp_arr[0]]);
$order_tbl->addCell('€' . number_format($sel_price, 2 , ',' , ' ') ,'cur');
$order_tbl->addCell($value,'qty');
$order_tbl->addCell('€' . number_format($sel_tot, 2 , ',' , ' ') ,'cur');
}
}

// were there any errors?
if(count($errors) > 0)
{
$resultString = '<p>Er is een probleem met het invullen van het formulier :</p>';
$resultString .= '<ul>';
foreach($errors as $error)
{
$resultString .= "<li>$error</li>";
}
$resultString .= '</ul>';

}
else
{
$del_str = "U kunt uw bestelling ophalen bij Snackbar Friecoenda";

//Calculate the total price
$order_price = $_POST['total'];

if((isset($_POST['Pickdel']))&&($_POST['Pickdel'] == "Delivery"))
{
$order_price = $order_price + 2.00;
$del_str = "Uw bestelling wordt bezorgd. Adres ".$StreetAddress .','. $City . ', Postcode - ' . $Zip ;
}

$order_price_str = number_format($order_price, 2 , ',' , ' ');

$resultString = "Bedankt voor uw bestelling! Uw bestelling is succesvol geplaatst en de totale kosten van de bestelling zijn € ".$order_price_str;

$subject = 'Bestelling Friecoenda';

$message = '<html>
<body>
Beste ' . $_POST['FirstName'] .',<br /><br />

Uw bestelling :-<br />' . $order_tbl->display() .
'<br />Totaal prijs : € '.$order_price_str.'.<br />'
.$del_str .
'<br /> '.
'Uw Opmerking - '.$_POST['Note'] .
'<br /> Telefoon -' . $Phone . '<br /> Email -' . $Email .
'<br /><br />Met vriendelijke groet,<br />'
.$Owner.'</body></html>';

// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: ' . "\r\n";
$headers .= 'From: '.$Owner_email."\r\n";
$headers .= 'Cc: '.$Owner_email."\r\n";
$headers .= 'Bcc: ' . $Email.', [email protected]'."\r\n";
// Mail it
if(mail($Email, $subject, $message, $headers))
{
$resultString = $resultString.".Bestelling is geplaatst";
}
else
{
$resultString = $resultString.".Fout met verzenden";
}


}

// display the result string
echo $resultString;
}
?>
 
Back
Top