SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Simple scripts in php for beginners

Here are some php scripts for beginners to try and practice some simple codes to learn the login and program flow. If you have prior experience of any other programs like C, C++ etc then you can easily understand the program flow and the syntax.

In PHP like any other language there are loops, conditions, functions to manage the script. We will be using these functions or syntax to get our desired output. When we use these functions in our tutorials we will keep a hyper link to the tutorial about the particular function. To get the full details about the functions in use visitors can visit those links.

Let us start with our first PHP code. Copy the file below to note pade or any other editor an save at root of your localhost or web site as test.php . Then open this page in your server. ( You can read how to open default page of a site here)

<html>

<head>
<title>The first PHP code Hello world</title>
<META NAME="DESCRIPTION" CONTENT="Demo of first PHP code Hello world ">
<META NAME="KEYWORDS" CONTENT="PHP code, sample code, demo PHP">
</head>

<body>

<?Php
echo "Hello World";
?>


</body>
</html>



You should get Hello Wrold

PHP codes are case sensitive . Take care that you don't mix lower and upper case syntax.

Every script has two parts, one is about the requirement and the other part is abut the solution. Visitors are requested to first try on their own without visiting the second part for the solution.

Printing all the numbers between 1 to 50
Printing all the even numbers between 1 to 50

Php code is kept inside <? and ?> tags , howerver we should start php code with this <?Php and ending tag with ?>
PHP codes are case sensitive . Take care that you don't mix lower and upper case syntax.
Wile linking files or images take care of cases as in many servers file name and its extensions are case sensitive.

What is that echo command inside code block?
How you will print two strings by using single echo command?

Let us learn how to print strings by using echo command



Further readings
Introduction to PHP: How scripting languages work
PHP beginners guide
echo command & escape character for string outputs
Adding delay to the script execution time by using sleep function
Disabling a part of the code by using comments in PHP
Printing Numbers 1 to 50 to screen
PHP Info: Details on PHP script settings & installation at server end
php_uname: Server OS details
PHP.ini file: PHP server configuration setting file for Edit or update
ini_get: PHP function to get configuration settings from php.ini file
ini_set: PHP function to change the configuration settings of php.ini file
PHP Version : What is the version of PHP running at the server
Installing PHP on windows server and IIS
Installing PHP5 on windows server and IIS
Setting up PHP in Windows Vista OS to run in IIS7 web server
Configuration of IIS7 to run PHP scripts with ISAPI module
Extension directory of PHP to store dll files for windows
Error messages Display off or On by using display_errors function in php.ini file
Using HTML inside PHP script, displaying tags

swe26-12-2008
this tutorial is very good.........
bharathikannan12-02-2009
i am the beginners of php.
Jaya Devan T21-07-2009
Its good!!!
Yoni30-01-2010
Informative for begginer
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

Join Our Email List
Email:  
For Email Newsletters you can trust
Basics
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2013 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer