استعمل مربع البحث في الاسفل لمزيد من المواضيع
سريع للبحث عن مواضيع في المنتدى
-
11-01-2013, بتوقيت غرينيتش 02:32 PM
#1
[كلاس] اتصل بنا | لا تضيع وقتك
[ظƒظ„ط§ط³] ط§طھطµظ„ ط¨ظ†ط§ | ظ„ط§ طھط¶ظٹط¹ ظˆظ‚طھظƒ
بسم الله الرحمن الرحيم
بفضل الله سويت كلاس اخر لى
بعد كلاس الاتصال بقاعدة البيانات
اريد نقدكم بالنسبة للكلاس
هذا هو الكلاس مع الشرح طريقة
رمز PHP:
<code style="white-space:nowrap"> <code>
<?php
/**
* @author dr-support
* @copyright 2014
*/
class contact {
public $name ;
// the name oh the sender
public $email;
// email of the sender
public $message;
// the message
public $des ;
// design of the form
public $error_mes ;
// the error_message
public $succes_mes ;
// the succes message
public $send_to ;
//
public $name_mes;
//
// this function to check the var about in empty and sec it ..
function check ($var)
{
if($var ='')
{
echo $this ->error_mes ;
exit;
}
$var = trim ($var);
$var = strip_tags($var);
return $var ;
}
// this function to send the message ..
function con ($name,$email,$send_to,$name_mes,$message,$des,$error_mes,$succes_mes)
{
$this ->name = $name ;
$this ->email = $email ;
$this ->message =$message ;
$this ->des = $des ;
$this ->error_mes = $error_mes ;
$this ->succes_mes = $succes_mes ;
$this ->name_mes = $name_mes ;
$this ->send_to = $send_to ;
//
if ($_POST == 'submit')
{
$name = $_POST['name'];
$this ->check($name);
$email = $_POST['email'];
$this ->check($email);
$message = $_POST['message'];
$this ->check($message);
$send_to = $_POST['send_to'];
$this ->check($send_to);
$name_mes = $_POST['name_mes'];
$this ->check ($name_mes);
$headers = "From: $name\r\n";
$headers .= "Content-type: text\r\n";
if(mail ( "$send_to" , "$name_mes" , "$message" , "$header" ))
{
echo $succes_mes ;
}
else {
echo $error_mes ;
}
}
else{
if (file_exists($des))
{
include"$des";
}
else "error";
}
}
}
// for use it ,,
$drsupport = new contact ();
$drsupport ->name = 'dr-support' ;
$drsupport ->email = '[email protected]';
$drsupport ->message = 'i love php';
$drsupport ->des = 'form.html';
$drsupport ->error_mes ='oooops ! you must complete all the feilds';
$drsupport ->succes_mes ='message sent succesufly';
$drsupport ->send_to = '[email protected]';
$drsupport ->con();
// other method ..
$drsupport = new contact('dr-support','[email protected]','i love php','form.html','oooops ! you must complete all the feilds','message sent succesufly','[email protected]');
$drsupport ->con();
// my best wishes ,,
?> </code> </code>
الكلاس وبكل بساطة
اثناء عمل اسكرب كبير او صغير
لن يوجد وقت لتضيعو فى اشياء سهلة بعض الشىء
يجب ان تكون جاهزة معك
فقط عليك ان تمرر لها الاشياء اللازمة لعملها فقط
----------------
شو هالكلام الكبير

----------------------
نبى نقدكم قبل مدحكم
سلام عليكم

©المشاركات المنشورة تعبر عن وجهة نظر صاحبها فقط، ولا تُعبّر بأي شكل من الأشكال عن وجهة نظر إدارة المنتدى©
المواضيع المتشابهه
-
بواسطة walid في المنتدى قسم السنة أولى ثانوي
مشاركات: 0
آخر مشاركة: 11-04-2013, بتوقيت غرينيتش 06:12 AM
-
بواسطة salima في المنتدى التعليم الإبتدائي
مشاركات: 0
آخر مشاركة: 11-03-2013, بتوقيت غرينيتش 03:54 AM
-
بواسطة salima في المنتدى التعليم الإبتدائي
مشاركات: 0
آخر مشاركة: 11-03-2013, بتوقيت غرينيتش 12:24 AM
-
بواسطة walid في المنتدى المطبخ الجزائري
مشاركات: 0
آخر مشاركة: 11-02-2013, بتوقيت غرينيتش 05:53 AM
-
بواسطة Chakira في المنتدى تقنيات المواقع SEO و XML و RSS و محركات البحث و الأرشفة
مشاركات: 0
آخر مشاركة: 11-01-2013, بتوقيت غرينيتش 09:58 PM
ضوابط المشاركة
- لا تستطيع إضافة مواضيع جديدة
- لا تستطيع الرد على المواضيع
- لا تستطيع إرفاق ملفات
- لا تستطيع تعديل مشاركاتك
-
قوانين المنتدى