Thursday, August 8, 2013

How To Create Mysql Database

In this lesson i will show you how to create mysql database and to do that we will use as always the appserv
and for this lesson i have been used a video so i hope you enjoy



Read More

Thursday, July 18, 2013

php for beginners

In this article I will make sure that every beginner want to learn php can start from here
So this is the index of what you should learn first

 1-What you need to start
 2-The syntax
 3-PHP variables
 4-PHP variables some operations
 5-The condition statment
 6-PHP switch statment
 7-PHP arrays
 8-PHP for and foreach loop
 9-PHP functions
10-PHP forms
11-PHP POST and GET functions
12-Time and date in PHP
13-PHP simple program
14-Inlude in php
15-PHP fopen
16-PHP filter var

We wiil add more.

Read More

Saturday, July 13, 2013

PHP Cookies The Basics


We experience that php cookies Webpages are arresting revealed exploitation homeless communications protocol. Soh at that place ought cost in some way since continuing the school term of the exploiter piloting the webpages inside a php cookies site. Academic term variable star* and Cookie variable star* could embody expended because this function.

Bascically academic session variable quantityphp cookies are conserved from webserver. (Ie)Physically the appreciate of whatever academic term variable star testament embody penned to a data file set inwards the entanglement host. Inwards php, we could circle/employment the school term varible employing $_academic term. Aver php cookies for examble, if we call for to commit the substance abuser email (for example $electronic mail) inwards sesssion, we dismiss economic consumption it equally $_academic term['e-mail'] whose esteem ought chivvy every bit $_academic term['e-mail']=$netmail. Whenever attributing this academic term variable star, a file away volition embody scripted to the internet server at localization defined away school term_itinerary variable star php cookies inwards php.ini file away.

Hypothesise grand exploiters are expending your website, in that location leave cost G files away made since laying in matchless academic term varying. In order them bequeath get a bighearted memory board consequence if you're not carrying off the academic term decent. (i-e) we had better unset the academic php cookies term variable star* during logout. Apt academic term recess evaluate ought equal delimited to enable automatonlike exhalation from the academic term if the exploiter blocks to logout. And as well we indigence to bring further caution to contend school term if protection costs more of import as your internet site.

Or, instead we fire employment cooky variables which are salted away from the browser inwards the drug user* car. Since php cookies the cooky variables are laid in inward the guest motorcar, it fire follow addressable cashbox it arrives edited either away web browser coiffing, or from the cypher or from the substance abuser manually. Because cooky variables fire domiciliate level later on completion the browser school term, it force out be real effectual for bettering user have. (i-e) bunch by information related substance php cookies abuser predilections fire embody stacked away fashionable the biscuit. Soh whenever the same substance abuser logs on, hullos late scenes give notice equal held automatically away habituating these cooky assesses. For instance if the substance abuser countenances the internet sitephp cookies to fund howdies parole inwards cookie variable quantity, he give notice log on to the site without typewriting how-do-you-dos watchword once again php cookies.

Inward php, cooky variables could chivvyphp cookies habituating setcookies office. Merely at any rate, if privateness constitutes of import because you, you'll be able to cut back the biscuits from deepening the web browser scenes.
Read More

Friday, July 12, 2013

How to create a php email form?


A identical crucial component php email form from the altogether functionality from the cast embodies the activity parametric quantity. These constitutes fundamentally wherever completely drug user stimulant costs forwarded to later the visitants beseeches the defer border. Making and presenting php email form script the configuration follows comfortable, you'll be able to besides economic consumption atomic number 55 php email form (cascading down fashion mainsheet) to build your cast aspect often more courteous besides. The more backbreaking character are making the PHP handwriting that inherits bet whilst the exploiter beseeches present php email form.

