Skip to main content

PHP Tutorial - Lesson 1: Introduction to PHP - Part II

First Program In PHP


<?php echo “Hello World, This is My First application in PHP”;
?>
Notes:
Each PHP script should be enclosed within <?php and ?>
<?php tells the browser that the upcoming lines are PHP script, so PHP interpreter will start its job of translating the code.
?> tells the browser that this is the end of the php script. Which means that the interpreter has reached end of the script.
echo used to print anything you want on the web page.
If we want to print constant strings like our previous example “hello world…” it should be enclosed within single/double quotes.
Semi colon: each php statement should be ended with semi colon, which tells the interpreter that this is the end of the statement to be executed. If we don’t end statements with semi colons compilation error will occur, and no output will appear. 
Run PHP Script

To run the previous script of php, and any php script we must follow these steps:
-  Save the script in file with extension .
php for example anas.php
- Upload it to a server that supports PHP language. (for example: AppServer).
- In order to run it, start your internet explorer, type in the address bar http://localhost then determine port number for example, suppose your server installed on port number 81 then type: http://localhost:81/
- then determine the directory that you saved this script on it. then hit go. 

PS, download this lesson as PDF file from here: PHP Tutorial - Lesson 1: Introduction to PHP - Part II

Best Wishes,
Anas Jaghoub

Comments

Popular posts from this blog

سلسلة تعلم برمجة تطبيقات الاندرويد – إنشاء أول تطبيق للاندرويد – الحلقة رقم 2

تحدثنا في الحلقة السابقة عن إعداد بيئة العمل، وأهم الأدوات والحزم اللازمة للبدء في تطوير تطبيقات لنظام التشغيل الاندرويد. سنتحدث في هذه الحلقة عن كيفية إنشاء تطبيق للاندرويد، وما هي مكونات تطبيق الاندرويد والبنية الهيكلية ﻷي تطبيق على الاندرويد. إنشاء تطبيق باستخدام بيئة العمل Netbeans : 1. اضغط على قائمة File 2. اختر New Project. 3. اختر نوع المشروع Android 4. اضغط زر Next. 5. اضبط إعدادات المشروع كالتالي: Project Name: اسم المشروع، يفضل أن يكون اسم المشروع هو نفس اسم التطبيق وذلك لتمييزه عن باقي المشاريع الأخرى Package Name: اسم حزمة المشروع، وهنا يجب اتباع قواعد تسمية الحزم في لغة Java إذ يجب أن تتكون من مقطعين على الأقل ويفصل بين كل مقطع بنقطة، ولا يوجد فراغات. Target Platform: رقم نسخة نظام التشغيل الاندرويد التي يدعمها هذا التطبيق، وهنا لا بد من اختيار أقل رقم يتوافق معه هذا التطبيق لمزيد من التفاصيل شاهد الصورة التالية: 6. اضغط على زر Finish وهكذا نكون قد أنشأنا بمساعدة بيئة العمل Netbeans أول تطبيق للأندرويد حيث تم تصميم هيكل التطبيق، واستدعاء كافة ال...

سلسلة تعلم برمجة تطبيقات الاندرويد - إعداد بيئة العمل - الحلقة رقم 1

في هذه الحلقة سنقوم بتجهيز بيئة العمل، وإعداد كافة الأدوات والبيئة اللازمة للبدء في برمجة تطبيقات الاندرويد، لنتمكن في الحلقات القادمة من العمل والتطوير باستخدام الأدوات التي سنقوم بإعدادها في هذه الحلقة. 1. للبدء في تطوير أي برنامج على الاندرويد لا بد من توفر حزمة التطوير الأساسية وهي Android SDK . هذه الحزمة هي حجر الأساس لعمل أي تطبيق على الاندرويد حيث تحتوي على مجموعة كبيرة من الوظائف الاساسية والبرامج التي تمكننا من التحدث مع نظام التشغيل الاندرويد، وطلب تنفيذ العمليات والحسابات إلى غيره من الوظائف بحسب طبيعة كل تطبيق ووظائفه. وتمكننا أيضا من إنشاء أجهزة افتراضية Virtual Machines تساعدنا على تجربة التطبيقات حتى بدون وجود جهاز اندرويد  2. حزمة الجافا JDK والتي تقوم بترجمة النص البرمجي لحزمة الاندرويد وكذلك النص البرمجي للتطبيق وتحويله إلى نسخة تنفيذية قابلة للعمل على أي جهاز اندرويد 3. بيئة العمل IDE وفي هذه السلسلة سنقوم باستخدام Netbeans وذلك لسهولة استخدامه وسهولة التطبيق عليه. كما يمكن أيضا استخدام بيئة العمل Eclipse . ولغايات تبسيط هذه الحلقة و...

Web Development Best Practices (PHP Best Practices)

Websites development is one of the most challenging projects ever to develop, according to the large number of components you deal with, integrate, and manage in your application. For example, most web projects Deal with databases as their data source, and I ntegrate with external services called web services and APIs. As well the application M anages its own objects and components from views to models to controllers to plugins and so on. A skilled web developer should have a great/deep knowledge in most of components used in his system, and as well should ha ve intensive focus on how each component work and how can be used, what can be done, and what cannot. On the other hand, the huge amount of requirements, components to manage, and time frame given to you to accomplish your mission, and number of people in your team, all these factors together requires from you to organize your tasks, and priorities your requirements, do deep analysis and planning in order to have a hi...