scriptygoddess

24 Sep, 2003

PHP Email Address Encoding Function

Posted by: Jennifer In: Bookmarks

I've developed another email address encoding function in PHP. This works on a similar principle to the well-known HiveWare javascript encoder, but doesn't require javascript to be enabled on the client. Instead, this PHP function just needs to be included in your web page, and then where it is called it will write out an encoded version of your mailto link. The CDT; has reported that encoded email addresses have been effective in preventing spambots from finding addresses on your web site. The function is provided and described on my web site: PHP Email address encoder.

advertisement
Your concerns about business email need to include your business email hosting plan. Your provider should include a user friendly business email interface along with toll free support for your business email. Don't forget to consider your business email hosting server's bandwidth, either.
advertisement

Comments Off on PHP Email Address Encoding Function

24 Sep, 2003

RSS Templates – get 'em while they're hot!

Posted by: Jennifer In: Bookmarks

One thing I've found myself having to dig for are the links to the actual templates for RSS feeds… so here we go.

Here's Christine's scripty post about why you need an RSS feed and what it is. (NOW!) 😉

This is Dive Into Mark's basic template (When you click that link, it looks all funky in the browser, you have to view source to see the code you need… So I just posted it below…) (Dive into Mark's full post here)

Here's Jennifer's template (which is my favorite because it's full post, and comments!)

I know people have other templates out there, so here's your chance to post them. (If you're posting the actual template in the comments – which would be GREAT – so I don't have to hunt for them, or bang my head against the wall when you rename all your pages and I can't find your templates any more) – just don't forget to use the "decoder" link to change all the < to &lt; and > to &gt;
Read the rest of this entry »

24 Sep, 2003

PHP: Anatomy of a file upload

Posted by: Jennifer In: Lessons learned

All details are on the PHP site (but just the highlights because I seem to need it a lot):

$_FILES['userfile']['name']
The original name of the file on the client machine.

$_FILES['userfile']['type']
The mime type of the file, if the browser provided this information. An example would be "image/gif".

$_FILES['userfile']['size']
The size, in bytes, of the uploaded file.

$_FILES['userfile']['tmp_name']

The temporary filename of the file in which the uploaded file was stored on the server.

$_FILES['userfile']['error']
The error code associated with this file upload. ['error'] was added in PHP 4.2.0

Comments Off on PHP: Anatomy of a file upload

The point of this script-snippet is so you can set up two hierarchies of categories. So there's a main category, and a few "sub-categories" below it. An example of this is on Christine's Pixelog site, on her album page.

This differs from the way MT has "Primary" and "Secondary" categories in that in mine, the sub-categories for a main category, can only be a sub category of that one main category – not any other main category. Here's another example: Ohnozone.net . In the sidebar, scroll down to the "categories", You'll see there's a main category "Appearances", and there's sub categories beneath it. "Interviews & Articles" and "TV"
Read the rest of this entry »

17 Sep, 2003

Basic MySQL connection and query with PHP

Posted by: Jennifer In: Script snippet

I use this almost on a daily basis, and yet I can't commit it to memory. So I don't have to go searching for it each time I need to write it…

$databaseName = "YOURDATABASENAME";
$dbconnection = mysql_connect("localhost", "DATABASE-USERNAME", "DATABASE-PASSWORD") or
die ('I can?t connect to the database.');
mysql_select_db($databaseName,$dbconnection);
$value = "SOMEVALUE";
$query = sprintf("SELECT FIELDNAME from TABLENAME where FIELDNAME='%s';", $value);
$result = mysql_query($query);
$totalNum = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
echo $row['FIELDNAME'];
}
////////OR//////
for ($i =0; $i < $totalNum; $i++) {
$row = mysql_fetch_array($result);
echo $row['FIELDNAME'];
}

15 Sep, 2003

PHP and CSS tutorials (and more) from Macromedia

Posted by: Jennifer In: Bookmarks

Stopped by the Macromedia site today (btw – they redesigned for the launch of their MX 4000 versions of their products) and found that they have a number of pretty cool tutorials for PHP, CSS (here specifically for dreamweaver) just to name a few. (look on the side in "topic centers")

Here's one for how to create a persistent shopping cart
Here's a bunch on CSS in Dreamweaver … including one on creating tableless layouts using CSS in Dreamweaver

Comments Off on PHP and CSS tutorials (and more) from Macromedia

12 Sep, 2003

Drag and drop Live Journal into MT

Posted by: Jennifer In: Bookmarks

Recently I decided to stop using Live Journal and decided to move all my writing, comments, and links to my own website. Previously, I had just linked to my journal at the LJ site, but I needed a way to convert my old LJ content to MT.
Read the rest of this entry »

12 Sep, 2003

Color Scheme

Posted by: Jennifer In: Bookmarks|Color Tool Bookmarks

Another cool color tool/palette generator: Color Scheme

[found by Carla, then Melissa]

09 Sep, 2003

.htaccess generator (and RSS Weather)

Posted by: Jennifer In: Bookmarks

A very nice find by Jennifer! This .htaccess generator wil create the code you need for your .htaccess file for various things – like custom 404 pages, hotlink protection, etc…

(update: Looks like there's some issue about that first link being a copy (see comments) – here is the one that is said to be the original: EyeCreate – .htaccess File Wizard)

(She also found a neat RSS Weather thingy™. I've got to start paying attention to the Lockergnome RSS resources!)

09 Sep, 2003

Date Time

Posted by: Jennifer In: Script snippet

Just wanted to store some code I use a lot and am tired of looking up 😉

In some of the scripts I work on, I create a field for a timestamp. For that field I insert the PHP value: time()

When recalling that value, it's just an ugly looking UNIX timestamp, so to format it to something nice, I do the following: (as posted on the PHP manual)

<?php
/*
Assuming the UNIX timestap was for : March 10th, 2001, 5:16:18 pm
and you already did a mysql query, and fetch_array
and the name of the field for timestamp, is 'timestamp'
*/
$today = date("F j, Y, g:i a", $row['timestamp']);
// March 10, 2001, 5:16 pm
$today = date("m.d.y", $row['timestamp']);
// 03.10.01
$today = date("Ymd", $row['timestamp']);
// 20010310
$today = date('\i\t \i\s \t\h\e jS \d\a\y.', $row['timestamp']);
// It is the 10th day.
$today = date("D M j G:i:s T Y", $row['timestamp']);
// Sat Mar 10 15:16:08 MST 2001
?>

Comments Off on Date Time

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements