This area is intended for everyone new to PHP. It opens with a series of informal, entertaining tutorials written by Vikram Vaswani, founder and CEO of Melonfire. These tutorials build on a previously-published 5-part series which has now been updated and extended to embrace PHP 5, making parts of it suitable for those of you who already have worked with PHP 4 in the past.
If you came here to learn about elementary PHP 4 or basic PHP 5, this is for you. Enjoy!
*PHP 101 (part 1): Down the Rabbit Hole*
An introduction to PHP’s variables and operators.
*PHP 101 (part 2): Calling All Operators*
The rest of the PHP operators (there are many), and simple form processing.
*PHP 101 (PART 3): Looping the Loop*
Basic control structures explained.
*PHP 101 (PART 4): The Food Factor*
Arrays, PHP array functions, and what it all means.
*PHP 101 (PART 5): Rank and File*
Everything you’re ever likely to need to know about dealing with external files from a PHP script.
*PHP 101 (PART 6): Functionally Yours*
All about functions, arguments, passing by reference, globals and scope.
*PHP 101 (PART 7): The Bear Necessities*
A gentle introduction to object oriented programming in PHP 4 and PHP 5.
*PHP 101 (PART 8): Databases and Other Animals*
All about connecting to a MySQL database from PHP, using the mysql or mysqli extensions.
*PHP 101 (PART 9): SQLite My Fire!*
Introducing another database: SQLite.
*PHP 101 (part 10): A Session In The Cookie Jar*
Sessions and cookies – how to keep track of visitors to your site.
*PHP 101 (part 11): Sinfully Simple*
An introduction to PHP’s easiest method for dealing with XML.
*PHP 101 (part 12): Bugging Out*
Basic error handling.
*PHP 101 (part 13): The Trashman Cometh*
A primer in basic security.
*PHP 101 (part 14): Going to the Polls*
Putting the pieces together – a first Web application.
*PHP 101 (part 15): No News is Good News*
Creating a simple RSS news aggregator.


Comments (Login to leave comments)
I want to know the difference between PHP3,PHP4 and PHP 5.
Thanks
Preeti
10/10
:)
Its really amazing and its very esily understandable
i really know lots of things about php
its wonderful
amzing work by ZEND!
I really THANK YOU and WISH
ZEND TEAM
wentthrough each of the tutorials. They were absolutely easy
to understand and the humour in it really makes a person to
readit.
I understood the OOP nature of php as ive coded in C++
java before. and php has the easiest syntax. What a language
Easiest scripting language ever thanks to zend. I am now starting to progress into more advanced tutorials. Keep up
the good work
Having nothing more in the way of coding experience than an online course I took in HTML 4.0, I am in desperate need of finding gainful employment.
I was not thrilled with the prospect of returning to the workforce as a secretary, but my programmer friend informed me that your site would be a wonderful place to begin learning PHP. And he was RIGHT!
The sense of humor evidenced in the lessons makes the learning lighthearted and fun. I'm very excited to pursue this course of study and become truly proficient in it.
Many thanks for all the work that was put into this series. It really shows and I am extremely grateful you've made it available.
Dude, your presentation of the material was perfect. I read every lesson this evening, over a 3 hour time frame, and it's definately put me back on track. Thank you so much for your selfless approach to help others. It was done in a clear, concise, and very effective way.
thanks a lot
Amazing work by ZEND!
Thanks
sanjay patil(web pulse technologies)
Thanks for providing this tutorial!
or bookmark it then choose "Make Available Offline"
Anyway , like i said before : PERFECT.
Better than the itself PHP.net.
Thanks Zend Team.
again, thanks tremendously
Thanks
<html>
<head>
<basefont face="Arial">
</head>
<body>
<?php
// set database server access variables:
$host = "localhost";
$user = "root";
$pass = "marais";
$db = "testdb";
// open connection
$conn = mysql_connect($host, $user, $pass) or die ("Unable to connect Database!");
// create database
mysql_create_db($db) or die ("Unable to create database!");
// create query
$query = "CREATE TABLE alamat (
nama VARCHAR (25) NOT NULL,
alamat VARCHAR (60) NOT NULL,
telpon INT (11) NOT NULL,
id INT (3) UNSIGNED NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
)";
$hasil = mysql_db_query($db,$query);
if ($hasil) {
echo "Tabel <b><i>alamat</i></b> dalam <b>$db</b> berhasil dibuat!";
}else{
echo "Tabel <b><i>alamat</i></b> dalam <b>$db</b> gagal dibuat!";
}
?>
</body>
</html>
but all i get is an error message :
Fatal error: Call to undefined function mysql_create_db() in C:\htdocs\bikindb.php on line 19
am i doing it wrong?
INSERT INTO symbols VALUES (1, 'America', 'eagle');
and I got an error message:
ERROR 1146 (42S02): Table 'world.symbols' doesn't exist
Could anyone please help with this?
Thanks,
The above will download a zip file with a FULL PDF version of this tutorial and the original code for parts 14 and 15.....
Finished creating this today!! hope Vikram Vaswani doesn't mind me doing this but was getting bored of the broken links in the tutorial...
ENJOY!!
http://www.bms.co.uk/downloads/other/PHP101.zip
bill dot clerico at gmail dot com
thanks!
Then, here I ask experts, if they mind, after finishing this, what would be their recommended material for going through more of PHP and advanced levels?
Any answer would be appreciated.
for($x = 0; ($x > array_count_values($each_pet)); $x++) {
This loop will never be run, since $x = 0, and array_count_values($each_pet) will never be smaller than zero.
Many of them help me a lot.
i have a hunger of learning new things, and now days i want to learn php so your article will help me a lot...
thanks for sharing with us....
http://www.onlinecheapatvs.com/
Thank you.
Need to go over the previous one but this is what the real guide is for me that's helping me be allot more secure with my PHP applications, though I do think I am quite lazy myself i.e. I thought about not checking each individual element in the $_POST array, to use a loop to work out this for me.
This is what I tend to do now (granted you can't tell the user which element is the problem, or can you?) anyways here's what I came up with myself, follows a bit of modified logic off you'r example at the start:
<html>
<head>
<title></title>
</head>
<body>
<?php
// this checks for null values and only allows user to enter string data?
if(array_key_exists('submit', $_POST)) {
foreach($_POST as $key=>$value) {
if(strlen($value) === 0) {
$error = 'You missed out some required fields, please try again';
}
}
} else {
// show the form anyhow below:
$message = 'Please enter a comment in the form below:';
}
?>
<?=(isset($message)) ? "<p>$message</p>\n" : '' ?>
<form action="<?=$_SERVER['PHP_SELF'];?>" method="POST">
<p>
<label for="comments">Please enter a comment here: </label><input type="text" id="comments" name="comments" /><br>
<input type="submit" id="submit" name="submit" value="Post Comment" />
</p>
</form>
<?=(isset($error)) ? "<p>$error</p>\n" : '' ?>
</body>
</html>
Thanks a lot!
<a href="http://topclassifiedsoftware.com">classified php script</a>