Showing posts with label and. Show all posts
Showing posts with label and. Show all posts

Sunday, July 3, 2016

Pre requisites to learning PHP and MySQL

Pre-requisites

Before you continue you should have a basic understanding of the following:

  • HTML/XHTML
  • JavaScript

What is PHP?

  • PHP stands for PHP: Hypertext Preprocessor
  • PHP is a server-side scripting language, like ASP
  • PHP scripts are executed on the server
  • PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
  • PHP is an open source software
  • PHP is free to download and use

What is a PHP File?

  • PHP files can contain text, HTML tags and scripts
  • PHP files are returned to the browser as plain HTML
  • PHP files have a file extension of ".php", ".php3", or ".phtml"

What is MySQL?

  • MySQL is a database server
  • MySQL is ideal for both small and large applications
  • MySQL supports standard SQL
  • MySQL compiles on a number of platforms
  • MySQL is free to download and use

PHP + MySQL

  • PHP combined with MySQL are cross-platform (you can develop in Windows and serve on a Unix platform)

Why PHP?

  • PHP runs on different platforms (Windows, Linux, Unix, etc.)
  • PHP is compatible with almost all servers used today (Apache, IIS, etc.)
  • PHP is FREE to download from the official PHP resource: www.php.net
  • PHP is easy to learn and runs efficiently on the server side

Where to Start?

To get access to a web server with PHP support, you can:

  • Install Apache (or IIS) on your own server, install PHP, and MySQL
  • Or find a web hosting plan with PHP and MySQL support

PHP Installation

What do you need?

Most people would prefer to install a all-in-one solution:

WampServer 2.0i [07/11/09] ? for Windows platform Includes : - Apache 2.2.11 -

MySQL 5.1.36 - PHP 5.3.0

http://www.wampserver.com/en/

http://lamphowto.com/ for Linux platform

Already have a web server?

If your server supports PHP you dont need to do anything.

Just create some .php files in your web directory, and the server will parse them for you. Because it is free, most web hosts offer PHP support. However, if your server does not support PHP, you must install PHP. Here is a link to a good tutorial from PHP.net on how to install PHP5:

http://www.php.net/manual/en/install.php

Download PHP

Download PHP for free here: http://www.php.net/downloads.php

Download MySQL Database

Download MySQL for free here: http://www.mysql.com/downloads/index.html

Download Apache Server

Download Apache for free here: http://httpd.apache.org/download.cgi

Download a nice text editor

http://www.flos-freeware.ch/notepad2.html

Thursday, June 30, 2016

Google PageRank PHP Script An Easy To Use And Working! PHP Script To Find Google PageRank Of Any Website

A very simple and powerful PageRank (Google PageRank) finder for any website. Just submit the website URL one at a time and get the page rank. Script is using Google toolbar to get the PageRank. 
Google PageRank PHP script works for both Bloggers and Webmasters. This script directly communicates with the Google toolbar.So it always is advisable not to make too many request at the same time from the same IP.

Instructions

Download "Download Free PHP pagerank script" and extract it using winzip or other similar program.

Include google-pagerank.php in your PHP which is going to display the pagerank for a website.

<?PHP include_once "google-pagerank.php"; ?> 

In the next line,

<?PHP
$url = "http://google.com";
$width = "200";
$method = "css"; //image or css or default
$image_location = "images/"; //including the slash (/)
$obj = new pr($url,$method,$width,$image_location);
?>

Thats it. Now all we have to do is, display the pagerank in the desired position of your webiste.

<p><PHP echo $obj->pagerank(); ?></p> 

If you are using "css" or "default", you have to use the above method to display the pagerank image."images" method requires the following line of code.

<p><img src="filename.php" /></p> 
filename.php should contain

<? include_once("google-pagerank.php");
$url = "http://www.google.com;
$width = "";
$method = "image"; //image
$image_location = "images/"; //including the slash (/)
$obj = new pr($url,$method,$width,$image_location);
echo $obj->pagerank();
?>
Instruction For Bloggers:

Bloggers cant use PHP code in blogs. so to display pagerank in your blog use the following code.

<p><a href=""><img src="http://www.agrizlive.com/
demo/google-pagerank-script/blogger.php?
url=http://www.google.com" /></a></p>

 Make sure you replace the blue color http://www.google.com to your blogger URL.

Download Google PageRank PHP Script


Tuesday, June 28, 2016

Email Extractor PHP Script Extract Email From Text And URL

PHP Email Extractor serves to extract emails either from provided text or from URL. All found emails will be output below the input form, one email per row.

Download Email Extractor PHP Script

CRUD Operations using PHP OOP and MySQL