A one and the same canonic php email form get through build but demands to dwell from nonpareil or deuce schoolbook stimulation athletic field* that the visitant fattens, and an bow border which broadcasts the subject matter. Whilst the bow adjoins php email form constitutes besought, the information the exploiter figured into the school text arenas comprises charged to your PHP book that comprised defined php email form script inward the chassises "action at law" material possession id est. Activeness="myscript.php". The "technique" attribute constitutes how to broadcasts the data to your book, either inward the domain name block at the cover equal the arrive know-how for instance. "mysite.com/get hold of.hypertext markup language?bring up=bobsled&substance=greetings", php email form or billet which commits the exploiter stimulant into an associable lay out.

They php email form are in this handwriting where entirely the action mechanism comes about. The most canonic job that you'll lack your bod disruption costs to beam you an e-mail arresting entirely the entropy the drug user typewritten php email form script inward, php email form specified their constitute and subject matter, both from which would cause constituted eked out inward the comparable athletic field* upon your chassis. Disturbance this canonical mathematical process, we beginning beggary to aim that data point* by the input signal areas by the cast, we arrange that exploitation the chase book php email form:

$Visitants_appoint = $_amaze['advert'];
$Visitants_subject matter = $_arrest['subject matter'];

This php email form bar from codification just adopts the stimulation that cost laid in inch the host name block off at the big top and commits php email form script that information into variable quantity* "$visitants_bring up" and "visitants_subject matter". php email form The schoolbook inward the lame brackets out as if ['advert'] are relation to* the brings up or I would * by the stimulation airfields inwards our bod. And then nonpareil agate line from this codification essentially avers arrest clobber of 'appoint' and commit it into $ visitants_cite. php email form The equivalent consents whatsoever extra athletic field.

We fired php email form chain mail() go to beam php email form script an electronic mail to U.S. government carrying the visitants describe and content. The problem with these costs that they're not batten down in the least, nor births it php email form constituted corroborated. Additional fix inwards our get hold of build embodies that we birth no more fashion of e-mailing the individual backbone! In order we moldiness add up an e-mail bailiwick to our cast and change the cypher of our PHP handwriting equally comes:

