December 18, 2002

Pros and cons of .Net

There are two sides of every story, especially in the case of .Net and adopting web servers into your enterprise. This articles makes some good points as to why or *why not* to jump on this bandwagon:

.NET My Services. Gone but not forgotten? - The Register

November 20, 2002

An interesting article for creating a faster loading Flash web site:

Fast-Track Your Flash Site

Add borders and margins to your pages

Nothings more dull than a plain old web page. These tips on using CSS can make your pages more attractive and readable:

Fancy Paragraphs With CSS

November 07, 2002

Usability, revisited

SitePoint Editor Kevin Yanks interviews usability guru Jakob Nielsen, discussing topics such as design, Flash and accessibility:

Interview - Jakob Nielsen, Ph.D.

October 30, 2002

Know your DOCTYPE

Version 6 of both Internet Explorer and Netscape are moving closer to the W3C HTML standards. But for those using depreciated tags and attributes, this could spell trouble. Declaring your Document Type can mean the difference between a broken page and one that works the way you intended as discussed in this article:

HTML Tip: New Headaches with IE 6

October 23, 2002

Some things in life are still free...

Take text editors for example. In addition to EditPad and HTML-Kit, Crimson Editor is a good replacement for Notepad. One of the more useful features is syntax highlighting for several programming languages such as C,C++,C#, Perl and Java. It's also a great HTML editor with macros, spell checker and a FTP client built in.

Crimson Editor - Free Text Editor for Windows

September 26, 2002

And for all you .ASP coders out there...
Essential ASP Hints and Tips

The Dom-father, Part 2

Just in case you didn't get enough from the first article, here's a link to the next installment:

Rough Guide to the DOM - Part 2

September 25, 2002

SPAM Attack!

SPAM is everywhere! When will this ever end? Never. The big thing now is to exploit the very popular Perl script FormMail. If you have ever hosted a web site on a Unix/Linux based server, you've probably either seen or used this script.

FormMail is a generic HTML form to e-mail gateway that sends the results of a form to the specified users. Version 1.6 has some well known security flaws. If you are using this script, you need to upgrade. Soon.

Matt's Script Archive: FormMail

As an alternative, there is a totally rewritten version from the nms Project:

Matt's Script Archive: nms Project

September 17, 2002

Who's your DOM?

To really use JavaScript and CSS well, you need to understand the Document Object Model. Unfortunately, the history of the DOM has been rocky since the major browsers have not implimented it consistantly. Standards have been developed and this author shows some examples using the open-source browser Mozilla.

Rough Guide to the DOM - Part 1

Objects, functions, methods - Oh My!

Still yet another JavaScript tutorial with part one covering some of the basics of JS Objects and Functions. I've read quite a few tutorials and written one or two myself. What I'm noticing is that each author has a different "slant" on how to do things. Isn't programming wonderful?

JavaScript Object-Oriented Programming Part 1

September 06, 2002

Hijacked!

Yes, I have been hacked. Well, my computer here at home where I view my e-mail, anyway. I think it started with one of those SPAM e-mails that will auto-launch a new browser window. Then, the web page that gets loaded in the popup exploits a security hole in Internet Explorer that allows a Registry entry. This little line in the Registry subsequently sets your browser's home page and search page (most likely to a porno site) every time you reboot. It took me a few times to finally track this little bugger down. The one that I was infected with is called HTML/Oprad and I found other similiar exploits, Reg_Startpage.A and Trojan.Winreg.Start.

These trojans take advantage of security hole in Internet Explorer versions 4 and 5. Read the security bulletin and then download the Microsoft patch here.

If you think you've already been infected, search on Google using the keyword OPQFile. You'll find lots of tips on how to root that little annoyance out of your system.

August 05, 2002

Cool buttons without JavaScript

If you've ever tried to work with mouse roll-over buttons with .gifs and JavaScript, you probably wondered "is there an easier way?" This tutorial tells you how to build buttons simply using CSS. They also cover the basics of what makes a 3-D button look 3-D (just in case you missed that in your Art101 class).

Style Master: CSS Buttons

July 05, 2002

