Authorswati nuna

How to use PDO database connection in PHP

H

<?php $string = ‘Test’; # user submitted data try { #connection $conn = new PDO(‘mysql:host=localhost;dbname=myDB’, $db_username, $db_password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $data = $conn->query(‘SELECT * FROM myTable WHERE name = ‘ . $conn->quote($string)); // $conn->quote used to protect SQL injection...

Why Use PHP?

W

There are thousands of programming languages available and every year, new programs are being made.  But only few of these have become sufficiently popular and are used by many people.   One of which is PHP or hypertext preprocessor.  It is a general-purpose server-side scripting language designed for web development.  It is installed on more than 20 million web sites and 1 million web servers...

How to create CAPTCHA image verification in PHP and jQuery

H

index.php File contains PHP code to load captcha image and text box to input visible word. <?php // Session start must be the first line, whether you include it or not 🙂 session_start(); ?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “; <html xmlns=”; xml:lang=”en” lang=”en”> <head> <title>How to create...

Learning The Many Advantages of PHP

L

PHP, which is short for Hypertext Preprocessor, is an open source server side programming language available at free of cost that can be easily obtained from the market. It has a coding style that is quiet and easy to understand and is usually very proficient on multi-platforms like Windows, Linux, and UNIX and other more. Today, PHP is one of the most popular server side scripting languages...

Drag and drop items using jQuery

D

Required files 1) index.php 2) html.inc 3) jquery-1.8.0.min.js index.php <?php $pre = 1; $content =’ <div id=”drag”> <div> <div> <h4>Title 1</h4> </div> <div>Content 1</div> </div> <div> <div> <h4>Title 2</h4> </div> <div>Content 2</div> </div> <div> <div>...

Learning The Many Advantages of PHP

L

PHP, which is short for Hypertext Preprocessor, is an open source server side programming language available at free of cost that can be easily obtained from the market. It has a coding style that is quiet and easy to understand and is usually very proficient on multi-platforms like Windows, Linux, and UNIX and other more. Today, PHP is one of the most popular server side scripting languages...

A PHP example of when to use rawurlencode instead of urlencode

A

In the computer world, it’s a method for defining interoptibility. RAWURLENCODE follows RFC 3986 This is general syntax of a URI URLENCODE follows RFC 1738 This is general syntax of a URL The main difference between the two is the encoding of a [SPACE] URLENCODE – encodes a space as a plus sign ‘+‘ RAWURLENCODE – encodes a space as ‘%20’ Example...

HTML5 – The Technology Changing the Web

H

HTML5 – it is the next revitalized version of HTML 4.01 that was being developed for the core markup language of the World Wide Web. It is becoming a powerful tool in building a website as itworks on “Write-Once-Run-Anywhere” methodology with high end flexibility, mobility and security. Key Factors of HTML5 – Improved Error Handling – Scripting is replaced by mark up texts...

Display multiple markers in Google Map

D

<html xmlns=”; <head> <meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ /> <title>Google Map</title> <script type=”text/javascript” src=”; <script type=”text/javascript”> var markers = [ [‘Bondi Beach’, -33.890542, 151.274856], [‘Coogee Beach’, -33.923036...

Category