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

PHP Tutorial–Guest Book–System Definition and Requirements

In this lesson I’m going to illustrate the system definition and requirements for the Guest Book application. It is an important step in developing any application, since this step gives us an orientation about the system and its functionality, what is expected from the system to do. actually the system definition comes from keywords from customers and end users, usually try to make it clear for what they need in the application, and what they expect the system to do.  As developers it is our role to define the requirements for the system to be developed. In our example the system definition for the Guest Book is: A system that allows visitors of the site to post their comments and feedbacks about the site, with the possibility for managing comments and maintain it easily and user friendly. On the other hand, the system requirements are: a web server, since it is clear that the developed system is going to run on the Internet, so it is a web-based application not windows-bas...

تعلم تطوير تطبيقات للموبايل باستخدام الأندرويد

مرحبا أصدقائي يسعدني أن أبدأ معكم سلسلة حلقات في تعلم تطوير تطبيقات للموبايل باستخدام الأندرويد ، وسأسعى جاهدا معكم في أن تكون هذه السلسلة من أوائل السلسلات في اللغة العربية لتعليم برمجة تطبيقات الأندرويد من البداية وحتى الاحتراف. وسأحاول قدر المستطاع الشرح بلغة عربية بسيطة ومفهومة. حيث ستكون غدا إن شاء الله الحلقة الأولى من تعلم تطوير تطبيقات الموبايل باستخدام الأندرويد. أنس الجاغوب Twitter: @anasjaghoub Facebook: anasjaghoub

AABU GTUG Opening Event

On February 17, 2011 We’ve headed to Al Al Bayt University, to run one of the biggest event established there, for opening the AABU GTUG (Google’s Technologies Users Group). The event focused on introducing the GTUGS (Google’s Technologies Users Groups) and introducing Google’s technologies to students, such as Android and App Engine, to Chrome Extensions and HTML5 demos. Attendees exceeded 250 attendee, in addition to Vice president of Al Al Bayt University Dr. Hashem Al Masaeed, Deanship of College of I.T at Al Al Bayt University Prof. Ismail Ababneh, and a quite number of professors and teachers at the college of I.T at AABU, in addition to Yarmuk fm and Al Ro’aya  tv. AABU GTUG as a Google’s Technologies Users Group interested in Google’s technologies and tries as possible to increase students awareness about Google’s technologies, and introduce it to them. Their was a lot of activities during the event, beginning with the key note from me Anas Jaghoub, that included introducin...