تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مشكلة في كود اتصل بنا
#21
(14-04-16, 04:43 PM)محمد كريّم كتب : عندك قوس ناقص فوق
if(empty($name) or is_int($name))
أضف
{


سؤال: هل كود php وكود html في صفحة واحدة

نعم
الرد }}}
تم الشكر بواسطة: derham
#22
هل عمل الكود الآن
طيب طالما الكل في ملف واحد ليش ما عطيتني الملف كامل مرة واحدة بدل ما كل مرة تعطيني كود مرة html ومرة php
انا حتى الان لم اعرف هل html موجود في ملف complains.php والا في ملف اخر
الرد }}}
تم الشكر بواسطة: derham , derham
#23
(14-04-16, 05:29 PM)محمد كريّم كتب : هل عمل الكود الآن
طيب طالما الكل في ملف واحد ليش ما عطيتني الملف كامل مرة واحدة بدل ما كل مرة تعطيني كود مرة html ومرة php
انا حتى الان لم اعرف هل html موجود في ملف complains.php والا في ملف اخر
هما بالفعل اخي موجودان في ملف واحد ولكني تصورت ان المشكلة في كود ال php   ولذلك ارسلته هو فقط في البداية 
ولكنه لم يعمل ايضا معي بعد اضافة القوس الناقص وهذا هو الكود كامل كما مكتوب في الملف   فهل تتفضل  اخي بمراجعته لي ولك الشكر
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
   
$name = $_POST['name'];
$id = $_POST['id'];
$mail = $_POST['mail'];
$tel = $_POST['tel'];
$sub = $_POST['sub'];
$msg = $_POST['msg'];
    if(isset($_POST['ارسال']))
    {
        $name = $_POST['name'];
       $id = $_POST['id'];
       $mail = $_POST['mail'];
        $tel = $_POST['tel'];
        $sub = $_POST['sub'];
        $msg = $_POST['msg'];
    }
    else
    {
        $name = "";
        $id = "";
        $mail = "";
        $tel = "";
        $sub = "";
        $msg = "";
    } 

 if(isset($_POST['ارسال']))
    {
    if(empty($name) or is_int($name))
    {
      echo '<div  class="no">ادخل الإسم</div>';
    }   
    elseif(empty($mail))
    {
       echo '<div class="no">ادخل الايميل</div>';   
    }
    elseif(empty($id))
    {
       echo '<div class="no">ادخل رقم العميل</div>';   
    }
 
     elseif(empty($tel))
    {
       echo '<div class="no">ادخل رقم التليفون</div>';
    }

    elseif(empty($msg))
    {
        echo "<div class='no'>ادخل الرسالة</div>";
            }else{

$ymail = "user@mail.com"; 
$title = $sub . 'Is From : ' .$name;
$msg = $msg . "<br/> \r\n  الاسم&nbsp;&nbsp;" . $name . "<br/> \r\n  رقم العميل&nbsp;&nbsp;" . $id . "<br/> \r\n  البريد الاليكتروني&nbsp;&nbsp;" . $mail;
$header = "MIME-Version: 1.0 \r/n" ;
$header .= "From: $ymail $sub \r\n" ;
$header .= "Cc: user@mail.com \r\n" ;
$header .= "Content-Type: Text/html ; charset=utf-8 \r\n" ;
$header .= "X-Priority: 3 \r\n";

mail ($ymail,$sub,$msg,$header); 

echo '<div class="ok">شكرا تم الارسال ، وسنرد عليك في أقرب وقت </div>';
    }//else Maail
       

    }// start IF       

?>




<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>ارسل شكواك</title>
<style type="text/css">


.auto-style11 {
text-align: left;
margin-right: 425px;
}




.



.auto-style12 {
margin-right: 17px;
}









.ok {
  background: #95C5DF;
  text-align: center;
  padding: 30px;
  margin:50px;
  color: #C92206; margin: auto;  width: 25%;
  font-size:18px;
  height:50px 
}

