منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
مشكلة في كود اتصل بنا - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم برمجة وتطوير المواقع (http://vb4arb.com/vb/forumdisplay.php?fid=51)
+--- قسم : قسم PHP (http://vb4arb.com/vb/forumdisplay.php?fid=58)
+--- الموضوع : مشكلة في كود اتصل بنا (/showthread.php?tid=15462)

الصفحات: 1 2 3


RE: مشكلة في كود اتصل بنا - نسيم - 14-04-16

(14-04-16, 04:43 PM)محمد كريّم كتب : عندك قوس ناقص فوق
if(empty($name) or is_int($name))
أضف
{


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

نعم


RE: مشكلة في كود اتصل بنا - محمد كريّم - 14-04-16

هل عمل الكود الآن
طيب طالما الكل في ملف واحد ليش ما عطيتني الملف كامل مرة واحدة بدل ما كل مرة تعطيني كود مرة html ومرة php
انا حتى الان لم اعرف هل html موجود في ملف complains.php والا في ملف اخر


RE: مشكلة في كود اتصل بنا - نسيم - 17-04-16

(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>


RE: مشكلة في كود اتصل بنا - محمد كريّم - 17-04-16

اولا تاكد ان اسم الملف هو  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> 



RE: مشكلة في كود اتصل بنا - نسيم - 18-04-16

اخي محمد كريم الكود يعمل الآن جيدا  ولا يفرغ الخانات الممتلئة لك كل الشكر


RE: مشكلة في كود اتصل بنا - محمد كريّم - 18-04-16

الحمد والشكر لله
تحاياي


RE: مشكلة في كود اتصل بنا - نسيم - 09-05-16

السلام عليكم 

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

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