How to Add HEREDOC Syntax Highlighting for PHP in Bluefish

Bluefish is a pretty good editor for programmers and web designers which supports syntax highlighting for many languages – PHP included.  While I do like it, there is one little problem when it comes to highlighting PHP code that contains HEREDOC syntax.

(more…)

 

How to Send Email Using PHP

Sending email using PHP is a pretty straightforward task and this short how to will show you exactly how to do that. The key to sending emails in PHP is the mail() function. Here’s how to to use it:

< ?php
// example number 1 – the basic
mail("email@address.com",
 "subject of message",
 "body of message");

 <a href="http://coderscult.com/php/2008/06/14/how-to-send-email-using-php/#more-45" class="more-link">(more…)

 

PHP cURL Cookies Example

Want to learn how to use PHP cURL with Cookies? Well, it’s pretty simple so let’s go see the code but first let’s make a scenario…

Say we have a page called ‘cookiepage.php’ in a particular website that checks for the cookie set by the homepage and will only return the proper output if the cookie exists. How do you do it? Here’s how…

(more…)

 

How to Post Data with cURL in PHP

Do you need to post data to a website using PHP? It’s actually pretty easy to do. Here’s the code.

< ?php
$urltopost = "http://somewebsite.com/script.php";
$datatopost = array (
"firstname" => "Mike",
"lastname" => "Lopez",
"email" => "my@email.com",
);

 <a href="http://coderscult.com/php/php-curl/2008/05/20/how-to-post-data-with-curl-in-php/#more-40" class="more-link">(more…)</a>

 

PHP cURL Tutorial and Example

Do you want to learn how to use cURL in PHP? Well, if so then this tutorial is for you. But before anything else, what is cURL?

cURL is a command line tool for transferring files with URL syntax. The strong point of cURL is the number of data transfer protocols it supports. It is distributed under the MIT License which makes cURL free software. It supports FTP, FTPS, HTTP, HTTPS, TFTP, SCP, SFTP, Telnet, DICT, FILE and LDAP. – based on Wikipedia’s definition

(more…)

 

Setting up your PHP Development Environment

I realized that a lot of people who want to learn PHP are having hard time getting started with it – not because PHP is difficult to use or understand but simply because they don’t know where to start. Because of this, I decided to write this short how-to on getting started with PHP. It covers all the necessary stuff to setup Apache, PHP, and MySQL as well as to install one of my favorite PHP editors.

(more…)

 

PHP Date Validation Using strtotime()

Here’s a nifty little script I use to validate date input with PHP. This function can accept any common date entry and return true if the date is valid or false otherwise.

The Script

<?php

 <a href="http://coderscult.com/php/2008/03/12/php-date-validation-using-strtotime/#more-5" class="more-link">(more…)</a>