Home page
 
 Home 
 ASP 
 PHP 
 SQL 
 HTML 
 JavaScript 
 Search 
 Contact 
 
Search
or browse popular tags
Subscription

Sign up for the free email newsletter for new tips, tutorials and more. Enter your email address below, and then click the button.

Privacy Policy

RSS Twitter

All pages tagged PHP

PHP: Sending Email (Text/HTML/Attachments)

So, you want to send automated email messages from your PHP application. This can be in direct response to a user's action, such as signing up for your site, or a recurring event at a set time, such as a monthly newsletter. Sometimes email contains file attachments, both plain text and HTML portions, and so on. To understand how to send each variation that may exist on an email, we will start with the simple example and move to the more complicated. More...

Tags: PHP SEND EMAIL TEXT HTML DUAL FORMAT ATTACHMENT SMTP SERVER Hits: 1071093 Comments: 20

PHP: How to Get the Current Page URL

Sometimes, you might want to get the current page URL that is shown in the browser URL window. For example if you want to let your visitors submit a blog post to Digg you need to get that same exact URL. There are plenty of other reasons as well. In this tutorial we will show how you can do that. More...

Tags: PHP CURRENT URL SERVER BROWSER Hits: 1043971 Comments: 26

Using Regular Expressions with PHP

Regular expressions are a powerful tool for examining and modifying text. They enable you to search for patterns within a string, extracting matches flexibly and precisely. This tutorial gives a brief overview of basic regular expression syntax and then considers the functions that PHP provides for working with regular expressions. More...

Tags: PHP REGULAR EXPRESSION MATCH REPLACE PATTERN SPLIT FILTER PERL Hits: 802408 Comments: 27

PHP: Multidimensional Arrays

Array does not have to be a simple list of keys and values; each array element can contain another array as a value, which in turn can hold other arrays as well. This way, you can create a multi-dimensional array. In this article principles of using multidimensional arrays are explained and source code defining multidimensional array and displaying the array values on the web page is given. More...

PHP: How to connect to MSSQL database

This tutorial describes how to connect to MSSQL database with a DSN and without a DSN. More...

Tags: PHP CONNECTION DATABASE MSSQL DSN ADODB DRIVER RETRIEVE PRINT Hits: 447860 Comments: 21

Secure File Upload with PHP

PHP makes uploading files easy. You can upload any type of file to your Web server. In spite of security issues that should be addressed before enabling file uploads, the actual mechanisms to allow this are straight forward. In this tutorial we will consider how to upload files to some directory on your Web server. We will also discuss security issues concerned with the file uploading. More...

Tags: PHP SECURE FILE UPLOAD HTML VALIDATION SIZE TYPE UNIQUE Hits: 390528 Comments: 45

Creating Word, Excel and CSV files with PHP

In this article we demonstrate several ways to create Microsoft Word and Excel documents, and also CSV files using PHP. Learn how to create files using HTTP headers, COM objects, OpenOffice templates, fputcsv function. More...

Tags: PHP CREATE WORD EXCEL CSV FILE Hits: 379047 Comments: 0

Back Up and Restore a MySQL Database

If you're storing anything in MySQL databases that you do not want to lose, it is very important to make regular backups of your data to protect it from loss. This tutorial will show you two easy ways to backup and restore the data in your MySQL database. You can also use this process to move your data to a new web server. More...

Tags: MYSQL BACKUP RESTORE ZIP SHELL PHPMYADMIN HOW-TO Hits: 365216 Comments: 3

PHP: Create Thumbnail Images

This tutorial will describe how to create thumbnail images on the fly using PHP. Furthermore you will learn how to process a whole folder of images and create their thumbnails. Since this requires the GD library, you will need an installation of PHP with at least GD 2.0.1 enabled. More...

Tags: PHP DYNAMIC IMAGE THUMBNAIL GENERATION GD2 STORE Hits: 335537 Comments: 46

Create CAPTCHA Protection using PHP and AJAX

CAPTCHA is a simple test to determine if a user is a computer or a human. It is used to prevent spam abuse on the websites. The goal of this tutorial is to demonstrate how to make your own simple CAPTCHA protection using PHP and AJAX technologies. More...

Tags: PHP JAVASCRIPT AJAX CAPTCHA DYNAMIC IMAGE GENERATION GD SECURE SPAM Hits: 247274 Comments: 34

PHP: How to Encrypt Passwords in the Database

If you are developing a password-protected web site, you have to make a decision about how to store user password information securely. This article will show you how to encrypt user passwords with md5 algorithm and how to start using encrypted passwords if you already have users' database ready. More...

PHP: Passing Javascript variables to PHP

JavaScript is mainly used as a client side scripting language, while PHP is a server side technology. Unlike Java or ASP.Net, PHP doesn't have tools to make it work client side. That is why you need to combine JavaScript and PHP scripts to develop powerful web-applications. More...

