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