PHP
3 mins read

PHP Image upload , Saving link to Database complete tutorial

This blog is dedicated to all our visitors who asked me to publish a working tutorial on  image upload  using PHP and Saving its path to Mysql Table. How to do that : First we will create a file called install.php , it will create a database called myimages and a table  named imgtables and […]

PHP
1 min read

PHP Do While Tutorial with Working Example

On reaching the control to do statement, the program proceeds to evaluated the body of the loop first. At the end of the loop, the test-condition in the while statement is evaluated,so it is categorized as post tested loop. The basic format of do while() statement is: do{ body of the loop }while(test-conditon);Lets have a […]

PHP
2 mins read

PHP Switch Statement Tutorial with Practical Example

What is PHP Switch Statement? According to php.net The Switch Statement is similar to a series of IF statements on the same expression. In many occasions, you may want to compare the same variable (or expression) with many different values, and execute a different piece of code depending on which value it equals to. This […]

PHP
2 mins read

PHP File Uploading easy to learn tutorial with complete script

PHP is world’s no. 1 server side scripting language, it comes with plenty of features and one of the most famous one is file uploading which is extensively used world wide. Self Explanatory PHP File Uploading Example First Create a directory called  gallary/ . Save this file as gallery.php <!DOCTYPE html> <html lang=”en”> <head> <title>File […]

PHP
1 min read

How To find out Visitors IP ADDRESS using PHP

I f you a PHP programmer then you will find it very easy to track your visitors IP Address, if someone spaming on your site you can also block him. PHP is alway easy and powerful than other scripting language lets check the whole code .Codding: <!DOCTYPE html> <html lang=”en”> <head> <title>IP Address</title> <meta charset=”utf-8″ […]

PHP
1 min read

PHP Constant tutorial with practicle example

Constant: Constant refers to fixed value that does not change the value during the execution of program. Constant are defined using PHP’s define () function which accept two arguments. The $ prefixed is not required for constant.A simple Example : <?php //define constant define(‘PI’,3.14); $r=5; //use constant $area=PI*$r*$r; echo “Area of circle=”.$area; ?>   Result […]

PHP
1 min read

Validate an E-Mail Address with PHP, complete script

This tutorial will teach you how to validate a e-mail id using regular expression to control email Spam. In this tutorial I used ternary operator to filter the values coming from the input box and avoid errors.Complete Coding is here  <?php $email=(isset($_POST[’email’]))?trim($_POST[’email’]):”; function verify($email){ if(!preg_match(‘/^[_A-z0-9-]+((.|+)[_A-z0-9-]+)*@[A-z0-9-]+(.[A-z0-9-]+)*(.[A-z]{2,4})$/’,$email)){ return false; } else { return $email; } } if(isset($_POST[‘submit’])){ […]