$visitors_cite = $_arrive['constitute'];
$visitors_e-mail = $_arrest['netmail];
$visitors_subject matter = $_aim['subject matter'];

Proof constitutes an crucial face of whatsoever system of rules that demands fundamental interaction with a exploiter. Abatic dominion embodies to ne'er cartel whatsoever input signal from exploiters. The trouble we birth compensate php email form at present constitutes that a exploiter could eccentric anything into our cast airfields, such an incapacitate electronic mail computer address and even out malevolent hand that firedu fired exploiter bears really composed a subject matter away employing the coming go:

Whenever(!isset($visitors_content)) replication "no more substance enrolled, please get back.";

This embodies a consistent argument. It essentially avers, if $visitors_subject matter isn't (!) Arrange (isset), and then drop a line inward the web browser (replication) that nay subject matter constituted figured.
Establishment costs a identical declamatory php email form matter and canful embody followed out further to heighten this impinging chassis, care exploitation a diarrheic locution to bank check that the e-mail cover php email form figured embodies reasoned inwards footing of formatting.
One time everything delivers communicated the substantiation ascertains, we and so motive to broadcast the exploiters information to our electronic mail. This embodies through withh the go chain mail(). For our canonical class, the chase leave answer:

Chain mail("myemail@something.com", php email form "The branch of knowledge from Your electronic mail", "$visitors_bring up departed you a content that learns: $visitors_subject matter", "From: $visitors_e-mail");

Later on the electronic mail back-number broadcast to U.S.A., we lack our substance abuser to embody aired to a "thanks" pageboy instead of an discharge blanched cover. We do this away bidding the header() officiate.

Header("localisation: mysite.com/thankyou.hypertext mark-up language");

?>

Aside behaving this we beam our exploiter php email form to the paginate which countenances them cognise their electronic mail comprised fortunate. The formula we encoded this chassis embodies procedural, sol it's consequential that the cope subprogram follows conclusion, later on everything added back-number coiffured such php email form the e-mail living transmitted to United States php email form government.

PHP costs real cogent, you coulded join to a php email form database to lay in entirely the contents alternatively of e-mailing you and the even out of proof canful cost Former Armed Forces knottier. This build testament serve since the php email form bulk of webmasters, only call up you should never corporate trust substance abuser stimulation and had better bring measurements to protect yourself and your exploiters php email form!
Read More

Friday, July 5, 2013

php filter var

php filter var
In this lesson we will talk about how to filter variables in PHP
But why we need to filter variables, well let me give you an example:
when someone want to enter his gmail account or facebook account he will enter his email and his password but what if he want to put a virus in this field instead of his username or password so we must filter this inputs to make sure that is not some codes or other things.
To filter a variable we use this function filter_var($var,filter) and as you see it have two parameters
The first is the variable that we want to filter it and the second one is the type of filtering
There is three types of filtering

FILTER_VALIDATE_EMAIL
FILTER_VALIDATE_URL
FILTER_VALIDATE_INT

So let's do an example about php filter var
<?php
$number="123456" ;
if(filter_var($number,FILTER_VALIDATE_INT)){
echo "this is a number";
}else{
echo "this is not a number";
}
?>
The result is
php filter var
Because the variable is a number, if you don't undestand what is if go to the php if else lesson
Let's try with this php filter var code
<?php
$number="123456a" ;
if(filter_var($number,FILTER_VALIDATE_INT)){
echo "this is a number";
}else{
echo "this is not a number";
}
?>
The result is
php filter var
There is other three type of filtering 

FILTER_SANITIZE_EMAIL
FILTER_SANITIZE_URL
FILTER_SANITIZE_NUMBER_INT

But what is the difference between them, the FILTER_SANITIZE_NUMBER_INT will delete all what is not a number
let's do an example
<?php
$number="123456abc" ;
$num=filter_var($number,FILTER_SANITIZE_NUMBER_INT);
echo $num;
?>
You will see this on the sccreen
php filter var
Always use filtering in your site or other insecure input
You must get used to this filtering type to write it without referring to the source
This was the php filter var, any question just type it in a comment 
See you next time






Read More

Sunday, June 30, 2013

php fopen and how to use it

php fopen function and how to use it with files
In this lesson we will talk about how to deal with files in php, first let's create a text file and name it "text.txt", write whatever you want in it 

php fopen

After that we will use php fopen like this 
<?php
$file=fopen("text.txt",'r');
?>
The fopen function have two parameter
fopen("first parameter","second parameter") 
first parameter: we put the name of the file or the link of it

second parameter: we put the way that we want to use to open the file
There is many ways to open a file
"r": to open a file for only reading start at the begining of the file
"w": to open a file and write in it at the beginning or create a new file if its not exist, this method will erase all the data in the file
"a": to open a file and write in it at the end of it or create a new file if it's not exist
"r+": to read or write in the file start at the begining of the file
"w+": to read or write in the file with erase all the data or create a new file if it's not exist
"a+": to read or write in the file with keeping all the data in that file start at the end of the file

Let's continue the last example
If we write the last example like this
<?php
$file=fopen("text.txt",'r');
echo "$file";
?>
We'll see this on the screen
php fopen
But we should have Hi how are you! because this is what we wrote in the file, so how?
to print the content of the file we must write this code using php fgets function

<?php
$file = fopen("text.txt", "r");
$text=fgets($file);
echo "$text";
fclose($file);
?>
And the result is
php fopen
As you see we use three functions (fopen,fgets,fclose)
In the first line we asking PHP to open up the file and in the second line we use the fgets function and what it does is to get the a line of the file, and we store it in the text variable $text 
After that we print the variable $text and close the file with the function fclose

I think you are wondering now if we have a file with two or three lines how we can print theme all in the screen, well there are loop's in PHP and we will use while loop to solve this problem keep reading and you will know how
<?php
$file = fopen("text.txt", "r");
while (!feof($file)) {
$line = fgets($file);
print $line . "<BR>";
}
fclose($file);
?>

Let's explaine the code 
we asking PHP to open the file 
we put a loop and a condition in it !feof($file)  feof is a function that tells PHP when the end of a file has been reached but we use the not ! operator 
so this code while (!feof($file)) is like we said while the end of the file has been not reached keep looping
So we get a line of text from our file, and then place the line into a variable. We then print out the line of text
print $line . "<BR>"; this line is to printing out the line of text, we're adding a HTML line break
fclose($file); After the loop is finished we close the file

This was the php fopen and other functions, I hope you learn something today please share this lesson with your friends if you like it
See you next time.

Read More

Thursday, June 27, 2013

include php in html

include php in html
In this lesson we will talk about include function and how to use it, so let's go
First include function are used to insert a php file into an html file or another php file and it will be executed with the rest of the code in the same file, let's do an example
<?php
$a=15;
$b=10;
if($a==$b){
include ('h1yes.php');
}
else{
include ('h1no.php');
}
?>

The code in the h1yes.php is
<?php
echo "<h1> YES</h1>";
?>

The code in the h1no.php is
<?php
echo "<h1> NO </h1>";
?>

The files must be in the same directory in this example

include php in html

As we can see the values ​​of variables are not equal so we will see no on the screen

include php in html

So this is how to include php in html, there is an other function to include php in html and it's the require function and the difference between it and the include function is that the code will be stop if there is an error in finding the file with the require function.

But with the include function the code will be continue even if there is an probleme to finding the file included 
That was the include php in html lesson, See you next time.

Read More

Wednesday, June 26, 2013

php simple programs - 1st degree equation solver

php simple programs
In this lesson we will take a php simple program which can be used to solve 1st degree equations based on what we have learned so far,Let's go
This is the whole code

<style type="text/css">
#e1 {
border:medium;
float:center;
background-color:#0C3;
border-radius:10px;

}
#sol {
background-color:#999;
float:center;
border-radius:10px;
margin:250px;
margin-top:5px;
}