HTMEncode
You might ask, what the heck is that and what does it do? Well, for this next quickie I will show you a simple way to prevent visitors from entering javascript or most any other code into you forms that have malicious intent. Most of this code is placed by people who want to see how well your forms hold up under simple "hacking" techniques. Others are ligitimately trying to bring down your Web server and create undue work for the administrators. Either way. HTMLEncode is a server-side function in ASP that prevents this from happening.

Let's examine a simple guestbook form theoretically, and what might happen if you do not HTMLEncode the input values:
Your basic guestbook usually contains several fields or text input areas for visitors to insert their name, email addy, homepage, and a brief rant/rave about your web site. Once the visitor enters this information they will click on submit or send to have it inserted into a database (we will be talking databases here but this can apply to XML or other flat files). The visitors information is then returned via the database back to the browser so everyone can see their information. This is all done via ASP or some other server-side scripting language (we will be talking about ASP here).

Now malicious Joe Schmoe has entered a javascript into the message part of the guestbook and has submitted it to the database. This script tells the browser to endlessly create new popup windows in the visitors browser. Every time a new visitor comes to look at your guestbook the script is ran client side as javascript. Very annoying :( So what can you do? First, you can clean the database out manually so the entry is no longer there and hope he doesn't come back... or you can recode your application to make sure that any characters submitted via the ASP page is HTMLEncoded. HTMLEncode means that each text value entered into the form is encoded server-side before entering into the database. For example, the HTMLEncode version of the "&" symbol is &#amp; many HTML coders know this already and can understand what the encoding does. It takes non-text/extended characters such as the "<", ">", "&", and encodes them to HTML. The "<" becomes &#lt;, the ">" becomes &#gt;, etc. The browser knows to display them in a recognizable form for the viewer.

Now for how it is done on the ASP page:

Let's assume that there are 3 fields you are asking folks to fill out:

Name, Email, and Message.
USER_NAME = Server.HTMLEncode(request.Form ("USER_NAME"))
USER_MAIL = Server.HTMLEncode(request.Form ("USER_MAIL"))
USER_MESSAGE = Server.HTMLEncode(request.Form ("USER_MESSAGE"))

The ASP script, just before INSERTing the values into a database, should have the Server.HTMLEncode before the request.form function. This will encode the values from the Form. At this point you can INSERT them anywhere (just keep that to yourself) and they will be safe for displaying at a later time.

Some reference links for using HTMLEncode:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q259352
http://www.w3schools.com/asp/met_htmlencode.asp


June 30, 2002

GotDotNet.com, another cool site for those looking to develop on the .NET framework. There is a game called Terrarium that allows you to build a Carnivore, Herbivore or Hybrid-type for a "SIMS" survivial sort-of thing. Also, free source code for many applications, such as the message boards.

Got .NET?

June 20, 2002

Ok, so you have decided that maybe you would like to take the plunge and start getting into the .NET development environment. Alas, you do not have $2,500 to pony up for the VS.NET Enterprise Architect, maybe you do but I can think of numerous other goodies I'd rather spend that loot on. Now what do you do? I'll tell you what to do. Head on over to http://www.asp.net/webmatrix/ and pick yourself up a FREE copy of open-sourced IDE made specifically for .NET !@!#$%$! That's right folks it is FREE! Don't say Microsoft never gave you anything for free.

Here's something else that will make you grin from ear to ear, it is a 1.2MB download... you can get up off the floor now. This little project is the best thing since Lavern and Shirley re-runs and the only hefty item you need to make sure you have is the .NET framework itself which is also available here (33MB). The IDE is very similar to VS.NET so there is little to no learning curve if you do decide that the new car you were saving up for can wait cause you need VS.NET.

I can't tell you all the great things about this application here you should get it yourself and jump right in.

June 15, 2002

OK, Let's talk a little bit about ASP.NET and some of the techniques that make .NET the rave on the Web.

One of the great things about the .NET framework is that it supports numerous languages. Most enterprise-wide solutions involve different schools of thought, anything from JAVA to simple HTML. Microsoft's .NET provides functionality for all of the players in the solution to work on their own part of the project at their own pace, and simultaneously. The .NET framework provides "code-behind" functionality - meaning, an application has code behind it working side-by-side with other code. So you may ask yourself... "What does this mean for me?" It means that if you are an HTML designer working on a wire-frame for a Web application, you do not have to wait for the JAVA developers to finish their part before you can work on yours, and vice versa. Everyone can work in parallel as the framework only compiles their specific work and not the whole solution, unless need be.

Secondly, the .NET framwork adds very robust cacheing to the delivering Web servers. When an application is called by a visitor from the web site, it will stay in memory until it needs to be flushed out for a different application. You can see this in action on this simple ASP.NET page, http://www27.brinkster.com/owlick/dotnet/something.aspx.
This page utilizes a feature called "postback form". This means the page is both responsible for displaying the results of the application and processing the the data input by the user.
Because of this, 2 pages are no longer needed for simple form processing. The submitting of the form posts the information to itself via reload, and the HTML is rendered accordingly.

This does not mean that you cannot have an ACTION property. It is just as easy to redirect the user upon submit to another .aspx page for processing. We will stick to the postback topic for now.

Let's take a look at the code for the something.aspx: http://www.randompsycho.org/owlick/dotnet/something.aspx.txt.

The first line: shows the language used as Visual Basic - script language="vb"; and the attribute of runat="server". The language is your preference. Microsoft is pushing C# as the primary language and if you have other object-orientated language experience such as C++ or JAVA you can pick the C# language up fairly easily. I prefer VB.NET as I have experience in Visual Basic.

The second line: starts the Subroutine called Page_Load with the basic variables needed for any .NET application (sender As Object, e As EventArgs). We will not get into this part in depth as the focus of this topic is the ASP.NET page and postback feature and not the rudimentaries of the .NET framework. But to let you know, it is the event for creating an event handler and is most commonly used. When the Page_Load is fired a view state is created and then you can access the Web controls for this particular page.

Third line: comments about the process performed. NOTE: Comments in an application rule! Please use them. It is good practice to do so and helps other troubleshoot your application.

Fourth line: The infamous Response.Write part of ASP. This returns the value entered into the textbox of the form.

Fifth line: Ends the Subroutine.

The next few lines are basic HTML with some added features. You will notice that in the form there are Web controls which you are probably not used to seeing in HTML or traditional ASP. The runat="server" makes the form server-side and secure. The textbox becomes a Web control as and is also run at the server. Make sure you give it an ID as it is what the Response.Write will get for its information. The button also has become a Web control and is run at the server.

Simple form here, but the main issue at hand is... when you run this form you will notice that the speed of which the form processes is instantaneous upon submit. There is NO round trip back to the server for processing. It is handled here, via postback! Cacheing allows for this :) It is a server admin dream and creates a better user experience.