.no {
    background:#F57575;
    text-align:center;
    padding: 20px;
    margin:50px;
    color:#000; margin: auto; width: 15%; font-size:18px;
      height:50px 

}





.auto-style23 {
margin-right: 3px;
}

.auto-style24 {
margin-right: 131px;
}

.auto-style28 {
margin-right: 51px;
}
.auto-style32 {
margin-right: 250px;
}

.auto-style33 {
margin-right: 77px;
}
.auto-style34 {
margin-right: 110px;
}
.auto-style35 {
margin-right: 120px;
}

.auto-style36 {
margin-right: 90px;
}

</style>
</head>

<body style="padding:0px; margin:0px">

    <div id="container" style="height: 728px; width: 1000px;padding:0px; left: 0px; top: 0px;" >


<div id="div1_div_right2" style="border-style: none; border-color: inherit; border-width: 0px; background-image:url('images2/TITLES.png'); background-repeat:no-repeat;height:728px; margin-right:0px; margin-left:0px; margin-top:5px; margin-bottom:0px; left: 0px; top: 0px; width: 1000px; padding:0px">
<div id= "div1_div_right2" style="height: 48px;width:1000px;margin:0px">
</div>
<div id="div1_div_right2" style="margin-top:20px;padding:0px;  top:-15px; width:1000px; background-color:#f4f4f4; height:661px; font-family:'Droid Arabic Kufi'; color:#51c0f3; left: 0px;" class="auto-style23">
<h1 style="margin-top:10px;padding-top:10px;padding-right:30px;float:right; width: 68px;" class="auto-style11">
راسلنا</h1>


 

 <form action="complains3.php" method="post" style="position:relative;direction:rtl;height: 571px; width: 640px;margin-right:150px;float:right" >
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">الاسم</label>
<input type='text' value="$name" name='name' style="padding:0px;height:25px;width: 349px; margin-top: 0; margin-bottom: 0;" class="auto-style24" />
<br style="height:20px" />
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">رقم العميل</label>
<input  type='text' value="$id"  name='id' style="padding:0px;height:25px;width: 349px; margin-top: 0; margin-bottom: 0;" class="auto-style36" />
 <br style="height:20px" />
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">البريد الالكتروني</label>
<input type='text' value="$mail" name='mail' style="padding:0px;height:25px;width: 349px; margin-top: 0; margin-bottom: 0;" class="auto-style28" />
<br style="height:20px" />
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">رقم التليفون</label>
<input type='text' value="$tel" name='tel' style="padding:0px;height:25px;width: 349px; margin-top: 0; margin-bottom: 0;" class="auto-style33" />
<br style="height:20px" />
<label style="margin-top: 0px;margin-right:0px;margin-left:0px;padding:0px">الموضوع</label>
<input value="$sub" type='text' name='sub' style="color:maroon;height:25px;width: 348px; font-size:16px" class="auto-style34" />

<br style="height:20px" />
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">الرسالة</label>
<textarea name="msg" rows="8"style=" width: 347px" class="auto-style35" ></textarea>

<br /><br />
<input type="submit" name ="ارسال" value="ارسال" style="width: 70px;color:#14538a;font-weight:bold;font-size:14px;font-family:'Droid Arabic Kufi';height: 41px;background-color: #96C6DF;" class="auto-style32" /> &nbsp;
<input type="reset" value="مسح" style="width: 70px;color:#14538a;font-weight:bold;font-size:14px;font-family:'Droid Arabic Kufi';height: 41px; background-color: #96C6DF;" />

</form>





</div>




</div>
</div>








</body>

</html>
الرد }}}
تم الشكر بواسطة: derham
#24
اولا تاكد ان اسم الملف هو  complains3.php وليس complains.php كما ذكرت في ردك السابق
والان جرب هذا الكود

امسح كل محتويات الملف والصق هذا الكود