CRUD Operations Using PHP and MySQL with OOP Concepts , Object Oriented PHP is More efficient than simple and core , its being used in many more MVC(model , view , controller) pattern based PHP frameworks Because we can create one class for all such operations and it's provide reusability of any class and created function , So have a look .

CRUD Operations using PHP OOP and MySQL
Read more »

Sunday, June 26, 2016

Dynamic Drop Down Menu using PHP and MySQLi

We have already seen tutorial about simple Drop Down Menu using CSS3 and jQuery, and this tutorial will cover creating a Dynamic Horizontal Drop Down Menu with its sub menu using PHP and MySQLi, it’s a simple concept and easy to create with PHP and MySQLi, you can also add and set links in main menu and sub menu from database data using PHP, I’ve used MySQLi object method, so let’s take a look at this tutorial.
Dynamic Drop Down Menu using PHP and MySQLi
Read more »

Creating and Extracting ZIP on the fly

If you want to create  or extract zip files on-the-fly you can use pclzip class. The class can be downloaded from phpclass.org or you can download here (including an example script 33kb!!). You can change the source or destination folder.



Saturday, June 25, 2016

How to Create Drop Down Menu using CSS3 and JQuery

Today i would like to show, How to Create Drop Down Menu using CSS3 and jQuery. Designing a Simple Drop Down Menu with HTML by Implementing CSS and jQuery is very easy to create. A simple horizontal menu that shows it’s sub menu on mouse hover. when you hover a mouse on main link it will show it’s sub menu. just take a look at this tutorial.
How to Create Drop Down Menu using CSS3 and JQuery
Read more »

Friday, June 24, 2016

Anti spam Image Generator PHP Script Protect Your Blog From Spammers And Bots

Anti-spam Image Generator php script will render PNG image with code to protect your blog/comments/feedback section from spammers and bots (known as CAPTCHA).

Requirements:
  • PHP 4.0.6
  • GD 2.0.1 or later
  • TTF font to use for rendering code. By default it uses arial.ttf. You can find it online.

Features:
  • You can define characters set to use (by default 0123456789)
  • Customizable code length (default is 6)
  • Easy to use / light server load, not overloaded with features

Sample usage:
  • Add this html code where you want to place antispam image: <img src="http://www.website.com/path/to/antispam.php">
  • Add field to the html form to enter code, name it anti_spam_code: <input name="anti_spam_code">
  • Add following check in the php code to check if user entered CAPTCHA correctly:
@session_start(); // start session if not started yet
if ($_SESSION[AntiSpamImage] != $_REQUEST[anti_spam_code]) {
// set antispam string to something random, in order to avoid reusing it once again
$_SESSION[AntiSpamImage] = rand(1,9999999);

// here you add code to let user know incorrect code entered
...
}
else {
// set antispam string to something random, in order to avoid reusing it once again
$_SESSION[AntiSpamImage] = rand(1,9999999);

// everything is fine, proceed with processing feedback/comment/etc.

...
}

Download Anti-spam Image Generator PHP Script

PHP Data Insert and Select Using OOP

In this tutorial i will show you that how to perform and use object oriented programming in PHP with MySql to Select and Insert Data. Using OOP(s) in PHP it's become so easy to manage and perform such operations like Insert and Select data from MySql tables, So let's have a look.

Read more »

Wednesday, June 22, 2016

PHP Date Robust Dates and Times

While PHPs date() function may seem to have an overwhelming amount of options available, isnt it always better to have more choices than not enough? With PHPs date function you format timestamps, so they are more human readable.

This lesson will teach you how to display the current time, formating PHPs timestamp, and show you all the various date arguments for reference purposes.

PHP Date - The Timestamp

The date function always formats a timestamp, whether you supply one or not. Whats a timestamp? Good question!

  • Timestamp: A timestamp is the number of seconds from January 1, 1970 at 00:00. Otherwise known as the Unix Timestamp, this measurement is a widely used standard that PHP has chosen to utilize.

PHP Date - What Time Is It?

The date function uses letters of the alphabet to represent various parts of a typical date and time format. The letters we will be using in our first example are:

  • d: The day of the month. The type of output you can expect is 01 through 31.
  • m: The current month, as a number. You can expect 01 through 12.
  • y: The current year in two digits ##. You can expect 00 through 99
Well tell you the rest of the options later, but for now lets use those above letters to format a simple date! The letters that PHP uses to represent parts of date and time will automatically be converted by PHP.

However, other characters like a slash "/" can be inserted between the letters to add additional formatting. We have opted to use the slash in our example.

PHP Code:

<?php
echo date("m/d/y");
?>

If the 2010 Winter Olympics were just finishing up, you would see something like:

Display:

02/27/11

Be sure to test this out on your own PHP enabled server, its really great to see the instant results available with PHP date!

PHP Date - Supplying a Timestamp

