تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[سؤال] ماهو الخطا بالكود أفيدونا جزاكم الله خير
#1
<?php include 'includes/connect1.php'; ?> 


<form name="form1" method="post" action="<?php echo"$_SERVER[PHP_SELF]"; ?>" dir="rtl"> 
  <table width="50%" border="0" align="center"> 
    <tr> 
      <td align="center">* الموضوع</td> 
      <td><label> 
        <input type="text" name="subject" id="subject"> 
      </label></td> 
    </tr> 
    <tr> 
      <td align="center">* نص الرسالة</td> 
      <td><label> 
        <textarea name="message" id="message" cols="45" rows="5"></textarea> 
      </label></td> 
    </tr> 
    <br>
    <tr > 
       <td align="center"><label> 
         <input type="submit" name="submit" id="submit" value="إرســــال">
       </label></td> 
    </tr> 
  </table> 
</form> 

  
 <?php
//If the form is submitted
$query = mysql_query("select email from `emails`")or die("Nothing");
       
  
if(isset($_POST['submit'])) {
 $subject=$_POST['subject'];
 $message=$_POST['message'];
 
while($row = mysql_fetch_assoc($query)){
 
//Check to make sure that the subject field is not empty
if(trim($_POST['subject']) == '') {
$hasError = true;
} else {
$subject = trim($_POST['subject']);
}
 

if(trim($_POST['message']) == '') {
$hasError = true;
} else {
if(function_exists('stripslashes')) {
$comments = stripslashes(trim($_POST['message']));

    } else {
$comments = trim($_POST['message']);
}
}
 
//If there is no error, send the email
if(!isset($hasError)) {

$body = "Subject: $subject\n\nMessage: $message\n\n";
$headers = 'من موقعي <'.".$row[email].".'>' . "\r\n" . 'إعادة ارسال الى: ' . ".$row[email].";
 
$mail_status = mail(".$row[email].", "$subject", "$body", "$headers");


}

}
if($mail_status){ ?>
    <script language="javascript" t="text/javascript">
alert(' تم الارسال بنجاح');


window.location= 'send_message.php';
</script>
    
    <?php
}
else { ?>
            <script language="javascript" type="text/javascript">
       alert('message failed.please,send an emil to');
window.location= 'send_message.php';
</script>
    <?php
}

}

?>
الرد }}}
تم الشكر بواسطة:
#2
السلام عليكم

اختي الكريمة

الرجاء ذكر الخطا الذي يظهر وممكن ايجاده في ملف errorlog.

على كل حال ممكن ان يكون الخطا في هذه الجملة

PHP كود :
<?php
//If the form is submitted
$query mysql_query("select email from `emails`")or die("Nothing");
 
      

يجب ان يكون كالتالي


PHP كود :
<?php
//If the form is submitted
$query mysql_query("select email from emails")or die("Nothing");
 
      

يعطيك العافية
(( يَا أَيَّتُهَا النَّفْسُ الْمُطْمَئِنَّةُ ارْجِعِي إِلَى رَبِّكِ رَاضِيَةً مَرْضِيَّةً فَادْخُلِي فِي عِبَادِي وَادْخُلِي جَنَّتِي ))

الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  ماهو سبب جمود المنتدى وتوقف التفاعل مع الاسئلة والمشاركات؟ gonm64 0 799 29-10-20, 10:43 AM
آخر رد: gonm64
  [سؤال] ماهو الافضل لمبرمجي PHP الورد برس ام البلوجر ؟ HamzahAbdoh 1 1,603 21-01-20, 11:12 PM
آخر رد: abubasilIraq
  [سؤال] ماهو الـ dateline سعود 18 6,432 01-10-14, 11:17 PM
آخر رد: سعود
  RE: ماهو الـ dateline سعود 0 1,853 01-10-14, 07:28 AM
آخر رد: سعود

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم