Archive for My Projects

Save the Javascript!

I had a bit of a scare this morning when my web site editor (MUST get Dreamweaver back!) decided to delete a chunk of js from one of my client’s sites during a routine update. Hooray, I got to rewrite it. I figure that I ought to save it for posterity and my posterior somehow in case it happens again. It’s a working form validation script.

<script language=”JavaScript” type=”text/javascript”>
<!–
function checkform ( )
{if (form1.email.value == “”) {
alert( “Please enter your email address.” );
form1.email.focus();
return false ;
}
if (form1.FirstName.value == “”) {
alert( “Please enter your first name.” );
form1.FirstName.focus();
return false ;
}
if (form1.LastName.value == “”) {
alert( “Please enter your last name.” );
form1.LastName.focus();
return false ;
}
if (form1.company.value == “”) {
alert( “Please enter your company name.” );
form1.company.focus();
return false ;
}
if (form1.honeypot.value != “”) {
alert( “Do not enter anything into the last field. It catches bots.” );
form1.honeypot.focus();
return false ;
}
return true ;
}
//–>
</script>

This chunk of script is placed inside the <head> tags. My form looks like this:

<form action=”/gdform.asp” method=”post” name=”form1″ onsubmit=”return checkform();”><input name=”subject” value=”About ” type=”hidden” /><input name=”redirect” value=”/articles/thankyou.shtml” type=”hidden” />First
Name:<br />
<input name=”FirstName” type=”text” /><br />
Last Name:<br />
<input name=”LastName” type=”text” /><br />
Email:<br />
<input name=”email” type=”text” /><br />
Company or Organization:<br />
<input name=”company” type=”text” /><br />
Comments: <br />
<br />
<textarea name=”comments” cols=”40″ rows=”3″>Type
comments here.</textarea><br />
<br />
Put nothing in this field. It’s a bot catcher. <input size=”1″ name=”honeypot” /><br />
<input name=”submit” value=”submit” type=”submit” /><br />
</form>

I use a honeypot as a bot-catcher. It’s still in the early stages, so we’re seeing how it works, but I have not been thrilled with CAPTCHAs in the past. They seem to be going out of style, as well as being unreliable. Remember when using a form validation to modify the “onsubmit” of your form tags so that it runs the script. Also, in the form validation script, make sure that in the if (form1.LastName.value == “”) tag, “form1” corresponds to the name of your form, as specified in the “form” tag.

Comments (1)

Venturing into Object-Oriented PHP

One thing I’m doing this winter to keep myself from boredom is to teach myself a new language that will help me out in the website world. I am currently reading the book Object-Oriented PHP by Peter Lavin, published by No Starch Press. You can order it here on Amazon.

So far, it’s basically easy to understand. I’m only on Chapter Four because I’m taking it slow, but even though I have no previous experience with PHP, I still know what’s going on. It helps that I have a background in C++, because the function calling is very much the same.

I haven’t tried to make anything yet because I’m not to that point, but I have downloaded PHP5 and the Apache server in hopes that I might make something cool at some point. I’m pretty excited– this seems like a very viable way to do a lot of things for the web. I’ll update when I do make something, as simple as it might be.

Meanwhile, I need to upload all the back issues of Down The Tubes. I have been lax!

Leave a Comment

Time for an “I just got Adobe CS3” dance routine!

Yes, yes indeed, I forked over way too much money for the Adobe CS3 Web Premium upgrade. I’ve heard a lot of things about how much it sucks, etc etc, but by golly, I freakin’ need Dreamweaver and Flash. GoLive was just not cuttin’ it. Add in the extra happiness of Fireworks, and I’m pretty pleased with it all. I just spent five hours on a small let’s-get-used-to-Flash-again project with no problems, so I’m keeping my fingers crossed.

Um, wahooo!

To see my dinky little horse-ownership joke flash, you’ll have to head over here to this here page (www.whinwhinsituation.com/flashpage.html).

Hahaha, I know, stupid flash, but  jeez it felt good to work on it again.

I have to say, though, that thus far I HATE ActionScript 3.0. Maybe I’m just not used to it.

Thoughts?

Leave a Comment