Next time: More postback features and responding to postback form and checking to see if the form has already been posted back.

June 10, 2002

For all of you who need a testing server to test out your .NET creations. http://www.brinkster.com offers one heck-of-a-deal !

May 30, 2002

Fun with JavaScript

When sitting around with extra time on my hands, there's nothing like a online game for entertainment. I found this interesting JavaScript version of Battleship and decided to fancy it up a bit.

For starters, I practiced with some "onClick" code for the button to pop up a window in which to play the game in. The original game displayed your opponent's ships in the window status bar. That didn't suit since I was using a popup window. Snooping through the code I found the function that passed the status value (a variable named "statusmsg") and added one additional line: document.statusbox.display.value = statusmsg; (you gotta love DOM, eh?). The final touches were adding a form to the page (named "statusbox") and a readonly textarea (of course, named "display") and a handy little button that would call a function to reload the page when the game is over.

Credits for the original JavaScript are in the source code. It makes for good reading.

Addendum: After thinking about it for awhile, I realized that I didn't need a special function just to reload the game. Again, the DOM comes in handy and I simply used the reload method of the "location" object. Gee, isn't that easier?

So, give it a try:


May 23, 2002

Just in case you have not already learned how to utilize style sheets:

An Introduction to Cascading Style Sheets (CSS)

Does your site bite?

If nothing else, check out this article to make sure your site isn't one of the examples!

WebmasterBase - 10 Sites that Bite

