scriptygoddess

16 Sep, 2002

Form Validation Call for help

Posted by: Jennifer In: Scripts

My scriptygoddess crown to the first person that can give me the PHP code to validate a form field so that no special characters are allowed…

(well, okay it's not really a crown; more like a plastic tiara… how about lots of plugs here, and the good feeling that you've helped out a friend in need?) 😀

UPDATE: Nevermind! I got it! (YAY! I get to keep my tiara!!) ;-P
(Update again: Actually, Amy saw my function and raised it… her's is better/quicker/easier, etc.)
Amy is the grand champion Tiara holder!! 😉

Here's a php function that will return true if the character is alphanumeric, and false if it's anything else:
Read the rest of this entry »

16 Sep, 2002

For the GUI Freaks

Posted by: dave In: Bookmarks

This site actually looks pretty nice… they have some cool tools to dl in the "Tools" section as well.

www.guistuff.com

Comments Off on For the GUI Freaks

Well, for those that know me, its a known fact that I'm an obsessive book reader… so here are a couple scripting books I've been working my way through over the last few weeks:

Windows NT/2000 ADSI Scripting for System Administration
Ok, its VB & VBScript, but the best for scripting windows domain stuff.. a constant reference
Windows Script Host
Everything you need to know about WSH. Useful for Sys Admins, and those wanting to tweak windows…
Professional PHP4 Programming
Great book, just what it says, and not for the newbies.
Professional Apache 2.0
Another fine WROX book… its getting me up to speed on Apache 2.0
Maximum Apache Security
Last listed, but highly recommended.. if you want to know *anything* about security and the web, get this book ASAP. Ins and outs of apache

16 Sep, 2002

Apache Virtual Hosts

Posted by: dave In: Lessons learned

This is really for Web Admins, but someone may be interested…
This is kinda in response to a posting on Jenn's site, but if anyone out there works at all with Apache, do yourself a favor and learn how to use the Virtual Host tags in the httpd.conf file. You can avoid so many "low level" network issues if is configured correctly. An example:

I use the following VH tags to set up name based virtual hosts to tie different names into different IP addresses:
<VirtualHost *>
ServerName netstat.wpsweb.net
DocumentRoot /var/www/htdocs/phpBB2
</VirtualHost>

This lets me set up a host on my server, and any request to netstat.wpsweb.net is resolved to the given DocumentRoot, and others are passed on to other VHs. (Its not a bad idea to set up a default VH to point to your default DocRoot) This name based hosting is very useful. Other directives can be placed in the VH tags (say different logging options) and only have them effect my test site. Lots more information in the Apache Docs.
Read the rest of this entry »

15 Sep, 2002

Display specific words on days

Posted by: kristine In: Scripts

On request of someone in the MT forums, I put together a small php script that displays a different word (i.e. Today) depending on the date stamp of your server. This could be easily modified for any blogging software – this is pointed towards MT.

Here's the basics: If the day is today, display Today. If the day is 1 day ago, display Yesterday. Otherwise, show the Day of the Week.

<?
$today = date("m.d.Y");
$yesterday = date("m.d.Y", strtotime("-1 day"));
$mtdate = "<$MTEntryDate format="%m.%d.%Y"$>";

if ($mtdate==$today) {
echo "Today";
}
elseif ($mtdate==$yesterday) {
echo "Yesterday";
}
else {
echo("<$MTEntryDate format="%A"$>");
}
?>

Enjoy! Its working on my journal right now.

13 Sep, 2002

Multiple blog Updates List

Posted by: kristine In: MT hacks

Are you running more than one blog from your copy of MT? Would you like to have a list of the latest entries in the order they've been updated? The solutions in the past have required you to add a new template to each blog and then use PHP to order them [Brenna's PHP ordered updates thread]. Since I'm already doing something similar with my portal page [PHP portal tutorial], I didn't really want to add another template to each blog every time besides the one I already use in my portal.

With the advent of the MySQL version of MT, its possible to connect directly to the database, and so I am sharing the code I'm using to make a "latest updates" list for my blogs.
Read the rest of this entry »

13 Sep, 2002

Getting Readable Dates from Mysql…

Posted by: dave In: Lessons learned

Well.. this took me a little while, and I'm somewhat embarrased to admit it…

I was writing a script to pull some data from several tables, and the date field looked something like this:
1031849565

Its a Unix Timestamp (representing the number of seconds from Jan, 1 1970 up to sometime in 2037), and luckily MySQL gives you a good way to convert them into readable dates. When you make a SQL query, just add this around the timestamp field:

FROM_UNIXTIME(yourtable.yourfield, '%d, %m, %Y')

So a sample query would look like:

SELECT FROM_UNIXTIME(yourtable.yourfield, '%d, %m, %Y') WHERE yourtable.index > 0;

The %d, %m etc. represent date & time format variables… a complete list can be found in the MySQL Documentation in section 6.3.4

12 Sep, 2002

class vs. ID

Posted by: Jennifer In: CSS

I'm a little slow on the uptake with all this CSS stuff, and the longer an article is, the less likely I am to understand it. So when I can, I try to make things simpler.

One concept I have been trying to wrap my head around is the difference between class vs ID. I always specified styles using the attribute class="classname". I could never understand why/when you'd use ID="classname"… that is until today when I read this article on digital-web

So, here's my cliffnotes version "dumbed" down so I could finally understand it.
Read the rest of this entry »

11 Sep, 2002

Record MTSearch terms

Posted by: promoguy In: MT hacks

If you use the amazing MTSearch add-on, then here is an awesome companion tool.

Graham has put together a way for you to make a text file (or web page) of the search terms visitors to your site use in the MTSearch tool.

Click here to read the hack.

I actually have had difficulty getting it to work, but several others have had great success. If you get it running, be sure and let me know in your comments. Don't be suprised if I start asking you how to get it working for my site!

Enjoy!

UPDATE: Already posted? Dagnabbit! Well, my next post will be better!

09 Sep, 2002

Find out your own IP

Posted by: Jennifer In: Bookmarks

Quick – wanna know what your IP is: IP Chicken.

No, it's not totally script related. Sorry. Yes, there are many other ways of finding that out with command line scary stuff. Just had to post that link because I didn't want to lose it. (and besides, it's funny) :)

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