October PHP-Scripts Blog Archives

How to add Yahoo MyWeb to Wordpress, Blogger and other weblog systems

Last night I added the Yahoo MyWeb button to the end of each post. The screenshot shows where you can find it (next to the “Listen to this post” link). Clicking this button lets users tag and save posts they find useful to their Yahoo MyWeb space. Don’t like how we categorized something? That’s fine, […]

How to email HTML source code in one line of code

To email your HTML source code to you in one line of PHP code just use the following code:

<?php
mail(‘youremail@isp.com’,‘my source code’,file_get_contents(‘http://www.yourdomain.com/yourpage.html’),‘From webserver@localhost\r\n‘);
?>

MySQL 5.0 production version now available, includes subqueries

MySQL 5.0 is now ready for use on production servers touting the following features: stored procedures and SQL functions, triggers, views, cursors, information schema, XA distributed transactions, SQL mode, new federated and archive storage engines, new migration toolkit, instance manager, updated connectors, visual tools and more.
Complete list of changes in 5.0.x production.
The functionality I’m excited […]

Virtual Earth API with commercial site using PHP

Reference: Building your commercial Virtual Earth Website using PHP:
We have already seen some basic C# code behind ASP pages that proxy the search and advertising queries. However, being a web based control you are not limited to working solely with Microsoft on the server side. In this article, we will achieve the same result using […]

Tail -f apache access_log

Here is how to use SSH/Telnet do a search and locate your access_log file. The linux locate command will help:

locate access_log

You might see lots of logs separated by domain names. A common location for these logs are /var/log/apache, so cd your way there:

cd /var/log/apache
/var/log/apache$ tail -f access_log

Now a stream using tail of the file will […]

PHP Markdown Extra

Script/website: michelf.com/projects/php-markdown/
Requirements: PHP
Installation time: Varies. Wordpress plugin installation takes less than a minute
Difficulty: Easy
License: Free, BSD-style open source
Download: PHP source in zip
API: N/A
Author Description: “The Markdown syntax allows you to write text naturally and format it without using HTML tags. More importantly: in Markdown format, your text stays enjoyable to read for a human being, […]

Search and research file extensions with FILExt

We have a Sony VAIO laptop that came preinstalled with Callisto’s Photoparade Slideshow and all my PHP scripts that I downloaded tried to open in that program because it had the .php extension. I changed the association to open in notetab light.
The time will come in your programming and computing travels that you come […]

How to change background color automatically on holidays

Ever notice how Google changes its logo on different holidays throughout the year? I decided this morning I wanted to change the background color and some other themes on one of our websites.
With Halloween, Thanksgiving and Christmas coming I added some code this morning to one of our sites for implementing different background/theme switching so […]

Brief explanation of how to use arguments and globals inside functions

The concept of globalization, functions and arguments can be confusing to those who are new to programming. It’s not too complicated if you look at a very basic example. The following function isn’t very practical, but it works.

<?php
function addThis($a,$b) {
return $a + $b;
}
$sum_of_these = addThis(8,3); // assigns the value of 11 to the variable $sum_of_these
?>

In […]

11 built-in PHP sorting options summarized and reference

PHP has 11 different built-in sorting options as of this writing and the manual, though offering good examples of how to use most of them, doesn’t really put them all on one single, quick summarized reference page. Here’s my attempt at doing just that.
sort - sort alphabetically (a-z) or numerically (0-9)
rsort - sort reverse-alphabetically (z-a) […]