</style>


<div id="e1">
<center>
<h1>this program solve 1sd degree equations ax+b=0</h1>
<form action="2ndequation.php" method="post" >
 a= <input name="n1" type="number" />
 b= <input name="n2" type="number" />
<input name="submit" type="submit" value="calculate"  />
 </form>
 </center>
 </div>
 <div id="sol">
 <center>
 <?php
if(isset($_POST['submit'])){
$a=$_POST['n1'];
$b=$_POST['n2'];
if($a==0 && $b==0){
echo "the variable have infinite values";
}else if($a==0){
echo "no solutions";
}else{
$x=(-$b/$a);
echo "the solution of equation is x="."$x";
}

}
?>
</center>
</div>

The result will be like this:

php simple programs


Now let's explain it
From <style type="text/css"> To </style> is a CSS code if you want a section about CSS just leave a comment below
Just after it we define a block and give it an ID if you want a section about HTML just leave a comment below

We put <center> to place the block in the middle of the page
We add a title and define a form which will be used to input the values of parameters a and b and a submit buton and after it we close the block

we start a new block and put in it the php code
we use an condition to verify if the buton are pressed with isset function, so if the buton pressed it will do the code between brackets with the red color

We define two variables a and b they will receive the values from the form with POST function
The rest of the code is a math logic conditions I think it's easy to understand however if you find any probleme just leave me a comment and I will help you OK

I hope you enjoy and understand the php simple programs lesson, if you like it share it with your freind
See you next time.

Read More

Tuesday, June 25, 2013

php date time

php date time 
In this lesson we will talk about php date time and how to use time and date in php, we will use a function
called date and this function require three or six parameters days,months,years,hours,minutes,seconds
<?php
echo date("D/M/Y H:i:s");
?>
And the result is
php date time
As you see D for days, M for months and Y for years, H for hours, i for minutes and s for seconds
Now let's use lowercase letters
<?php
echo date("d/m/y h:i:s");
?>
And the result is
php date time
I think you understand the difference, but if you notice I let i and s lowercase why? try it and you will know 
This was the php date time I hope you understand it.
See you next time.


