Hirdetés
- Xiaomi 17 Ultra - jó az optikája
- Honor Magic8 Pro - bevált recept kölcsönvett hozzávalókkal
- Apple iPhone 17 Pro Max – fennsík
- Google Pixel topik
- Milyen okostelefont vegyek?
- Poco X8 Pro Max - nem kell ide sem bank, sem akkubank
- Itt a Galaxy S26 széria: az Ultra fejlődött, a másik kettő alig
- Ennyit dobott egy telefon gyártási költségén a memóriakrízis a Xiaomi szerint
- iPhone topik
- Poco F5 - pokolian jó ajánlat
Új hozzászólás Aktív témák
-
PowerBuldog
veterán
válasz
spammer
#13751
üzenetére
szarul másoltam ki

Úgy másoltam egy oldalról, szóval nem értem mi a gondja
Ez a teljes:
<?php
if(isset($_POST['email'])) {
$to = 'valami@dsfgsdf.hu';
$subject = 'asadfasdf';
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.";
echo $error."";
echo "Please go back and fix these errors.";
die();
}
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['last_name']) ||
!isset($_POST['email']) ||
!isset($_POST['comments'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$first_name = $_POST['first_name']; // required
$last_name = $_POST['last_name']; // required
$email_from = $_POST['email']; // required
$telephone = $_POST['telephone']; // not required
$comments = $_POST['comments']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$first_name)) {
$error_message .= 'The First Name you entered does not appear to be valid.';
}
if(!preg_match($string_exp,$last_name)) {
$error_message .= 'The Last Name you entered does not appear to be valid.';
}
if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Last Name: ".clean_string($last_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($telephone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($to, $subject, $email_message, $headers);
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
}
?>
Új hozzászólás Aktív témák
- HP ZBook 17 G6 Mobile Workstation i7-9850H/32GB/512SSD/RTX3000/FHD/LTE/
- HP EliteBook x360 1030 G2 i5-7300U / 8GB RAM / 256GB SSD / Magyar billentyűzet / 12 hónap garancia
- HP Victus Gaming Laptop INTEL I7-14700HX / RTX 4070 32GB RAM 1TB SSD 144Hz Gari
- HP Victus Gaming Laptop RTX 4070 / i7-13700H 16GB DDR5 1TB SSD Garancia
- Crucial MX500 500GB Enterprise Ssd
- Apple iPad Air 5 13' 128GB (2029.02.09-ig Garancia) Csak kibontva volt, Aktiválatlan!
- Dell Latitude 5290,12.5",i5-7300U,8GB DDR4,256GB SSD,WIN11
- GYÖNYÖRŰ iPhone 14 Plus 256GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS4526
- AKCIÓ! Lenovo Thinkpad L14 Gen 1 notebook - i5 10210U 16GB DDR4 512GB SSD Intel UHD GraphicsW11
- Apple iPhone 13 Mini 128GB,Újszerű,Adatkabel,12 hónap garanciával
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