As our first example shows, the first argument of the date function tells PHP how you would like your date and time displayed. The second argument allows for a timestamp and is optional.
This example uses the mktime function to create a timestamp for tomorrow. To go one day in the future we simply add one to the day argument of mktime. For your future reference, we have the arguments of mktime.

Note: These arguments are all optional. If you do not supply any arguments the current time will be used to create the timestamp.

  • mktime(hour, minute, second, month, day, year, daylight savings time)

PHP Code:

<?php
$tomorrow = mktime(0, 0, 0, date("m"), date("d")+1, date("y"));
echo "Tomorrow is ".date("m/d/y", $tomorrow);
?>

Notice that we used one letter at a time with the function date to get the month, day and year. For example the date("m") will return the months number 01-12.
If we were to run our new script just after the 2010 Winter Olympics our display would look like:

Display:

Tomorrow is 02/28/10

PHP Date - Reference

Now that you know the basics of using PHPs date function, you can easily plug in any of the following letters to format your timestamp to meet your needs.

Important Full Date and Time:

  • r: Displays the full date, time and timezone offset. It is equivalent to manually entering date("D, d M Y H:i:s O")
  • Time:
  • a: am or pm depending on the time
  • A: AM or PM depending on the time
  • g: Hour without leading zeroes. Values are 1 through 12.
  • G: Hour in 24-hour format without leading zeroes. Values are 0 through 23.
  • h: Hour with leading zeroes. Values 01 through 12.
  • H: Hour in 24-hour format with leading zeroes. Values 00 through 23.
  • i: Minute with leading zeroes. Values 00 through 59.
  • s: Seconds with leading zeroes. Values 00 through 59.

Day:

  • d: Day of the month with leading zeroes. Values are 01 through 31.
  • j: Day of the month without leading zeroes. Values 1 through 31
  • D: Day of the week abbreviations. Sun through Sat
  • l: Day of the week. Values Sunday through Saturday
  • w: Day of the week without leading zeroes. Values 0 through 6.
  • z: Day of the year without leading zeroes. Values 0 through 365.
Month:
  • m: Month number with leading zeroes. Values 01 through 12
  • n: Month number without leading zeroes. Values 1 through 12
  • M: Abbreviation for the month. Values Jan through Dec
  • F: Normal month representation. Values January through December.
  • t: The number of days in the month. Values 28 through 31.

Year:

  • L: 1 if its a leap year and 0 if it isnt.
  • Y: A four digit year format
  • y: A two digit year format. Values 00 through 99.

Other Formatting:

  • U: The number of seconds since the Unix Epoch (January 1, 1970)
  • O: This represents the Timezone offset, which is the difference from Greenwich Meridian Time (GMT). 100 = 1 hour, -600 = -6 hours

We suggest that you talk a few minutes to create several timestamps using PHPs mktime function and just try out all these different letters to get your feet wet with PHPs date function.


Tuesday, June 21, 2016

Simple jQuery Add Update Delete with PHP and MySQL

In this tutorial we will cover a simple Insert, Update and Delete using jQuery, PHP and MySQL with PDO, well we have lot's of CRUD tutorials on this blog but we haven't jQuery CRUD tutorial yet, and few email requests i received from readers regarding jQuery Insert, Update, Delete with PHP MySQL, so here in this tutorial we will do it, using jQuery to perform such operations become easy and for the better user interface bootstrap is here i have used, let's start.
Simple jQuery Insert, Update, Delete with PHP & MySQL
Read more »

Saturday, June 18, 2016

File Upload and View With PHP and MySQL

We already have a Simple File Uploading tutorial in this blog and now This tutorial demonstrates how you can upload a files using PHP and Store uploaded file into the MySQL Database . With PHP it's easy to upload any files that you want to the server, you can upload MP3 , Image , Videos , PDF etc... files, this will also help you that how can you fetch uploaded files from MySQL Database and view them on Browser, so let's take a look.
File Upload and View with PHP and MySQL
Read more »

Sunday, June 12, 2016

DHTML and CSS CAPTCHA

CAPTCHA is the name of an approach used to distinguish site accesses performed by real humans from robot script accesses.

Usually the pages show fuzzy pictures with letters that the user needs to guess. However there are smart anti-CAPTCHA robots that can also guess what is written in CAPTCHA picture.

This package provides an alternative CAPTCHA solution that consists in using colored boxes that the user must click in order to have access to the protected site resources.

Since this is a new approach, it is harder to break by people that employ common anti-CAPTCHA scripts.

Name: DHTML and CSS CAPTCHA Support forum
Base name: as_snipercaptcha
Description: CAPTCHA validation using colored boxes and AJAX
Version: 1.03.007
Required PHP version: 4.3.0
License: GNU General Public License (GPL)

Detailed description
This class can be used to implement CAPTCHA validation using colored boxes that the user must click which are validated using AJAX requests.