Tags: PHP JAVASCRIPT VARIABLES PASSING SCRIPTS GET Hits: 210166 Comments: 14

PHP: How to connect to MySQL database using PHP

Before you can get content out of your MySQL database, you must know how to establish a connection to MySQL from inside a PHP script. To perform basic queries from within MySQL is very easy. This article will show you how to get up and running. More...

Tags: PHP CONNECTION DATABASE MYSQL FUNCTIONS RETRIEVE PRINT SQL QUERY Hits: 184267 Comments: 25

How to install and cofigure PHP 5 on Windows box

This article explains the steps you need to follow to configure PHP and secure its correct operation. More...

Tags: PHP INSTALLATION CONFIGURE PHP5 WINDOWS HOW-TO SETUP IIS APACHE Hits: 137888 Comments: 11

Form Processing with PHP

One of the best features of PHP is possibility to respond to user queries or data submitted from HTML forms. You can process information gathered by an HTML form and use PHP code to make decisions based off this information to create dynamic web pages. In this tutorial we will show how to create an HTML form and process the data. More...

Tags: PHP FORM PROCESSING GET POST TIPS DYNAMIC Hits: 115404 Comments: 11

PHP: Working with Directories

As is necessary for any language, PHP has a complete set of directory support functions. PHP gives you a variety of functions to read and manipulate directories and directory entries. Like other file-related parts of PHP, the functions are similar to the C functions that accomplish the same tasks, with some simplifications. This tutorial describes how PHP handles directories. You will look at how to create, remove, and read them. More...

Tags: PHP PHP5 DIRECTORIES FILES FUNCTIONS RECURSION ITERATORS Hits: 109553 Comments: 2

PHP: Conditional Statements

Sometimes when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this. In this tutorial we will look at two structures: if...else and switch statements. In this tutorial we will will show you how to use both of them. More...

Tags: PHP CONDITIONALS IF SWITCH ACTION CONDITION Hits: 108938 Comments: 2

jQuery File Upload

Wow, Yet another upload plugin! What makes it different?

  • It's new. Supports all modern technologies.
  • It's good looking and works out of the box. Based on Bootstrap and Glyphicons icons.
  • Cross domain upload, client size images resing.
  • Supports multiple platforms (PHP, Python, Ruby on Rails, Java, Node.js, etc)

More...

Tags: PHP UPLOAD JQUERY PYTHON Hits: 89825 Comments: 0

Debugging PHP with Xdebug

The Xdebug is the extension for PHP that helps debugging PHP scripts by providing a lot of valuable debug information. Using the Xdebug you can debug your scripts in the Notepad++ and other PHP IDEs. More...

Tags: PHP DEBUG XDEBUG NOTEPAD++ Hits: 88146 Comments: 0

How to create a dump of MySQL database in one click

Your users probably asked you to add an option to export the whole database to SQL file. This can be done in phpMyAdmin or Navicat of course but your users want something simpler than that. More...

Tags: PHP MYSQL BACKUP DUMP EXPORT Hits: 84413 Comments: 0

PHP: Export Database Schema as XML

Sometimes it can be useful to have a dump of the current database schema. This script reads the schema from a MySQL database and outputs XML that describes the schema. More...

Tags: PHP MYSQL XML SCHEMA Hits: 80150 Comments: 7

PHP: Arrays

Arrays can be used in many ways to store and organize data quickly and efficiently. It is one of the more useful data types available to any programming language. This article describes the basics to create and make operations with indexed, associative, and multidimensional arrays. More...

PHP: Blocking access to the login page after three unsuccessful login attempts

Sometimes you need to add an extra protection to password-protected website. This article explains how access to the login page can be restricted after three unsuccessful login attempts. This schema uses visitors IP address to store log attempts in the database and block access to login feature for 30 minutes after third unsuccessful attempt. More...

PHP: How to Sort an Array

It is often necessary to arrange the elements in an array in numerical order from highest to lowest values (descending order) or vice versa (ascending order). If the array contains string values, alphabetical order may be needed. Sorting a one-dimensional arrays is quite easy. More...

Tags: PHP ARRAYS SORTING INDEXED ASSOCIATIVE REVERSE NUMBER STRING Hits: 63201 Comments: 2

PHP: Variables

A variable is a holder for a type of data. So, based on its type, a variable can hold numbers, strings, booleans, objects, resources or it can be NULL. In PHP all the variables begin with a dollar sign "$" and the value can be assignes using the "=" operator. This article shows the basic idea on how to use variables in PHP, along with examples, and descriptions of the examples. More...

PHP: Looping Statements

PHP performs several types of repetitive operations, called "looping". Loops are set of instructions used to repeat the same block of code till a specified condition returns false or true depending on how you need it. This tutorial shows the basic idea on how to use looping statements in PHP, along with examples, and descriptions of the examples. More...

