PHP ไม่ทำงานอ่ะค่ะ T-T

เริ่มโดย mija, 15 สิงหาคม 2010, 09:59:19

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

mija

หน้าที่จะใช้คำสั่งนะคะ http://www.xn--82cytuhubc6ax6cnibgb4vg5l.com/web/contact.html

คำสั่งในส่วนของ php ค่ะ หนูพลาดตรงไหนไปคะ T-T

อ้างถึง<?php

if(!$_POST) exit;

$email = $_POST['email'];


//$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){
   $error.="Invalid email address entered";
   $errors=1;
}
if($errors==1) echo $error;
else{
   $values = array ('name','email','message');
   $required = array('name','email','message');
   
   $your_email = "[email protected]";
   $email_subject = "New Message: ".$_POST['subject'];
   $email_content = "new message:\n";
   
   foreach($values as $key => $value){
     if(in_array($value,$required)){
      if ($key != 'subject' && $key != 'company') {
        if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; }
      }
      $email_content .= $value.': '.$_POST[$value]."\n";
     }
   }
   
   if(@mail($your_email,$email_subject,$email_content)) {
      echo 'Message sent!';
   } else {
      echo 'ERROR!';
   }
}
?>


AffiliateFantasia

มันขึ้น error ว่ายังไงครับ

mija

อ้างถึงจาก: AffiliateFantasia ใน 15 สิงหาคม 2010, 11:29:40
มันขึ้น error ว่ายังไงครับ

พิมแล้วส่งไม่ไป ไม่มีอะไรเกิดขึ้นค่ะ TT

SekRanger

หน้านั้นมันมี Extension เป็น HTML ไม่ใช่เหรอครับ

เก๋าลัดคุง

index.html  เปลี่ยนเป็น index.php
[direct=https://www.mescript.com/]Pc Game Download [/direct]
[direct=https://www.mescript.com/]Pc Game Download [/direct]
[direct=https://www.mescript.com/]Pc Game Download [/direct]
[direct=https://www.mescript.com/]Computer Programming and Knowledge make By MeScript.com.com [/direct]
[direct=https://www.mescript.com/]รับพัฒนาเว็บไซต์ + รับจดโดเมน + Hosting ราคาถูก [/direct]