Creating PDF documents with PHP
Published on : 19.03.2010
Category : PHP Viewed : 0 times.
Step 1 - Install the PDFlib extension
PDFlib is not included with the default PHP 5.3 distribution, so you will have to install it. Download the PHP version of the PHPlib library from here.
The Windows build of PHP 5 comes in many different varieties. I'll assume that you are using the VC9 non-thread safe build, and that you have installed PHP to the default location.
Extract the libpdf_php.dll file from the PDFlib-7.0.4p6-MSWin32-php\bind\php5\php-530-nozts_VS9\ directory in the... |
Dispaying your Twitter status with PHP
Published on : 19.03.2010
Category : PHP Viewed : 0 times.
Step 1 - Define a URL Regular Expression
Twitter posts quite often include links. However, the Twitter API will only return a status update as text, without the HTML markup to identify a link. To get around this we will use regular expressions to turn URLs into clickable links.
The following is a simple Regular Expression that will match URLs in the Twitter status posts.
$url_re = ... |
Filtering Wordpress Categories Using an Undocumented Hook
Published on : 19.03.2010
Category : PHP Viewed : 0 times.
In this article, we will briefly cover Wordpress hooks and use an undocumented one in order to manipulate category listings.
After some further digging, while it is not listed on the Wordpress filter list, it appears that this “undocumented hook” is mentioned on the get_terms() function reference. So, we’ll call this a somewhat undocumented hook.
Anybody who knows me knows that I love Wordpress, if perhaps not more than any man should love a collection of code. I... |
Guestbook tutorial in 3 easy steps
Published on : 19.03.2010
Category : PHP Viewed : 0 times.
Step #1: creating the database and table.
First of all you need to create a database, the process of doing so is fairly simple.
To create a database, you will need to use a database management tool. I personally recommend using phpMyAdmin – it is one of the most popular database management tools out there.
Local servers: If you are using an web server pack (i.e. xampp), it will most likely be here: http://127.0.0.1/phpmyadmin/ If not, you will have to install it manually. You can... |
Very simple PHP counter
Published on : 19.03.2010
Category : PHP Viewed : 5 times.
This is a simple tutorial on how to make your own Web Counter, to put it into your web page. We’ll start by creating a counter text file named “hitcounter.txt” and save it to the same directory you will put your counter in.
Next, open your PHP editor and save the document as “counter.php”.
Now, we’ll set the variable for the file named “hitcounter.txt”. Remember to place the filename in quotes.
Code:
<?php $count_my_page =... |
Installing Wamp Server (Apache+MySQL+PHP)
Published on : 19.03.2010
Category : PHP Viewed : 10 times.
WampServer, originally called WAMP5, is a compilation of Apache, MySQL and PHP that is really easy to install and use. It come also with PHPMyAdmin, for you to easily manage your local databases. WAMP is the acronym of Windows + Apache + MySQL + PHP. As you can see, this is the most important for you to get ready to programming in your local computer as a server.
WampServer install file is about 16MB, and at this time, these are the versions used on WampServer 2.0i: Apache 2.2.11; PHP... |
How to write Shorthand PHP if and else assignments
Published on : 19.03.2010
Category : PHP Viewed : 7 times.
What you don’t hear as a beginner
When you are learning a scripting language such as PHP you will get the basics of assignment, evaluating and comparison operators such as == <= and != (equal, less than or equal, not equal). They are all you need to start writing code that can vary it’s behaviour according to what inputs it is given. Before long though you will want quicker ways of doing things. In this blog post I’m going to start with the long way of doing... |
PHP Tutorial (File Handling): Scratch Pad
Published on : 19.03.2010
Category : PHP Viewed : 0 times.
Prerequisite
Knowledge of basic PHP syntax.
In this tutorial you will learn about
File Handling
Functions
We will be using 3 predefined functions for file handling
fopen: To open a file
file_get_content: To read a file
fclose: To close a file
Little theory before we begin
Opening a file
Predefined function fopen() is used to open a file. It returns a variable which can be used for accessing the file. Returned variable is called as file handler. Syntax:
$var =... |
Working with RESTful Services in CodeIgniter
Published on : 19.03.2010
Category : PHP Viewed : 0 times.
Assumptions
You have a web server set up, locally or online and known how to manage files on it.
You have read a few of the CodeIgniter from Scratch tutorials.
You know how to set up CodeIgniter.
You know a little about RESTful services.
This tutorial is broken down into two parts. We will start by learning how to create a RESTful service, then further down, we will learn how to interact with it in a few different ways.
Part 1 – Creating a RESTful API
Step 1: Setting up the... |
Easy Mod_Rewrite with PHP tutorial
Published on : 10.03.2010
Category : PHP Viewed : 10 times.
I have been playing around with Apaches mod_rewrite on my other site http://www.2big2send.com and i must admit its a whole lot easier than i first thought..
Here is a quick guide for most general use:
Create a new file in your main directory (public_html for cPanel or httpdocs for plesk – not sure about other ones) called .htaccess (Dont forget the ‘.’ dot before the name – you may already have one of these file, thats ok, just edit it and follow the guide... |