Thursday 26 May, 2011

Lesson 2 : Some core PHP basics

Retweet this button on every post blogger
1. PHP is a case sensitive server side programming language.
2. PHP provide  browser native language support.
3. PHP is truly dynamic , object oriented programming language.
4. like browser script PHP provide value type variables, means you do not have to declare any data type declaration.
5. extension for PHP file is .PHP.

Memory locations and operators :-
1. All memory locations start with $ sign e.g. $_age, $age, $name1, $name2.
2. There is no datatype in PHP , it takes its datatype at runtime automatically and count them in bytes.
an example for  above  exlplain concept
<html>
<title>PHP</title>
<body>
<?php
$v1=20; $v2=30;

$sum = $v1+$v2;

echo $sum;
?>
</body>
</html> .  
PHP allocates 2 bytes of memory for $v1=20 and same 2 bytes for next $v2 variable.



Lesson 1 : Setting up the enviroment

Retweet this button on every post blogger
Download XAMPP from http://www.apachefriends.org/en/xampp.html
1. Using the installer version is the easiest way to install XAMPP.


2. After the installation is complete, you will find XAMPP under Start | Programs | XAMPP. You can use the XAMPP Control Panel to start/stop all server and also install/uninstall services.




from the above control panel  you can start or stop any  of the four services, this installer will assign port 80 of your computer as apache service for http server if the port is not null (assign to other services such MS IIS server) then you have to manually change the port of http server to the port of your interest the procedure fro that is as follows : 
1. go into in your XAMPP installation derive (your derive):\xampp\apache\conf 
2. locate httpd.conf and do the following
    a. change Listen 80 to Listen 8080 OR any open port your PC.
    b. change ServerName localhost:80 to ServerName localhost:8080.
    c. save the file .
3. stop the apache services once for a while a restart it again.
4 and the last check type in browser localhost:your port number e.g localhost:80 localhost:8080  


these steps has changed the port as you specified in the above operation.


                                            after selecting your language it will look like this 

   
there you are you have just completed installation  XAMPP on your PC and your are ready to build some interesting applications. 
 PHP version is 5.3.5
Mysql mysql 5.5.11.