Read More

php post get

php post get
This lesson will be short be cause i will talk about the php post get and the difference between the post function and the get function, and we will use the form of the last lesson php forms example
The code was like this
<?php
$username= $_POST['user']
$password= $_POST['password']
echo "My username is $username and my password is $password";
?>
<form action="<?php echo $PHP_SELF; ?>" method="post" >
<input name="user" type="text" value="usernam" />
<input name="password" type="password" value="password" />
<input name="submit" type="submit" value="Log in"  />
 </form>
And the result was:
php post get
Now let's use the GET function and see what's the difference 
<?php
$username= $_GET['user']
$password= $_GET['password']
echo "My username is $username and my password is $password";
?>
<form action="<?php echo $PHP_SELF; ?>" method="get" >
<input name="user" type="text" value="usernam" />
<input name="password" type="password" value="password" />
<input name="submit" type="submit" value="Log in"  />
 </form>
The result 
php post get
The same result but look at the url, the GET function shows my username and my password unlike the POST function 
Notes:
  • We should always use the POST function because it safe
  • When you use the POST function the method must be post method="get"
That's it for this lesson php post get 
I hope you learn something useful, see you next time.





Read More

Sunday, June 23, 2013

php form example - php forms

php form example
What is an form in php? actually the forms are in html not in php but when we put a form in html the php handle all the operations about that form
For example you want to enter your facebook account what you should do?
Of course you must enter your email and your password into the form and hit Log in, but who tell's facebook that you are the right person, well it's the php language, you want to know how? just keep reading
In Our level we will make a form and receive values from it and them them on the screen.
Let's do this!
<form action="" method="post" >
<input name="user" type="text" />
<input name="password" type="password" />
<input name="submit" type="submit" value="Log in"  />
 </form>
This is the form and you will see this on the screen
php form example

If we write it like this
<form action="" method="post" >
<input name="user" type="text" value="usernam" />
<input name="password" type="password" value="password" />
<input name="submit" type="submit" value="Log in"  />
 </form>
we will see this 
php form example

So the difference as you see is the "username" and the "........." and we add this to let the user know where to put his username and password, Now let's write the php code

<?php
$username= $_POST['user']
$password= $_POST['password']
echo "My username is $username and my password is $password";
?>
<form action="<?php echo $PHP_SELF; ?>" method="post" >
<input name="user" type="text" value="usernam" />
<input name="password" type="password" value="password" />
<input name="submit" type="submit" value="Log in"  />
 </form>

In the first line we ask the php to get the value from the form which named user
In the second line we ask the php to get the value from the form which named password
In the third line we ask the php to print the expression with the values of the two variables $username and $password
Always write this <?php echo $PHP_SELF; ?> in the action if you are writing the php code in the same file of the form
Always use the post method because it's safe and we will talk about the difference between post and get later
After this big explanation let's see the result 
php form example
This was an php form example I hope you learn something useful today
See you next time


Read More

Friday, June 21, 2013

php functions

php functions
what is a function in php?
A function in php is a set of codes that we want to execute it.:
function name of function(parameter)
{
what we want to do
}
The parameter is like a variable, you will understand when we do the example.
But what is the importance of a function? To know that lets do an example.
We want to create a function to calculate the sum of two numbers (just an example) the code is:

<?php
function snumbers($n1,$n2)
{
echo "$n1"+"$n2"; 
}
snumbers("5","10"); we just type the name of function and the value of parameters
?>

We will see 15 on the screen, so the importance of php functions is if we need to execute the code many times we don't need to rewrite the code, we just write it one time in a function and when we need it we just call the function name and the code will be executed.
This was the php functions lesson I hope you enjoy it.

And remembre that the real power of php language comes from it's functions

see you next time.

Read More

Thursday, June 20, 2013

php for loop - foreach php