It renders a grid of boxes on which only one box is colored differently to indicate the user must click it.

The class sends an AJAX request to the server passing the coordinates of the user clicks until a given number of clicks correctly point to the colored boxes.

Download here

Dynamic Dependent Select Box using jQuery and PHP

This tutorial will cover creating a simple and Dynamic Dependent Select Box using jQuery and PHP for selecting state and city based on choosing the country, means Loading records from database dynamically and display it in select box without refreshing the whole page with the help of Ajax and jQuery and PHP code, Ajax is used to submit and get records from MySQL Database without page refresh. when you choose country box it will allows state box to choose country based state and same with city using Ajax code integrating with PHP and MySQL.
Dynamic Dependent Select Box using PHP and jQuery
Read more »

Wednesday, June 8, 2016

How to Send e Mail using PHPMailer and Gmail SMTP

hello friends after a long time i'm going to post a simple yet useful post here about SMTP mails, i received few email requests from my readers to post email verification feature in my login and registration tutorial i'll post email verification tutorial after this post this was first step to send emails from localhost and online server as well for that you have to use PHPMailer library, so take a quick a look at this tutorial to understand "how to send SMTP mails using PHPMailer"
How to Send e-Mail using PHPMailer and Gmail SMTP
Read more »

Simple Login and Signup System using PHP and MySQLi

hello friends, we have this tutorial but some users want it using MySQLi extension, so i have decided to post Login and Registration System using PHP with the improved MySQLi. it's a simple script which you can easily understand. for the designing purpose i have used here bootstrap to create login and signup form which is simple and easy to create with the help of bootstrap, if you are using PHP5.5 then you must use new password hashing function, you can see it how to use them here in this tutorial, Login script with MySQL so let's take a look.
Simple Login and Signup System with PHP and MySQLi
Read more »

Thumbnail and Watermark On The Fly

Sometimes we may want to create thumbnails and/or watermark on-the-fly for images on our web sites instead of creating offline by using some tools or image editors. We want to generate it automatically from our php scripts. Thus, we can use thumbnail class made by Emilio Rodriguez  and we can download it from phpclass.org or from here (including an example file 7kb).

/**
*This is a class that can process an image on the fly by either generate a thumbnail, apply an watermark to the image, or resize it.
*
* The processed image can either be displayed in a page, saved to a file, or returned to a variable.
* It requires the PHP with support for GD library extension in either version 1 or 2. If the GD library version 2 is available it the class can manipulate the images in true color, thus providing better quality of the results of resized images.
* Features description:
* - Thumbnail: normal thumbnail generation
* - Watermark: Text or image in PNG format. Suport multiples positions.
* - Auto-fitting: adjust the dimensions so that the resized image aspect is not distorted
* - Scaling: enlarge and shrink the image
* - Format: both JPEG and PNG are supported, but the watermark image can only be in PNG format as it needs to be transparent
* - Autodetect the GD library version supported by PHP
* - Calculate quality factor for a specific file size in JPEG format.
* - Suport bicubic resample algorithm
* - Tested: PHP 4 valid
*
* @package Thumbnail and Watermark Class
* @author Emilio Rodriguez
* @version 1.48 <2005/07/18>
* @copyright GNU General Public License (GPL)
**/



Monday, June 6, 2016

Free Web Spider and Search Engine PHP Script

Sphider is a lightweight web spider and search engine written in PHP, using MySQL as its back end database. It is a great tool for adding search functionality to your web site or building your custom search engine. Sphider is small, easy to set up and modify, and is used in thousands of websites across the world.

Sphider supports all standard search options, but also includes a plethora of advanced features such as word autocompletion, spelling suggestions etc. The sophisticated adminstration interface makes administering the system easy. The full list of Sphider features can be seen in the about section; also be sure to check out the demo and take a look at the showcase, displaying some sites running Sphider. If you run into problems, you can probably get an answer to your question in the forum.


Download Web Spider and Search Engine PHP Script

Tuesday, May 31, 2016

User Registration and Login Script with PHP and MySQL

In this tutorial we will discuss about how to create user registration and login management system with PHP and MySQL in simple procedural way. user registration and login system is most important thing for any kind of web applications and session plays important role in this type of system, for that we have to use session, In this tutorial, we are going to use PHP sessions to keep user login status, here is live demo of this script or you can also download this script, so how to do it let’s see in detail.
User Registration and Login Script with PHP and MySQL
Read more »

Monday, May 30, 2016

PHP Data Update and Delete Using OOP

This tutorial is continuation of my previous tutorial Data Insert and Select using OOPs, In this tutorial i will show you that how to use PHP with OOPs concept for Data Update and Data Delete of MySql, it's so easy to learn, have a look.


Read more »