May 09, 2002

So, you've got a killer web site and you've outgrown that free web hosting package (you know the ones). What's next? Web Hosting Options

Web site confessional

Naw, we'd never do anything that would be considered bad design. No, not ever. (wink) Check out this article, just to make sure.

WebmasterBase - 10 Deadly Web Site Sins

April 30, 2002

April 25, 2002

Pop-ups, you gotta love 'em

Ok, I know, pop-up windows are everywhere. But here is a handy script that sets a cookie so that the message only pops up once per day (adjustable).

Java-scripts.net: Create a Popup Once Window

For those that are artistically inclined, here is the first of a three part series on designing logos:

Design Harbor: Logo Design Workshop, Part I

Apparently there is still much debate over the the use of "cookies" on the Web.

WebmasterBase - The Cookie Conundrum

P.S. Feel free to post your opinion over in the Forums sections too.

Set your own style...

It never hurts to brush up on your style sheets every once and awhile. And for those who haven't starting using CSS yet:
CSS Is Easy!

April 15, 2002

I may have posted this once before, but this is still a handy tool for turning off services on your IIS web server that you don't need (and might be creating a security risk).

IIS Lockdown Tool (version 2.1) - 14 Nov 2001

Been hacked lately?

Here's the latest Security Bulletin from Microsoft on IIS patches (posted April 10, 2002):

Cumulative Patch for Internet Information Services

March 31, 2002

More on preloading your Flash movie. Includes a section on displaying a download progress bar.

The Art of Flash 5 Preloading

March 28, 2002

Ohhhhh, this looks like fun:

WebmasterBase - Animation in Dreamweaver

It's a Flash kind of day

You can never have too many tutorials on how to use Flash 5.0:

WebmasterBase - Flash 101 - Part 1: The Hammer and The Chisel

I've seen sites that have a cute little "Please Wait ..." animation that plays while the main Flash presentation loads, and I've always wondered "how'd they do that?" Well, here's a tutorial on just that.

WebmasterBase - Optimize Preloading with Flash 5

March 26, 2002

Yum, cookies!

They're everywhere. They're handy to have if you need to authenticate your users or track site usage. Here's a good primer on using cookies with CGI/Perl:

Cookies in Perl - Builder.com

March 21, 2002

Sniffing out browsers

Do want to use a spiffy JavaScript trick, but it only works in specific browsers? You can add this to your script to check out what version your reader is using before hand.

Internal Browser Test

March 01, 2002

Tables vs. CSS

I recently purchased a copy of Dreamweaver. Nice product, but it relies almost entirely on HTML tables for layout. Not that there is anything wrong with tables, but the better way to control your page layout is with a Cascading Style Sheet (well, I'll admit, this is still a point of debate within certain circles).

So, for those willing to learn how, let's take a little journey down the CSS path:

WDVL: Toss out your Tables! CSS is the scene!

How do they do that?

Ever see those smooth page layouts with the nice rounded corners? If you're like me, you thought to yourself "How'd they do that?" Well, ponder no longer because this article gives you all the details:

WebmasterBase - The Trick to Rounded Corner Tables

January 31, 2002

Been hacked lately?

An ounce of prevention is worth a pound of cure, as the cliche goes. This handy little tool from Microsoft checks your NT 4.0, Win2K and WinXP servers and lets you know what patches need to be installed and/or updated.

Microsoft Network Security Hotfix Checker (HFNetChk) version 3.3 - 17 Jan 2002

January 16, 2002

This is pretty spiffy. I've seen several sites that have customized their scrollbar colors to match the page layout, but this adds a new twist to that idea:

Dynamic Drive- onMouseover scrollbar effect

It's 2002 and if you haven't started using CSS in all of your web site designs, you really should be. My advice for the newcomer is to learn both CSS and XHTML and keep up to date with the standards.

WebmasterBase - CSS Is Easy!

WebmasterBase - XHTML - An Introduction

Random link of the day

This is just hilarious to me - apparently it's important to win a popularity poll, no matter what!

ZDNet |UK| - News - Story - .Net vote rigging illustrates importance of Web services

January 13, 2002

Happy New Year from the randompsycho.org team!