Showing posts with label using. Show all posts
Showing posts with label using. Show all posts

Tuesday, June 28, 2016

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 »

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

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 »

Tuesday, June 21, 2016

Performing WHOIS Using PHP

If you need to get the whois information for a specific domain, why not using PHP to do it? The following function take a domain name as a parameter, and then display the whois info related to the domain.

The PHP Code is given below:

function whois_query($domain) {

// fix the domain name:
$domain = strtolower(trim($domain));
$domain = preg_replace(/^http:///i, , $domain);
$domain = preg_replace(/^www./i, , $domain);
$domain = explode(/, $domain);
$domain = trim($domain[0]);

// split the TLD from domain name
$_domain = explode(., $domain);
$lst = count($_domain)-1;
$ext = $_domain[$lst];

// You find resources and lists
// like these on wikipedia:
//
// http://de.wikipedia.org/wiki/Whois
//
$servers = array(
"biz" => "whois.neulevel.biz",
"com" => "whois.internic.net",
"us" => "whois.nic.us",
"coop" => "whois.nic.coop",
"info" => "whois.nic.info",
"name" => "whois.nic.name",
"net" => "whois.internic.net",
"gov" => "whois.nic.gov",
"edu" => "whois.internic.net",
"mil" => "rs.internic.net",
"int" => "whois.iana.org",
"ac" => "whois.nic.ac",
"ae" => "whois.uaenic.ae",
"at" => "whois.ripe.net",
"au" => "whois.aunic.net",
"be" => "whois.dns.be",
"bg" => "whois.ripe.net",
"br" => "whois.registro.br",
"bz" => "whois.belizenic.bz",
"ca" => "whois.cira.ca",
"cc" => "whois.nic.cc",
"ch" => "whois.nic.ch",
"cl" => "whois.nic.cl",
"cn" => "whois.cnnic.net.cn",
"cz" => "whois.nic.cz",
"de" => "whois.nic.de",
"fr" => "whois.nic.fr",
"hu" => "whois.nic.hu",
"ie" => "whois.domainregistry.ie",
"il" => "whois.isoc.org.il",
"in" => "whois.ncst.ernet.in",
"ir" => "whois.nic.ir",
"mc" => "whois.ripe.net",
"to" => "whois.tonic.to",
"tv" => "whois.tv",
"ru" => "whois.ripn.net",
"org" => "whois.pir.org",
"aero" => "whois.information.aero",
"nl" => "whois.domain-registry.nl"
);

if (!isset($servers[$ext])){
die(Error: No matching nic server found!);
}

$nic_server = $servers[$ext];

$output = ;

// connect to whois server:
if ($conn = fsockopen ($nic_server, 43)) {
fputs($conn, $domain." ");
while(!feof($conn)) {
$output .= fgets($conn,128);
}
fclose($conn);
}
else { die(Error: Could not connect to . $nic_server . !); }

return $output;
}
Enjoy!

Saturday, June 18, 2016

Using the static Statement to Remember the Value of a Variable Between Function Calls


If you declare a variable within a function in conjunction with the static statement, the variable remains local to the function, and the function "remembers" the value of the variable from execution to execution





<?php
function numberedHeading($txt) {
static $num_of_calls = 0;
$num_of_calls++;
echo "<h1>".$num_of_calls." ". $txt."</h1>"; }
numberedHeading("Mobile Phones");
echo "<p>We build a fine range of mobile phones.</p>";
numberedHeading("Camera");
echo "<p>Also Digital Cameras..</p>";
?>

The numberedHeading() function has become entirely self-contained. When we declare the $num_of_calls variable on line 3, we assign an initial value to it. This assignment is made when the function is first called on line 7. This initial assignment is ignored when the function is called a second time on line 9. Instead, the code remembers the previous value of $num_of_calls. We can now paste the numberedHeading() function into other scripts without worrying about global variables.

Friday, June 17, 2016

Creating a Simple Pagination Script using PHP PDO with jQuery

hi there, this tutorial will cover creating a simple pagination script using PHP MySQL with jQuery, i have used here "bootpag - jQuery plugin for dynamic pagination" this plugin is easy to use which creates dynamic pagination with jQuery using PHP, when we have number of records in MySQL table, we must paginate them, we already have a pagination tutorial using PHP OOP and PDO without jQuery, now in this tutorial i have used jQuery which makes pagination easy, so before proceed you can see live demo of jQuery pagination or you can download and try it, have a look.
Creating a Simple Pagination Script using PHP PDO with jQuery
Read more »

Multiple Insert Update Delete example using PHP MySQLi

This tutorial will guide you that how to perform multiple insert, update and delete operations using PHP & MySQLi, using this script you can update or delete multiple rows of MySQL database at a time on checkboxes selection with multiple insert, in my previous tutorial we have seen that how to Select / Deselect all checkboxes using jQuery, so using jQuery we can select all or multiple records from MySQL database and perform update or delete operations with the selected records, for better user interface i have used here again Bootstrap framework, we already have CRUD tutorials in this blog but i haven't cover this topic yet, so let's see the code.
Multiple Insert, Update, Delete (CRUD) using PHP & MySQLi
Read more »

Monday, June 13, 2016

Update Multiple Records Based On Radio Buttons Using FOR EACH

Today I will share a code snippet which will enable you to update multiple records based on radio buttons selection.

Consider this scenario:

Players are applying to play for a football team. There are more players than there are places, so some will get to play for the First team, some for the B team, some will be in the Reserves, and some will not get selected at all.

If you want to be able to pull up all players and assign their application result in the database in one update process.

Now you can do it using FOR EACH as shown in the snippet below:


foreach ($_POST[result] as $id => $result) {

$results[$result][] = $id;

}

$query = "UPDATE tablename SET result = CASE ";

foreach ($results as $res => $ids) {

$query .= sprintf("WHEN id IN (%s) THEN %s ", join(,, $ids), $res);

}

$query .= END;


Hope php script can guide you in the right direction.

Enjoy!

How to Create Pagination with PHP PDO using OOP

In this tutorial we will see that how to create Pagination with PHP, PDO using OOP concept, when we have number of records in database then we must Paginate the data, this is very Simple tutorial using PDO and OOP without using Ajax or jQuery it is based on pure PHP, i have created one class file using that class file you can make Pagination of database records and this class file featured with next and previous links based on the page.
How to create Pagination with PHP, PDO using OOP
Read more »

Sunday, June 12, 2016

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 »

Friday, June 10, 2016

Submit PHP Form without Page Refresh using jQuery Ajax

In today's tutorial i am going to share the most useful jQuery functions $.ajax() and $.post(), using these two functions you can submit the PHP Web Forms without Refreshing the whole Web Page of Your Site, The jQuery get() and post() methods are used to request data from the server with an HTTP GET or POST request, hence $.post() function is a Shorthand Ajax method, so this tutorial will guide you that how to use jQuery's $.ajax() and $.post() functions easily to submit PHP Form Data to the Server Web Page without Refreshing the Page, let's see it in detail.
Submit PHP Form without Page Refresh using jQuery, Ajax
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 »

Tuesday, June 7, 2016

PHP Visitor Tracking Script using jQuery

This simple PHP visitor tracking script uses jQuery and Raphael javascript library to display daily hits to your page. The class features: IP filter (for IP’s you don’t want to track) Unique visits counter Raphael analytics (example on the bottom of the page) No search engine robots tracking Total hits counter Visitor IP’s info Visitor host info Referring pages info Visited pages info MySQL log table creation.

Download PHP visitor tracking script

Saturday, June 4, 2016

Redirect To Another Page In PHP Without Using Header

A little bit of Javascript might help you to rediect to another page.A sample code is given below:

<?php

// show some bits
printf("<html><body>");
printf("Just some bits on this page...");

// do your condition based tests
.....

if ($myConditions != $meetsExpectation)
{
printf("<script>location.href=errorpage.html</script>");
}
else
{
// show other stuffs
}
?>
Hope this leads you in the right diection.Though there are many other ways of doing it,this appears to be the simplest one,isnt it?

If you like this php script the please subscribe to our blog and we will send you updates from this blog right in your Inbox.

Enjoy!

Thursday, June 2, 2016

PHP PDO CRUD Tutorial using OOP with Bootstrap

In this tutorial we will see that how to create database CRUD operations using Object Oriented concept in PDO with Bootstrap framework, i have used here Bootstrap framework for front-end design and the MySQL database operations will done by PDO and OOP, recently i have posted pagination tutorial using PDO and OOP and one of my blog reader request me to post that how to use OOP concept to create CRUD operations in PDO, so in this tutorial i I'm going to explain OOP with PDO using Bootstrap framework.
PHP PDO CRUD tutorial using OOP with Bootstrap
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 »

Sunday, May 29, 2016

Ajax Registration Script using jQuery with PHP and MySQL

This tutorial will show you how to create Ajax Signup form with jQuery using PHP MySQL and PDO. this will also guide creating a simple registration form using BootStrap, in most of websites you might have seen a registration form which accepts data from users and store into MySQL database without page refresh, this tutorial will also cover an important jQuery Validation part, proper validation using jQuery and database connectivity using PHP, you can look at live demo and try it yourself from the given download link, let's take a look.
Ajax Registration Script using jQuery with PHP and MySQL
Read more »

Monday, May 23, 2016

Creating an Image Gallery from Folder using PHP

Creating an Image/photo gallery from a folder or directory of pictures, images using PHP is easy no MySQL database needed, so in this tutorial i am going to tell you that how to create image,photo gallery using PHP from an images folder, here using some few lines of PHP code you can generate image gallery or thumbnails to display images from folder and show as a thumbnails on browser easily, so take a quick look at this tutorial.
Creating an Image Gallery from Folder using PHP
Read more »