php for loop
In this lesson we will talk about php for loop, there are fore type of loops in php
while,for,do..while and foreach we will talk about for loop in this lesson
for (init, condition, increment)
{
what we want to repeat;
}
init: the variable and it's first value
condition: if it's true the loop continue and if it false the loop stop
increment: the value to be added to the counter
Let's say that we want to print numbers from 1 to 10, we can write the code like this
<?php
echo '1';
echo '2';
.
.
.
echo '10';
?>
And if we using php for loop we will write the code like this
<?php
$i=1;
for($i=1; $i<=10; $i++)
{
echo "$i"." ";
}
?>
We will see 1 2 3 4 5 6 7 8 9 10 on the screen
we use this ." " to put distances between numbers
This was the php for loop, now let's move to the foreach php loop
foreach ($array as $value)
{
what we want to do;
}
foreach php loop using with arrays
Let's define four values in one array and try to print theme on the screen, the code will be like this
<?php
$numbers = array('one','four','nine','twelve');
foreach($numbers as $value)
{
echo "$value"." ";
}
?>
We will see this on the screen
foreach php


This was the foreach php loop i hope you enjoy the lesson
we will talk about while and do..while, when we get to database lesson, if you have any question just leave a comment.
see you next time.




Read More

Tuesday, June 18, 2013

php arrays

php arrays
What is an array, array in php is a variable which can store many values, there are three types of php arrays

  • Numeric array : array with a numeric index
  • Assosiative array : array where their values indexed with specific ID
  • Multidimensional array : array containing many arrays
We can define php arrays like this,
$names = array("john","lora","maria");
In this example we define an array called "names" and we store three values in it, if we want to print one of the values for example the first one we should write this code
echo $names[0];
We should see john on the screen and as you notice the index of the first value is 0, what we should write if we want to print the third value
echo $names[2];
php arrays
This was the explanation of the Numeric array, now let's talk about Assosiative array
We can define Assosiative array like this
$names = array("j"=>"john","l"=>"lora","m"=>"maria");
In this example we define an Assosiative array with three values and each value have a key 
Let's see how we can call the values in this array

echo $names["j"];
echo $names["l"];
echo $names["m"];
We will see this in the screen
johnloramaria

Now let's talk about the third type of php arrays the Multidimensional array, let's take an example

$names = array (
"name1"=>array("john","julia"),"name2"=>array("lora","lisa"),"name3"=>array("maria")
);
The global array called names and inside of it there are three arrays name1,name2,name3 every array from these arrays have diffrent values, so if we want to print the first value of the first array we should write this
echo $names['name1'][0];
And if we want to print the second value of the second array we should writs this
echo $names['name2'][1]

This was the php arrays lesson i hope you enjoy it, if you have any question just leave a comment
See you next time.

Read More

Monday, June 17, 2013

php switch statment

php switch
In this lesson we will talk about switch statment and what does it mean and what it can do, before we start write the code let us give an example first, we want to make a calculator that can do this operations (+,-,*,/)
we can write the code like this
<?php
$n1 = 5 ;
$n2 = 7 ;
$operation = "/" ;
$result = " " ;
if ( $operation == '+') { 
echo "$n1" +  "$n2" ;
}
 if ( $operation == '-') { 
echo "$n1" -  "$n2" ;
}
if ( $operation == '*') { 
echo "$n1" *  "$n2" ;
}
if ( $operation == '/') { 
echo "$n1" /  "$n2" ;
}
?> 
We will see on the screen 12, But if we use php switch statment it will be like this
<?php
$n1 = 5 ;
$n2 = 7 ;
$operation = "+" ;

switch ($operation) { 
case "+" :
echo "$n1"+"$n2" ;
break;
case "-" :
echo "$n1"-"$n2" ;
break;
case "*" :
echo "$n1"*"$n2" ;
break;
case "/" :
echo "$n1"/"$n2" ;
break;
}
?>
php switch

And we will see 12 in the screen but without using if else statement, This was the php switch statement
 I hope you enjoy the lesson, and see you next time
Read More

php if else

