PHP Basic Code

After Setting up the php development environment open your Operating system Text editor or you can download from the  internet which support syntax highlighting if you are using windows you can download notepad++ but if you are using MAC then you can download komodo  you can download the free version after downloading the text editor open it up and create a new PHP file to create a new php file go to the file menu and select new and choose .php after doing this you may have a new work-space for writing php code.Write this line of code <?php echo “php programming”; ?>

in this code i have use a php tag (<?php?>) remember php code is written in side a php tag,in side the tag i have written echo which will echo it back to screen and inside quotes i have written a string which is php programming and semicolon which means the end of the statement so save the file in WWW directory(if you don’t where is www directory it is located in C:/Wamp/WWW IN MAC it is located at local hard-rive/user/sites ) and name it test, after that open your web-browser and write localhost/WWW/test.php then you would see php programming as result.


Installing PHP on Mac OSX

To install php on mac osx fallow the fallowing steps

  • download all in one pack from mamp .
  • install it in to mac set the  web browser and server to localhost.
  • restart the Computer.
  • after restarting start the mamp server when mamp server is started click on start to strat all the services that is provided with mamp.
  • open your mac web browser and type local host to check every thing is working properly.

Installing PHP on Windows

To run php on the computer we need to install php to download php visit the website here

download it and install php on to your machine the next thing is to set up a server, to set up a server we need to download it visit the website and download apache here 

Install it in to your computer and set the server to localhost. restart your computer after restarting start the Apache web server and php. to check that every thing is working properly open you web-browser and type localhost at the search bar if  ti open a web page which give you info about php that means everything is working,There  is also an easy way to install php and Apache and also mysql in one pack this pack is called wamp server to download it visit this website here

Download it and install it into your windows machine after that restart your computer after restarting start the wamp server you will see a menuu tray icon click on it  and then click on start all services after that click on localhost then your web browser will popup remember that choose the web browser in the installing process and also  remember to set the server to localhost.

if you did every thing properly then it would show the information about wamp server.

What is php ?

PHP is a server side scripting language to make dynamic websites pages and it is one of the firs server side scripting language to be imbedded  in HTML code PHP is installed on more than 20 million Web sites and 1 million Web order run php on the computer or server the user needs to Download and install php into there machine, php is complied in to HTML code so the web-browser can understand.php stand for Hypertext Preprocessor, php use html tags and the syntax of this language is very smiler to java script and action-script.the following code is written in php.

<title>PHP programming</title>
<?php echo “PHP Programming”;  ?>

note that php always start with a php tag (<?php?>), the php code stop at the end of the tag.

What is an LED?

An LED is light emitting diode used to produced light in different color a common led use’s 3 Volt

to produce light, a good thing about led is that they last longer up to 30%  then any other light bulbs and uses 10% of the power.led comes in many different shape’s, size’s and color an led has two terminal for positive and negative current if  you connect the positive terminal to an negative one it wont light up so you need to connect it in the right way so it light’s up,the symbol of an led look’s like this

the symbol of an led is the same of an diode the only difference is the two aero is pointing in upward direction sometimes there is one aero  but that doesn’t matter if the user know that is an led in fallowing diagram you can see the terminal and the inner part’s of an led the longer terminal represented as anode is positive and the shorter terminal represented as cathode is negative so if you provide the current in this order it would light up other wise it led chip is basically a Diode which has two end points one for + & – , when the diode lights up the lens focus the light in the up direction, the first LED was made in the back in the 1907 , it uses silicon carbide to produce light the person attach an positive lead at the end of the silicon carbide and attach a needle and then touched it to silicon carbide so he can get a bright Spot.

lets make something that lights up

this is a very simple circuit to build the it uses a resistor of 100 ohm and 5 volt battery connect every thing in place and it would light up.


A Transistor  is semiconductor material made up of silicon it is used in two different ways to amplify current and to switch current on and off, for example to convert a small amount of sound into a much larger one we would use transistor to amplify the current but to switch a current on and off is different way to handle the current a Computer micro-processor use million of tiny transistors together to perform much higher complex functions such as processing displaying information.Visually transistor can be classify into two groups depending upon the volume,Small signal transistor to handle low power application and, Power Transistors to perform higher power application.Every transistor has three terminals.

There are also two types of transistor depending on the inner structure and how they controlled the current they are Bipolar junction transistor & Field effect transistor.

Field effect transistor or FET for short  FET are controlled by voltage and use no input Current,there are two types of FET that you may run into are JFET and MOSFET.


Bipolar junction transistor or BJT for short bipolar are controlled by applying current to the base terminal which then controls the flow of charge between the collector and the emitter the aero in the transistor indicates the direction of the positive charge flow,FET and Bipolar are available in two Types NPN & PNP,a npn bipolar is a switch whic is open it wont conduct until current is applied in the base terminal and pnp works in the oppsite way of NPN.

Lets make something ?

this is an joule theif  it is a very useful gadget and very low cost circuit to build it takes small amount of current and convert into much larger one to light up the led.