PHP كود :
<?php
    
if(isset($_POST['send']))
    {
        $name $_POST['name'];
        $id $_POST['id'];
        $mail $_POST['mail'];
        $tel $_POST['tel'];
        $sub $_POST['sub'];
        $msg $_POST['msg'];

    if(empty($name) or is_int($name))
    {
      echo '<div  class="no">ادخل الإسم</div>';
    }   
    
elseif(empty($mail))
    {
       echo '<div class="no">ادخل الايميل</div>';   
    
}
    elseif(empty($id))
    {
       echo '<div class="no">ادخل رقم العميل</div>';   
    
}
 
     
elseif(empty($tel))
    {
       echo '<div class="no">ادخل رقم التليفون</div>';
    }

    elseif(empty($msg))
    {
        echo "<div class='no'>ادخل الرسالة</div>";
     }
    else
        
{
            $ymail "mail@mail.com"
            $title $sub 'Is From : ' .$name;
            $msg $msg "<br/> \r\n  الاسم&nbsp;&nbsp;" $name "<br/> \r\n  رقم العميل&nbsp;&nbsp;" $id "<br/> \r\n  البريد الاليكتروني&nbsp;&nbsp;" $mail;
            $header "MIME-Version: 1.0 \r/n" ;
            $header .= "From: $ymail $sub \r\n" ;
            $header .= "Cc: ma@yahoo.com \r\n" ;
            $header .= "Content-Type: Text/html ; charset=utf-8 \r\n" ;
            $header .= "X-Priority: 3 \r\n";
            mail ($ymail,$sub,$msg,$header); 
            echo '<div class="ok">شكرا تم الارسال ، وسنرد عليك في أقرب وقت </div>';
        }//else Maail
    }// start IF       
    else
    {
        $name "";
        $id "";
        $mail "";
        $tel "";
        $sub "";
        $msg "";
    
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>ارسل شكواك</title>
<style type="text/css">
.auto-style11 {
text-align: left;
margin-right: 425px;
}
.auto-style12 {
margin-right: 17px;
}
.ok {
  background: #95C5DF;
  text-align: center;
  padding: 30px;
  margin:50px;
  color: #C92206; margin: auto;  width: 25%;
  font-size:18px;
  height:50px 
}
.no {
    background:#F57575;
    text-align:center;
    padding: 20px;
    margin:50px;
    color:#000; margin: auto; width: 15%; font-size:18px;
   height:50px 
}
.auto-style23 {
margin-right: 3px;
}
.auto-style24 {
margin-right: 131px;
}
.auto-style28 {
margin-right: 51px;
}
.auto-style32 {
margin-right: 250px;
}
.auto-style33 {
margin-right: 77px;
}
.auto-style34 {
margin-right: 110px;
}
.auto-style35 {
margin-right: 120px;
}
.auto-style36 {
margin-right: 90px;
}
</style>
</head>
<body style="padding:0px; margin:0px">
    <div id="container" style="height: 728px; width: 1000px;padding:0px; left: 0px; top: 0px;" >
<div id="div1_div_right2" style="border-style: none; border-color: inherit; border-width: 0px; background-image:url('images2/TITLES.png'); background-repeat:no-repeat;height:728px; margin-right:0px; margin-left:0px; margin-top:5px; margin-bottom:0px; left: 0px; top: 0px; width: 1000px; padding:0px">
<div id= "div1_div_right2" style="height: 48px;width:1000px;margin:0px">
</div>
<div id="div1_div_right2" style="margin-top:20px;padding:0px;  top:-15px; width:1000px; background-color:#f4f4f4; height:661px; font-family:'Droid Arabic Kufi'; color:#51c0f3; left: 0px;" class="auto-style23">
<h1 style="margin-top:10px;padding-top:10px;padding-right:30px;float:right; width: 68px;" class="auto-style11">
راسلنا</h1>
 <form action="complains3.php" method="post" style="position:relative;direction:rtl;height: 571px; width: 640px;margin-right:150px;float:right" >
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">الاسم</label>
<input type='text' value="<?php echo $name?>" name='name' style="padding:0px;height:25px;width: 349px; margin-top: 0; margin-bottom: 0;" class="auto-style24" />
<br style="height:20px" />
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">رقم العميل</label>
<input  type='text' value="<?php echo $id?>"  name='id' style="padding:0px;height:25px;width: 349px; margin-top: 0; margin-bottom: 0;" class="auto-style36" />
 <br style="height:20px" />
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">البريد الالكتروني</label>
<input type='text' value="<?php echo $mail?>" name='mail' style="padding:0px;height:25px;width: 349px; margin-top: 0; margin-bottom: 0;" class="auto-style28" />
<br style="height:20px" />
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">رقم التليفون</label>
<input type='text' value="<?php echo $tel?>" name='tel' style="padding:0px;height:25px;width: 349px; margin-top: 0; margin-bottom: 0;" class="auto-style33" />
<br style="height:20px" />
<label style="margin-top: 0px;margin-right:0px;margin-left:0px;padding:0px">الموضوع</label>
<input value="<?php echo $sub?>" type='text' name='sub' style="color:maroon;height:25px;width: 348px; font-size:16px" class="auto-style34" />

<br style="height:20px" />
<label style="margin-top: 0px;margin-right: 0px;margin-left:0px;padding:0px">الرسالة</label>
<textarea name="msg" rows="8"style=" width: 347px" class="auto-style35" ></textarea>
<br /><br />
<input type="submit" name="send" value="ارسال" style="width: 70px;color:#14538a;font-weight:bold;font-size:14px;font-family:'Droid Arabic Kufi';height: 41px;background-color: #96C6DF;" class="auto-style32" /> &nbsp;
<input type="reset" value="مسح" style="width: 70px;color:#14538a;font-weight:bold;font-size:14px;font-family:'Droid Arabic Kufi';height: 41px; background-color: #96C6DF;" />
</form>
</div>
</div>
</div>
</body>
</html> 
الرد }}}
تم الشكر بواسطة: نسيم , derham , derham
#25
اخي محمد كريم الكود يعمل الآن جيدا  ولا يفرغ الخانات الممتلئة لك كل الشكر
الرد }}}
تم الشكر بواسطة: محمد كريّم , derham
#26
الحمد والشكر لله
تحاياي
الرد }}}
تم الشكر بواسطة: derham
#27
السلام عليكم 

