Archive for the ‘PHP‘ Category

Insert And Extract/Fetch Data From Database: PHP Script

What to expect ? Using PHP script insert user entered data/information into database and extract/fetch data stored in database and display it on the browser. This video tutorial also teaches the MySQL queries. In this video tutorial we have used a readymade form which uses POST method to pass the user entered information. To watch [...]

POST Method In Action: Simple Form

This Basic PHP tutorial illustrates the usage of POST method, with the help of a simple HTML form. It echo’s/print’s the user entered information on to the browser by passing it via POST method. If you are sending sensitive informations like credit card number or your password, then make sure to use POST method. If [...]

GET Method In Action: Simple Form

This Basic PHP tutorial illustrates the usage of GET method, with the help of a simple HTML form. It echo’s/print’s the user entered information on to the browser by passing it via GET method. It also tells one big advantage of GET method over POST method. Source Code We have purposefully kept this example super [...]

WordPress Username & Password For Your Application Login

Today we shall learn a simple method of using Self Hosted WordPress’s Credentials(username and password) to log into your custom application.. You may ask, “Well, why we should use this?” The reason is, because WordPress is an opensource script which is constantly improving and has a strong security. And this approach provides easy integration of [...]

Develop User Signup and Login forms: PHP & MySQL

PHP & MySQL tutorial to develop signup form and store user information in a database and using signin or login form we compare for the correct username and password combination in our database. We also use session and demonstrate session_start(), session_unset(), session_destroy(). This tutorial is very important for any of your projects where you want [...]

Store Page View Count In Session Variable: PHP

PHP program to store page views count in SESSION, to increment the count on each refresh, and to show the count on web page. Session: A session is specific to the user and for each user a new session is created to track all the request from that user. Every user has a separate session [...]

Randomly Display Some Images From A Set of Images: PHP

Use of this script:1. If you have a photo blog with 100 or more images, using this small php script you can show some random images on your homepage, to keep it more dynamic.. This makes up for a good user experience due to constant fresh content(images) each time.2. If you have 10 products and [...]

Dynamic Page Creation: PHP

In this PHP program we will not be generating pages, but creating the illusion of dynamic page creation! i.e., we will have a bunch of files inside a directory. We will fetch the contents of these files and display on a single file(index.php). Advantages: 1. Eliminating duplicate coding: Since, we will display the contents on [...]

Return Multiple Values From Function Using Arrays In PHP

If you are a C/C++ programmer, then you know that functions can not return more than one value. To over come this, they use Call by Reference – where address of the variables is passed, hence whenever the value in the passed address changes, the value of the actual variable changes without anything being returned. [...]

PHP Comments, String Concatenation, Addition of Numbers & Hello World

Today lets see these 4 basic things:1. The classic “Hello World” program.2. Comment system in PHP.3. Concatenation of Strings.4. Addition of Numbers. Classic “Hello World” program Program to output simple string 1 2 3 <?php echo "Hello World"; ?> Comments: 1 // This is single line comment 1 # This is also a single line [...]

First PHP program & Worst Practices To Avoid

We can embed php inside html tags and html tags inside php codes, but whatever it is – your php file name must end with a .php extension, so that the parser can identify that the file contains php code and it must also look for <?php and ?> codes inorder to recognise the codes [...]

Accessing localhost Web-server on Mac and PC

Make sure that you turn on the Wamp if you are on a PC and Mamp if you are on Mac. PC users can access their web files using the URL http://localhost/ Mac users can access their web files using the URL http://localhost/~yourUserDirectory yourUserDirectory is the user account name of your Mac computer using which [...]