Posts Tagged: php
-
Aug 29, 2011
Comments OffHow to Send Email (Text/HTML/Attachments) in php
Email is the most popular Internet service today. A plenty of emails are sent and delivered each day. The goal of this tutorial is to demonstrate how to generate and send emails in PHP. So, you want to send automated email messages from your PHP application. This can be in direct response to a user’s...
-
Aug 29, 2011
Comments Offhow to work with Directories in php
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...
-
Aug 29, 2011
Comments OffHow to make 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. If you do not know how to set up a system DSN read our tutorial How to set up a system DSN. For our example below...
-
Aug 29, 2011
Comments OffBlocking 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. There...
-
Aug 29, 2011
Comments OffHow 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. What is “secure,” anyway? Realize that the data in your database is not safe. What if the password to the database is compromised? Then your entire user password database will be compromised as...
-
Aug 29, 2011
Comments OffHow to Create CAPTCHA Protection using PHP and AJAX
Download Source 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. So if you use CAPTCHA on your web site forms, this can help in stopping some bots and making life harder for other bots in accessing or using your...
-
Aug 29, 2011
Comments OffHow to Pass 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. One of the frequent problems is defining visitor’s screen...
-
Aug 29, 2011
Comments OffHow to Create Thumbnail Images using PHP
Download Source 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. Below we will create...
-
Aug 29, 2011
Comments OffUsing Regular Expressions with PHP and with advance php
Regular expressions are a powerful tool for examining and modifying text. Regular expressions themselves, with a general pattern notation almost like a mini programming language, allow you to describe and parse text. They enable you to search for patterns within a string, extracting matches flexibly and precisely. However, you should note that because regular expressions...
-
Aug 29, 2011
Comments OffCreating Word, Excel and CSV files with PHP
Browsing the World Wide Web you can find out various methods of creating files with PHP. In this article we demonstrate several ways to create Microsoft Word and Excel documents, and also CSV files using PHP. MS Word document Using HTTP headers Using COM objects Using OpenOffice templates Using Zend Framework component phpLiveDocx MS Excel...
-
Aug 29, 2011
Comments OffRecord locking in Web applications
Record locking is used for preventing simultaneous update of the same data and therefore avoiding inconsistent results. A locked record means it is not available for editing by other users. 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...
-
Dec 28, 2010
Comments Off6 free ajax chat applications using PHP | free-ajax-chat-applications-php
While talking about chat application, these days people hate those kind application made in PHP which need page refreshing. In this post, I’ll show you six different free Ajax chat applications which might be very useful if you’ve to use Ajax based chat application. Depending upon the requirement of your chat application, you can use...
-
Nov 30, 2010
Comments OffAdd content verification using hmac in PHP
Many times a requirement arises where we are supposed to expose an API for intended users, who can use these API endpoints to GET/POST data on our servers. But how do we verify that only the intended users are using these API’s and not any hacker or attacker. In this blog post, I will show...
-
Nov 30, 2010
Comments Off7 Useful functions to tighten the security in PHP
Security is a very important aspect of programming. In PHP, there are few useful functions which is very handy for preventing your website from various attacks like SQL Injection Attack , XSS attack etc.Let’s check few useful functions available in PHP to tighten the security in your project. But note that this is not a...
-
Nov 30, 2010
Comments OffPassword Encryption and Decryption Technique in PHP
I’ve noticed that many of my friends are storing password in database without encrypting them. This is really a bad technique because if somebody who has access of the database can easily know the password of the particular person. The best functions available in PHP for encryption are md5() and sha1(). These both are one...
-
Nov 30, 2010
Comments OffOpen Source Human Resource Management System using PHP and Mysql
Administration Module (Admin) The part of the system where the HR Manager or other appointed personnel perform all system administration tasks. This include defining company structure, pay grades and other information that serves as the backbone for the rest of the system. Security issues are taken care of through this module as well by defining...
-
Nov 30, 2010
Comments OffManage Server Hard Disk Using PHP
PHP provides some sweet functions to manage the server’s hard disk. Here’s how to use them. copy() Copies a file from a source file. $result = copy(‘original.txt’,'new.txt’); disk_free_space() Returns the number of bytes remaining on the disk. $free_space = disk_free_space(‘/’); disk_total_space() Returns the size of the disk in bytes. $total_space = disk_total_space(‘/’); file_exists() Confirms whether...
-
Nov 30, 2010
Comments OffCreate a CSV file from MySQL with PHP
There are a couple of ways to export data from MySQL to a CSV file but neither of them supports adding a header row to the CSV which contains the column names. This post looks at how to export the data from MySQL into a CSV file with PHP including a header row. The example...
-
Nov 30, 2010
Comments OffPaging Using PHP and MySQL
When there’s more than one column involved in paging there isn’t much that we need to modify. We only need to decide how to count the total number of rows we have in the table. Consider the student table. This table have five columns as shown in the SQL below. CREATE TABLE student( id INTEGER...
-
Nov 30, 2010
Comments OffPrevent Your CSS and JavaScript Files From Being Cached
Some websites use highly volatile, oft-changing CSS and JavaScript files. In the case of these files, it’s important that the developer prevent browsers from caching them. How do we do that? By using a phantom querystring, of course. We’ll use PHP to tack the current time onto the file reference. The PHP <link href=”/stylesheet.css?<?php echo...