Archive for the ‘php’ tag
دورة برمجة ويب -Web Development course
السلام عليكم و رحمة الله و بركاته ..
بعد طلب كتير من الجماهير الغفيرة و لأني مش عارف ليه إشتقت فجأة لإني أشرح .. أنا هبدأ دورة ويب جديدة سريعة في المنصورة .. قريب جدا جدا إن شاء الله غالبا في خلال ١٠ أيام..
المواضيع الرئيسية في الدورة ..
- HTML
- CSS
- Javascript
- PHP
- OO PHP Programming
- MySQL
- AJAX
مدة الدورة هتبقى ٦٠ ساعة و مرتين في الإسبوع و المرة الواحدة ٥ ساعات يعني من شهر ونص لشهرين..
لو حابب تشترك في الدورة إضغط الرابط التالي:
في شباب بالفعل إشتركوا ودول مش ضروري يملوا الإستمارة لكن لو دخلوا تفاصيلهم ده يبقى أحسن برده ..
و عموما أنا -إن شاء الله- هبعت بريد لكل المنتسبين للدورة في أقرب وقت ممكن فيه تفاصيل الدورة ..
والله الموفق
Singleton mySQL database connection using PHP
فيما يلي مثال على الـ Singleton Design Pattern
و هو ما يعطيك الإمكانية في الحصول علي فقط نسخة واحدة من أي مورد تريد إستخدامه .. في هذة الحالة مثلا الإتصال بقاعدة البيانات و ذلك بأن تستخدم الدالة getConnection بدلا من عمل نسخة جديدة من connection كل مرة هتحاول فيها الإتصال بقاعدة البيانات..
Following is a brief example for the singleton design patterns which will enable you from having only one instance of the resource you are controlling .. in this example it’s the mySQL database connection.
Else you will have multiple instances of the same class “connection” each time you want to connect.
define('DB_NAME', "test");
define('DB_USER', "root");
define('DB_PASS', "rootpass");
define('DB_HOST', "localhost");
class Connection{
private static $connection_;
private function __construct(){
$con = mysql_connect(DB_HOST, DB_USER, DB_PASS);
mysql_select_db(DB_NAME, $con);
Connection::$connection_ = $con;
}
public static function getConnection(){
if( !Connection::$connection_ )
new Connection;
return Connection::$connection_;
}
}
$con = Connection::getConnection();
في رعاية الله و أمنه
Survival..
السلام عليكم و رحمة الله وبركاته
Last 2 weeks
I was working last 2 weeks -between Cairo and Mansoura- for tadabborIT, for tadabbor website next release, also I’ve attended the JDC2010 conference and through that week I should have read about 4 reading tasks and should have solved tasks by Design patterns course by my dear mentor Ahmed Soliman, while planning to join GSoC.
Not to mention the courses and websites I’m delaying and canceling ..
And here I’m defining a new busyness level ..
One note before i go: If i survived that stage, I think I’ll be much more stronger than what I used to be, I also believe that It should be a milestone.
Anyway, I believe I can try
TDD using PHPUnit, NetBeans
السلام عليكم و رحمة الله وبركاته
This post is more than month on my drafts ..
It’s about using NetBeans 6.7.1 PHP IDE with PHPUnit I wanted to show how easy is it to make a test and run it ..
so I’ll share the experiment ..
As shown in the following slideshow:
1-I created a PHP Class file:
2-I created empty file with a class and couple of methods
3-I generated a test for the class and it prompted me to choose the folder where I’ll put the tests
4-Finally(My favorite part) I right click the test file to run it and I get the result in green and red … obviously
green is test passed or pending and red if it’s failed ..
Note: I used to use simple test , still can’t find equivalent test method to test the HTML interface … and it always required me to view the test results in the browser ..
PHPUnit is more fun now and it’s integrated to NetBeans, the IDE I recently love at most specially on Mac
tadabor.com, one more 7-12 website
السلام عليكم و رحمة الله وبركاته
الحمد لله والصلاة والسلام على رسول الله
أنه لمن دواعي سروري ان أعلن إني فعلا فخور بموقع الهيئة العالمية لتدبر القرآن الكريم
و شكرا لـ:
My dear framework 7-12
م.محمد العشري مدير شركة تدبر
وشكر خاص جدا .. لماهر سيف “الماهر بأمر الله ” اللي بهدل ٧-١٢ ![]()
فريق التصميم في شركة تدبر و مهندس علاء الدين حسين .
وأسأل الله العظيم رب العرش العظيم أن يجعل الموقع و المواد المتاحة عليه في ميزان حسناتنا وميزان حسنات الشيوخ القائمين عليه و الهيئة وأن ينفع الله به الكثير من الباحثين عن الهداية و طلبة العلم من المسلمين والمسلمات.. اللهم آمين .. اللهم آمين .. اللهم آمين ..
والحمد لله رب العالمين
XML, The eXtensible Markup Language
السلام عليكم و رحمة الله و بركاته
Lately, I’m interested in making more semantic web applications or at least applications that has XML meaningful output instead of XHTML or HTML..
Also I’m interested in MVC design pattern and the CRUD scaffolding technique had a great impact on my productivity, My Framework 7-12 used to create the Model View and the Controller for me automatically .. the view file used to be HTML, which also was so complicated and dependent on my theory of web design,.. which isn’t always compatible with others ..
So, here again the Meaning<->Presentation separation idea appears again ..
One more thing was going in my head … which is XML Data islands, which is IE ONLY feature ..
Basically it’s how to bind a XML data source to your HTML keep the design attached to that source fields as long as it’s XML even if it was a dynamic ie. PHP file that send XML in response ..
After thinking on how to reach my destination I decided just to format my views XML and style them CSS and not XSLT..
And may be I’ll use XForms .. !!
And still thinking …