Tags: PHP LOOPING FOR WHILE DO...WHILE FOREACH BREAK CONTINUE LOOPS Hits: 55664 Comments: 1

Bike - drop in phpMyAdmin replacement

Pretty often you need to run a couple of queries against your MySQL database on the client's web server. Usually phpMyAdmin does the job well but there are situations when you just need to upload something to the server and open in the borwser, without any configuration steps.

Welcome Bike, lightweight phpMyAdmin replacement. If you already have a CMS installed on the web server (WordPress, Drupal, Joomla), simply upload Bike to CMS's subfolder and open it in the browser.

More...

Tags: PHP MYSQL PHPMYADMIN Hits: 47845 Comments: 0

Reading the "clean" text from PDF

Portable Document Format (PDF) is a file format created for document exchange. Let's read the plain text from the PDF file. More...

Tags: PHP PDF PARSE Hits: 45261 Comments: 1

What is PHP?

PHP stands for Hypertext Preprocessor and is a server-side language. This article introduces you to PHP. You will learn basic PHP syntax, what it looks like, and possibilities that PHP provides you with. More...

PHP: Functions

A function is a block of code which can be called from any point in a script after it has been declared. It is basically a compartmentalized PHP script designed to accomplish a single task. Functions are useful because they contribute to rapid, reliable, error-reducing coding, and increase legibility by tiding up complicated code sequences. More...

Tags: PHP FUNCTIONS CREATE SCOPE LIFETIME RE-USABLE CODE Hits: 40119 Comments: 3

Using Cookies in PHP

A cookie is a message given to a Web browser by a Web server. The browser stores the message in a small text file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, the cookie is sent back to the server too. The main purpose of cookies is to identify users and possibly prepare customized Web pages for them. In this tutorial you'll learn about using Cookies in PHP. More...

Your first PHP Script

Now that you have installed all the support software for running PHP, you are ready to learn how to do a PHP script. Writing a PHP script is very simple. No special software is needed, except a text editor like Notepad in which the script is written. More...

Tags: PHP SYNTAX RULES PRINT OUTPUT Hits: 31408 Comments: 10

PHP: DSN and DSN-less connections

DSN stands for 'Data Source Name'. It is an easy way to assign useful and easily rememberable names to data sources which may not be limited to databases alone. DSN-less connections don't require creation of system level DSNs for connecting to databases and provide an alternative to DSNs. This tutorial will show you how to connect to an Access database with a DSN and without a DSN. More...

Tags: PHP ACCESS DATABASE DSN DSN-LESS ADODB OLEDB DRIVER CONNECTION Hits: 29577 Comments: 0

What can php do for you?

List with some of possibilities that PHP provides you with. More...

Tags: PHP POSSIBILITIES ADVANTAGES FEATURES Hits: 24748 Comments: 6

PHP: Constants

Constants just as variables are used to store information. The main difference between constants and variables is that constant value can not be changed in the process of running program. It can be mathematic constants, passwords, paths to files, etc. More...

Tags: PHP CONSTANTS VARIABLES DIFFERENCE BUILT-IN OUTPUT Hits: 24484 Comments: 3

Reading the "clean" text from RTF

Rich Text Format (often abbreviated as RTF), to surprise of many, is quite complex text data format. During its long history RTF bought a lot of add-ons that disturb the process of getting "clean" text. Let's try to solve that... More...

Tags: PHP RTF PARSE Hits: 18208 Comments: 0

Reading text from DOCX and ODT

In this article we will resolve the task of reading the "clean" text from the Office Open XML (more known as DOCX) and OpenDocument Format ODT using PHP. Note that we are not going to apply any third-party software. More...

Tags: PHP DOCX ODT Hits: 16958 Comments: 0

Record locking in Web applications

In this article we describe how to implement record locking in web applications. Because of the stateless nature of HTTP, you cannot really know whether the user left the page or is still looking at your site. We used the lock confirmation technique combined with lock expiration to solve this problem. More...

Tags: PHP RECORD LOCKING WEB APPLICATIONS Hits: 14155 Comments: 0

Better PHP developer

Many web developers consider PHP as a second class language. The truth is, as DHH puts it: "You can build the best web application in the world with any language you want". We are here not to start a religious war but to help beginner PHP developers get better. Here is the some of the best advice from season PHP programmers.

First steps

  1. Get into the habit of commenting your code thoroughly from the outset, your future self will thank you https://www.phpdoc.org/
  2. Ignore any online tutorials, stack-overflow solutions or any other PHP code snippets on the internet that are older than 3 or 4 years (use Google's advanced search date tools to filter out older content). PHP had evolved dramatically in the last few years, and much of what is out there is wrong, insecure and bad practice. More...

    Tags: PHP,DEVELOPER,BEGINNER Hits: 4708 Comments: 0







Copyright © 2005-2014             www.WebCheatSheet.com All Rights Reserved.