Posts Tagged ‘php tutorial’

Tutorial: Uploading Files in PHP

August 15th, 2012 Leave a comment
Tutorial: Uploading Files in PHP

Once you have learned the basics of using forms in PHP, the next step is to begin working with and manipulating files. With PHP, you can allow users to upload files to the server and then use or store them. In this tutorial we will use a basic HTML form with a PHP script to upload files to your server. To begin, we will create an HTML form in our upload.htm file. <html> <head> <title>PHP File Upload Example</title> </head> … View full post »

Generating PDF files with PHP

May 2nd, 2012 Leave a comment 1 comment
Generating PDF files with PHP

If you are looking for a way to convert HTML to PDF, check out this post. This article continues the PDF series but addresses a slightly different task. In PHP, generating files is easy, but sometimes you need to have complete control over the content generation such as how documents are generated for printing. This is when using PDF files is handy because they give you a greater amount of control than HTML or other document types. Here, I will walk you through how to create PDF files dynamically using PHP a free tool called Free PDF library (FPDF)… View full post »

PHP: Insert Text Into File at Position

March 7th, 2012 Leave a comment
PHP: Insert Text Into File at Position

This is a small PHP tip I used to insert arbitrary text into a file at a specific position. There are times when you need to insert (or rather, append at a given position) an arbitrary text into a file from within your PHP application. It only takes a few lines of code, but I didn’t find an exact solution to this on Google, so I decided to share my own solution with you. The link below is as close as I got to what I needed: http://www.neoseeker.com/forums/45/t1544597-php-append-text-to-file-at-specific-position/, but the code from there was overwriting the contents of the file… View full post »

PHP Tutorial: An Introduction to PDO

July 5th, 2011 Leave a comment
PHP Tutorial: An Introduction to PDO

Since its inception, PHP has moved from a procedural language to an object-oriented one; some of its procedural roots, however, still linger. One of these procedural remnants is an antique method of accessing SQL databases; many programmers still use the older mysql and postgresql procedural modules to access databases, and even those who have switched to newer methods, like mysqli, might still be hampered by the fact that such a module only works with mysqli. PHP has since implemented better methods, but many procedural PHP developers are unsure of how to use newer, object-oriented MySQL connection methods. Let’s delve… View full post »

Check for Available Username with CakePHP, Ajax and jQuery

September 27th, 2010 Leave a comment 9 comments
Check for Available Username with CakePHP, Ajax and jQuery

When a user registers for your web site, it is usually a requirement that they have to select a unique username. It can be a pain when your usual usernames are taken. You keep submitting the form just to wait and then see an error message that the username is already taken. Using Ajax to check and see if a username is available before the user submits the form will make your registration page more friendly. Here is one method for doing it using CakePHP, Ajax and jQuery. First, we are going to create a very lighweight… View full post »

PHP Contact Form Tutorial

May 25th, 2010 Leave a comment 3 comments
PHP Contact Form Tutorial

Many web sites are opting to use a contact form to allow its visitors to communicate. This is larger due to the prevalence of spam bots which harvest email addresses from web sites. In this tutorial, we’re going to build a simple contact form in PHP. This is going to be a pretty simple contact form. We’ll be using a single PHP file to display the form and to process it. This simplifies things quite a bit. Ready? Let’s get started. Step One: Creating the Form The first step is to create some HTML markup for our… View full post »