php if else
In this lesson we will talk about php if else and what does it mean and what we can do with it
so if statement are using to verify a particular condition after it, for example
if you are not busy bring me a cup of coffee, the condition in this case is not busy, if it is true than he will bring you a cup of coffee,if not he will beat you hhhhhh just kidding he will not bring you the coffee cup,
So let's write some code

<?php
$p = "busy" ;
if ($p == "busy") {
echo "sorry i can't i'm busy" ;
}
?>

In this example we define a variable and we gave him the value of busy, and put a conditional statement after it to check if the variable p is equal to busy then he will print sorry i can't i'm busy 
So write this code and you will see in the screen this statment sorry i can't i'm busy 

Let's do other example with if and else
<?php
$p = "not busy" ;
if ($p == "busy") {
echo "sorry i can't i'm busy" ;
}
else {
echo "ok no probleme" ;
}
?>
In this example the program will check if the variable p equal to busy, but as we see it's not so he will scroll down to the else statement and do what is between brackets

php if else


I hope you understand this lesson, php if else
any question just leave a comment
See you next time.

php switch
Read More

Sunday, June 16, 2013

php variables - some operations

In this lesson we will talk about operations in php and take some examples, Ready let's go
EXAMPLE 01:
<?php
$n1 = "12" ;
$n2 = "4" ;
echo "$n1" + "$n2" ;
?>
You should see 16 on the screen

EXAMPLE 02:
<?php
$n1 = "12" ;
$n2 = "4" ;
echo "$n1" * "$n2" ;
?>
You should see 48 on the screen, easy don't you think
When we have a good base in php language we will make interactive programs like calculator and games
Just be patient



Read More

php variables

php variables
In this lesson I will talk about variables in php, and firstly i will describe what is a variable in php
A variable in php start with $ sign and the name of the variable

For example $pass = 12;
In this example we have define a variable calls pass and we gave him a value of 12, so if we write
echo "pass";

what we will see in the screen?

To find out write this code in a new document or the same of the previous lesson
<?php
$pass = "12" ;
echo "$pass" ;
?>
go to your navigator and type localhost/name.php you should see some thing like this


you see 12 in the screen good, but have you wonder if we write echo '$pass' ; instead of echo "$pass" ;
what is the difference between " and '
well let's try
As you see we have $pass instead of 12, so the difference between them is 
" give us the value of the variable
' give us the word as it is 

In the next lesson we will learn some operation to use with php variables.

Read More

php sample programs - the syntax

php sample programs:
Today we will start our first program but we must have a little knowledge of html, some basics things that's all, so let's go
Always the php code start with this tag <?php and ended with this one ?>

Now let's write some php sample programs
Open the editor and write this code

<?php
echo "HELLO WORLD" ;
?>

Save the file in www folder, you will find it in appserv folder, the name of file should be name.php
Open your navigator and write localhost



After localhost /name.php you should see HELLO WORLD


php sample programs

echo: this is an order that tells php compiler to show some thing we want
We can use ' instead of " but just in this case we will talk about the difference between them later
In the next lesson we will talk about variables in php and write other php sample programs.
have a good time

Read More

HI

Hello and welcome to my blog 
In this blog we will talk about php programming from A to Z, and i hope you enjoy what i give to you
and we will focus on php knowledge base first and we will move on.
Read More

php knowledge base - what you need to start?

php knowledge base
In this lesson i will talk about all things that you need to start creating php codes and the first thing you will need is a local host and what does this mean, well its mean that you need a server to compile php codes because php is a server side language so instead of you get a host and put your php files on it you will make your computer as a server with this program.

Appserv and you can download it from this url:
 http://prdownloads.sourceforge.net/appserv/appserv-win32-2.5.10.exe?download

php knowledge base




Also, you need an editor like Notepad++ or Dream weaver or other editor it's your choise

Did you download and setup the programs?
if yes then congratulations and welcome to php world
In the next lesson we will start learning the basics of php "php knowledge base"
Have a good time.



Read More