Gringotts

Tag: Open Source

PHP:server-side scripting language

by sanchitgulati on Oct.02, 2009, under Open Source, php

PHP, stands for PHP: Hypertext Preprocessor, is a widely used, general-purpose scripting language that was originally designed for web development, to produce dynamic web pages. It can be embedded into HTML and generally runs on a web server, which needs to be configured to process PHP code and create web
page content from it.You can read more from wiki.

To learn php,you would require to install Apache, MySQL, PHP on your local machine.
If using Windows : Install AppServ or Wamp . ( Appsevr for no0bs)- ( Latest Stable release for AppServ 2.5.10)
If using Linux : Install lamp ( Linux Apache Mysql Php )

Further Tutorial are guided according to Appsevr installation.

Step 1.
Tutorial on this link is self explaining.

Step 2.
Checking the installation:

Open firefox or any other broswer and typie localhost in address bar ( this is the space where you type facebook.com )
If you see the html page with “The AppServ Open Project – 2.5.10 for Windows”,then congrats.
Open “http://localhost/phpinfo.php” to know more about php-server installed.

Step 3.
Appsevr store all public html files “C:\AppServ\www\” – Default Location

Step 4.
Create a new file in the above folder with extension php , example hello.php ( Not hello.php.txt)
Edit the file using Notepad and type in the following code
<html>
<body>
<?php
echo “Hello World”;
?>
</body>
</html>

Step 5.
In your broswer open “localhost/hello.php”
You should be seeing a html page with “Hello World”.

Basic PHP Syntax
A PHP scripting block always starts with <?php and ends with ?>. A PHP scripting block can be placed anywhere in the html document,as you can see in example above.

OUTPUT
`echo` is used for printing strings or variable,similar to printf() or cout in c/c++ .
Also,
echo (“Hello World”);
printf(“Hello World”);

INPUT
As php is server-side scripting language it doesn’t not take inputs like c/c++ but accepts arguments in the form of GET or POST .Which is out of the scope of this tutorial. #WaitForOurWorkshop

VARIABLE
All variables in PHP start with a $ sign symbol and carries no datatype,So we don’t need separate variable for int,float or char.
<?php
$strg = “Hello World”;
echo (“$strg”);
$x=16;
echo $x;
?>

FURTHER LESSONS

Operators,If…Else,Switch,Arrays,While Loops,For Loops,Functions are similar to c/c++ you can learn about them on http://www.w3schools.com/PHP/

IDE (Integrated development Enviroment)

There are many open source as well as proprietary software available for easy development of php scripts.Notepad++ or PHPeclipse (Plug-in to Eclipse) works great on windows or you can spend thousands for Adobe Dreamweaver, which is the best option available to industry as of now.For linux machine try gPHPEdit or Codeblocks

LINUX INSTALLATION
Blog on how to install and configure LAMP on linux machine will follow shortly.Atleast I hope so.

DOUBTS AND QUERY

You can ask any doubt on php or any other open source technology on http://cuclante.com/forum/

3 Comments :, , , , , , , , more...

What is Open Source : Introduction

by mage on Aug.31, 2009, under Open Source

Well many people don’t know about it… they know that cuclante is about it but don’t really know it.

This blog post will clear your doubts :)

What is Open Source :

Well open source is a form of technology, its main aim is to provide source code of the softwares that we use daily, so that it can be used by contributors to develop it more and according to users need and security. As the name says the source code is open.

Why should i use Open Source :

If you are an end-user, nothing can be better for you. All your daily needs application are available for free, plus because of open contribution a lot of programmers are working on it, leading to a good end product.

I mean firefox is open source its free and its better than internet explorer. VLC is open source and is a favouriate of all isn’t it ;)

If you are a developer, you get to show your ability in application writting. taking an example, if im good at writting security for applications then i can contribute same code to many softwares. It gives me the freedom to write codes, what i want and for whom i want. Im not bound to a superior guy forcing me to develop an applet of which i have no information about.

Open Source and World :

Well Open Source has spread a lot lately, Google has shown surprisingly huge response in Open Source. All its latest applications are open source (chrome browser, android OS, Chrome OS). Apple uses most of the Open Source apps in its OSX… being frank it is the best company to optimise open source to the fullest.

Open Source Addiction :

Well once a person starts using open source technology, he becomes a fan of it… and this technology fantasises him so much that he keeps on going into it ;)


Open Source and India :

A good example of an open source s/w from india is Maya-Vi (developed by IIT).

Various organisations support Open Source technologies in india, primarily being OSScamp, Barcamp, OSScube you can google them and be a part of it.

Leave a Comment :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...