الحمدلله البرنامج يعمل بنجاح ويقوم بارسال الرسائل 
لكن من فضلك لدي استفسار أريد أن أجعل الراسل يكون نقس الايميل الذي يدخله مدخل الشكوى   $mail 

 وليس الايميل الخاص بالسيرفر مستضيف صفحة ال php الخاصة ببرنامج اتصل بنا فهل يمكن هذا
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
Wink مشكلة في سكربت تسجيل زوار naser138 1 1,518 03-04-21, 01:34 AM
آخر رد: oneyemenweb2
  مشكلة في لوحة تحكم موقع m4n2net2000 1 1,393 09-09-20, 11:00 PM
آخر رد: kiki
  ما مشكلة هذا الكود HTML ارسال رسالة الي البريد الالكتروني ؟ PeterGhattas082460 1 1,649 15-10-19, 05:02 PM
آخر رد: elgokr
  [كود] مشكلة مدوختني فراس الغزي 3 2,239 23-09-18, 01:25 PM
آخر رد: elgokr
  عندي مشكلة أن ماحد يقدر يفتح موقعي 0theghost0 0 1,590 13-10-17, 07:51 PM
آخر رد: 0theghost0
  مشكلة بالدخول الى local host yasmeen azar 1 1,971 14-06-17, 01:25 AM
آخر رد: Amir_Alzubidy

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


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