Create A Very Advanced Image Gallery With Only Few Lines Of Codes With PHP, HTML, CSS

You want to create a Web image gallery and don’t want to write repetitive code? then here is simple script, place it in a directory and also images in same directory under a folder called “images” and that’t it. It will list and display images itself. Not only that, it names the images from the file name, all you to do is rename images to the requirement.

Image gallery script

Here is the code

Continue reading Create A Very Advanced Image Gallery With Only Few Lines Of Codes With PHP, HTML, CSS

[How to] Store and Display images from MySQL using PHP

Now everything is database driven and people are willing to involve the db technology everywhere. So, lets see what we can do to throw a image on the screen not directly from the directory, where it is stored as it is. But, we will see how we can store the image in DB and display images from db.

As we are going to do it, I want to tell you what are the procedures involved in it.

First, we will read the images in the binary mode(Binary mode because it can represent anything) using a PHP script, and all the binary code will be stored in the database as is.

Next, we will give the name or number to those data for the identification.

And at last, we will create a script which will access the db, read the data into it, and display image.

Sounds simple isn’t it? Here create a table named imagedb

Now lets create a page called ” store.php ” because it the page we will use to read the images, and store it in DB.

The code we will add to it are

Save the file, and now create a new file called “images.php” and add this code below. this is the page which will fetch us image from the DB.

$data = $sth->fetchAll();
echo $data;

Now type the url http://localhost/path/to/image.php?id=id_u_used , tadaaa, you can see the image.

if you want to put your images somewhere, just use

<img src=”image.php?id=image_id” />

Username availability checker with PHP and jquery

Do you want to tell users while registering if the username they have typed into input field is available or is taken already before they submit the form? Well, it can be easily done with PHP and jquery, it takes no more than few lines.
Username availability checker with php and jquery

 First set a HTML form like this and save it as form.html

Do not forget to attach jQuery script, because it is where the magic lies

Now set up the php page, it is the place where the username availability will be checked

Code goes like this

Continue reading Username availability checker with PHP and jquery

Download and save content from web to local storage using PHP

You may want to automate the task downloading files from the web or remote area to your local storage space, you can use the PHP for this purpose.

It can be done by using the code below.

fopen() : this function is used to open the file in specified mode.

There are several file open modes in php.

How To Install PHP & MySQL On CentOS 5 VPS ( LAMP)

Hi today i am going to tell you about how to install LAMP in ur VPS (linux)

First you have to login via ssh (putty) . Than u have to put the commands that i am writing below.

For Installing Apache type or copy the cmd

For Installing MySQL Database Server:

For Installing PHP

Install phpMyAdmin

Now use this cmd for restarting the httpd

Then to make user u installed right way create a .php (test.php)(/var/www/html/test.php) file in ur vps then put

Then go to yourip/test.php

You can see a php configuration info’s .

Demo :