Web Development

Web Development Tips & Tricks, the things that you don’t want to figure out.





Archive for March, 2007

Mastering Regular Expressions (2)

Friday, March 30th, 2007

First chapter complete! And so I shall share with thee my knowledge of this divine subject…

They have a summary of the chapter, so I’ll basically just hit those points. Here are the symbols and what they mean.

  • . or dot means any character – number, digit or symbol.
  • [] encloses a character class, which has it’s own set of rules. It will match any one character listed. For example, [0-9a-zA-Z] is looking for any 1 character that is a digit, a lowercase letter or an uppercase letter. The hyphen in a character class shows a range, like 0-9 means 0 through 9. The only exception is if it’s at the beginning, like [-0-9] would mean to either get a hyphen or a digit.
  • \char can change the value or escape a character. For instance, \. would mean literally a ., while \< and \> can mean the beginning and ending of a word, respectively.
  • ? applies to the preceding 1 character or expression, meaning there may be 0 or 1 of the expression. So you could say colou?r to allow an optional u in the word color. If you said [0-9a-zA-Z]? it would mean an optional letter or digit.
  • * applies to the preceding 1 character or expression, meaning there may be 0 or more. So if you said [0-9]* it would mean that you were allowing an infinite amount of digits, or none.
  • + applies to the preceding 1 character or expression, meaning there may be 1 or more of the expression. So if you put [0-9]+ that would mean that there needs to be atleast 1 number, but can contain an infinite amount.
  • ^ (also called a caret) means to match from the beginning of the line or string, so if you said ^[0-9], it would not match the string “I’m 12″, but it would match the string “12 I am” (it would match the 1, since the character class only matches one character). It also has a special meaning inside of a character class. If you put a caret inside a character class, like [^0-9], that means anycharacter that is not a ______. In this case, any character that is not a digit.
  • $ means it matches at the end of a line. So if we used our previous example, but warped a little bit, ^[0-9]$ would mean the string or line would need to have 1 digit on it, and nothing else. Both “12 I am” and “I’m 12″ would not match. “12″ would also not match. It would match “1″ or “2″. On the other hand, if you put in ^[0-9]+$ that would mean that it would match “1″, as well as “12″, or “314159265″ etc.
  • \< As I briefly mentioned earlier means the start of a word. So if you said “\<at” (I’m starting to use double quotes to make it more clear) that would match “at” or event “attached”, but it would not match “categories”.
  • \> means the end of a word, so if you put “ate\>” it would match “ate” and “fate“, but not “categories”. “\<ate\>” would only match the word “ate”. Note on the last two, they are not supported by all regex utilities, so you should test it before you rely on it.
  • | means alternate when inside of parentheses. For example, if you were matching an extension of a file, like an image, your regex might look something like “(jpg|jpeg|gif|bmp|png|tiff)$”. That would mean any of those options would match.
  • () (parentheses) can be used for alternation, or grouping so that the symbols, ?, * and + will work on entire expression. For instance, if you said ([0-9]\.)+ that would mean you would have the whole expression (0-9]\.) 1 or more times to match. It is also used for captures (coming up next).
  • \1, \2, etc… refers to a back reference. This means that \1 will refer to the text matched in a set of parentheses. The example used in the book was used for editting. If you wanted to find everytime a word was repeated, you could use a regex like “\<([a-zA-Z]+) +\1\>” and that would match any word that doubled itself. If that’s a bit confusion, in english it says, start at the beginning of a word, followed by a word with 1 or more letters, with 1 or more spaces between it and the next word, while the next word is the same as the first word. If that’s a bit confusing, I’m sorry, but here’s an example it would match. “He ran ran to the store.” It would also match “He ran    ran to the store,” or a number of other combinations. Back references may not be supported by all regex checkers, so make sure you test it.

I hope that helped, and if you have any questions, feel free to contact me or get the book. It explains it far better than I did (that was basically a 30 page chapter). I’m just giving you the highlights if you want to get into the nitty gritty fast.

Shopping Carts

Thursday, March 29th, 2007

Which one should you pick? There are many you can pay for, which I’ve never used, and there are many that are free, of which I’ve used a couple.

osCommerce is a great open source (hence the “os”) shopping cart. It’s one of the most widely used shopping carts, but it’s made for huge sites. If you have 5-10 items or so, it’s definitely not made for you .This can supports thousands of items, complex categories and shipping methods and so on. It integrates into all sorts of paying methods, obviously Paypal is one of them. There are also thousands of modules that people have made (since it’s open source) and you can get them all from their home page. They also have a support forum to answer all your questions and thorough help guides. You can completely customize the look and feel of the shopping cart (it can require you to get into the nitty-gritty part of the code), and is overall my favorite shopping cart, and definitely a good pick.

The second shopping cart I found while attempting to find a nice and simple one was Zen Cart. Unfortunately, it related to osCommerce in many ways. It can be used for less items, but it takes a bit to get into it. Not something you pickup and implement in a few minutes (which is what I was trying to do.) I don’t know why you would pick this over osCommerce of vice versa, but if for some reason you have a grudge against one of them, choose the other.

The small shopping cart I ended up using was the Paypal Shopping Cart. It’s free to use, and you simple fill in a bunch of form fields and make a button for each one, and it handles the rest. It’s not very customizable at all, but if you only have a few items, and want to sell them individually, it will do the trick. They have demos you can see, pdfs with instructions and a support form for your use.

One shopping cart I suggest not using is 1ShoppingCart.com. You have to pay for it, and I’ve heard from fellow web friends that it is simply a terrible shopping cart.

If you have any more questions, feel free to let me know.

Until next time,
Kerry

Dreamweaver Templates Replacement

Tuesday, March 27th, 2007

DW templates are useful for the moment, but can be quite cumbersome to other developers.

They essentially make it so you only have to change the necessary parts of each page, and you can change the template and it will change every page. Well that’s great, but I know from my experience and my web friends that it is very hard to transfer a template to some else.

This means that if you ever stop using the template, or another developer has to use it after you’re done, and they can’t easily grab the template off the web (it can be hard,) that they are scrued and Dreamweaver won’t allow them to change the page. Of course you can do little tricks to each page and eventually regain full control, but that can take some time.

Well, why don’t you just use a find and replace? You should! The only thing is, that there are many different tags that it uses with different attributes. To name a few:

  • <!– InstanceBegin template=”blabla” etc. –>
  • <!– InstanceEnd –>
  • <!– InstanceBeginEditable name=”blabla” –>
  • <!– InstanceEndEditable –>

It may take some time to get through all of this. A friend of mine had this problem today, so I half developed it and asked for some help on a regex forum, and came with up with a great regular expression: “<\!–\s*Instance(Begin|End).*?–>”. When you do a find and replace, you have to do it on closed documents (can’t use current document or open documents). The option I used was “Entire Current Local Site” and replace it with nothing, which removed it all affectively.

You might complain, but it’s so useful! I want that functionality. Well, it’s definitely a good functionality but you should go about it in another way. Use a scripting language like PHP or ASP. Usually you only really need to change the body of the page. This means everything that goes before that point should be included in a filer with a name like “header.php” and you do a simple call like “include(‘header.php’);”, and you do the same thing with the footer.

This will keep the same functionality as with the templates. Now, if you want more editable regions, use variables instead. This varies per scripting language, but I’ll give an example with php. If I wanted a unique title tag, I would put the following code in the header.php file:

<title><?php echo $title; ?></title>

Now, when I called the header file, I could do something like this:

<?php
$title = “Phoenix Development – Home”;
include(“header.php”);
?>

That would automatically put your title in the right place. You just do the same includes on every page and change the variables you use, with the one section you have for the main content. Your page would end up looking something like the code below:

<?php
$title = “Phoenix Development – Home”;
include(“header.php”);
?>
<div id=”text”>
<h1>Home</h1>
<p>Hello and welcome to Phoenix Develo…</p>
</div>
<?php include(“footer.php”); ?>

This is much better code design and the web developer after you will be very glad you had it in this easy style. Also, because you can now universally update all your pages by changing something in the header.php or footer.php, you can change your pages much faster and much more efficiently.

I hope this helps,
Kerry

Mastering Regular Expressions (1)

Monday, March 26th, 2007

Hey everyone,

Sorry for the delay between blogs, I was at Mammoth and had a blast skiing. Anyways, I got back a couple days ago and just picked up my Mastering Regular Expressions book which came while I was away.

I’ve just been reading the preface and it definitely looks like it’s going to be a good book, so I thought I should keep you updated. Probably every couple of posts I’m going to do one in this series. I haven’t learnt anything yet, but I’ll be giving you the highlights.

-Kerry

Tools of the Web Master

Monday, March 19th, 2007

There is a vast amount of tools that can be used in web development. In this blog I’m going to give you my opinions on a few of them.

Well, the first thing I’m going to talk about is the use of WYSIWYG (what you see is what you get) editors. One of the most common, and worst ones is Front Page. I haven’t actually used this product, but I’ve never heard someone speak of it highly. I’ve seen it ruin the code on pages (make really confusing a bad code), so I really don’t suggest that.

As a web developer, I don’t actually use WYSIWYG, but I do use Dreamweaver (DW). This is a great design tool and supports all languages besides ASP.NET. Unfortunately, DW isn’t free. If you have the money to get it, it’s got a lot of useful tools and I’ve been using it for years with very few problems. The older versions (not DW 8 ) also can create some messy code if you use the Design View, so if make sure you clean the code up after.

Microsoft Visual Web Developer 2005 Express Edition is a free WYSIWYG. Along that line, they have an express edition (means it’s free) of every language in Microsoft Visual Studio. They are apparantly not a powerful but I haven’t hit their limitation yet, and they’re great tools. They keep your code clean, and they do support ASP.NET (if you’re programming in ASP.NET, this is a must). The reason why I don’t use them all the time is they don’t support PHP, which is their one downfall. PHP is best run on Apache, which is best run on Linux, which is kind of Microsoft’s rival. If you want a free PHP WYSIWYG, I haven’t it before but I think PHP Designer 2007 – Personal is a good one.

Both DW and the Microsoft Visual Web Developer have built in FTP programs, but if you decide on another editor, or already have one that doesn’t include an FTP program, you may want to know a good one. Core FTP LE is a great free FTP program that I’ve used for various other reasons in the past and it works very well, so this is my suggestion.

Another unusual program that can come in handy is a better notepad. Sometimes, for various reasons, you may have to open a certain file in notepad instead of your editor. I’ve tried two, but was completely satisfied with Notepad++. It supports color coding for pretty much every language and some other really good features. It’s definitely my pick.

Graphic tools. There are many different graphics programs that may interest you, many are kind of pricey. My favorite is Adobe Photoshop CS2. It’s kind of complex, but really has the tools to help make great artwork. There are also many tutorials all over the internet to teach how to do pretty much anything with it, and it’s probably the most popular of the graphics programs.

Fireworks is the graphics program that comes in the Macromedia Suite. It’s very user friendly and integrates into the other Macromedia products nicely, but I don’t like it nearly as much Photoshop, even though it has a lot of functionality.

The next program I would go to, the only free one I recommend, is GIMP (pardon the name). It’s the only open source graphics program I know, and it’s supposed to have similar functionality to Photoshop. I didn’t like it because it seemed to be a bit more confusing and used several windows instead of one. I have, however, seen a lot of great artwork created with GIMP, so it’s definitely a good choice.

That’s it for now. There are more specific programs for specific areas of web development, but I will go into those later .

Until next time,
Kerry

How to Initiate Yourself into the Web World

Saturday, March 17th, 2007

Hello,

Today’s post is how to start to become a web designer or web developer. Now, the easy and rather expensive way would be to go to some community college and take classes in their different courses and you’d probably get mediocre skills and be able to do something after them.

I think it’s important to make the difference between a web developer and a web designer. Many people don’t know there is a difference and can cause problems.

  • A web designer is someone who makes the website look nice, and this is very important. They make sure people like your site and want to stay, they induct them into your site. This includes the layout, graphics, text, fonts, and so on. Being a designer you have to have very creative skills.
  • A web developer is someone who makes the website work. They do all the back end programming, which could be as simple as making an email form work, or running a system like Myspace (all the functionality it provides is done by the web developers). Being a developer requires a lot of technical skills.

For instance, I am a web developer, and I know something about 11 different languages. This includes the basics of HTML to more complex things such as PHP, SQL or Regular Expressions (see my post below).

Of course, at the beginning you will be taking the role of both, as your first site probably won’t be very complex. I personally have gone to no classes in web development. I have learned everything I know through online tutorials or asking the help of friends or people on forums. A great place for learning languages is www.w3schools.com. They have a tutorial in nearly every major language, and that’s where I start to learn all the languages I know.

A great beginning for any web person, and especially a designer, is The Non-Designer’s Web Book by Robin Williams. I’ve only read the first 100 pages or so, but it is going over everything having to do with making a website. Some of the prices they quote are a little inaccurate (it does not cost $30 to register a domain), but for the most part it’s pretty dead on. I’ve read one of her other books and it really helped me.

So, what if you get stuck? What if you don’t have any web savvy friends? Well, that’s where forums come in. There are many of them that can help. The one I like the most is Tek-Tips. Unforunately for me, someone got me kicked out of the forum for some bogus reason, and they had a problem with a re-register, so I’ve stopped going there. It was the best when I could go there.

If you need another forum, just search google for “______ forum” and you should find one.

Now, to get started with a website you will need to get hosting. Well, most hosting costs something, but there are a few that you can experiment with, like Freehostia. It might be a bit complex to start up, but they will give you a name like “yourname.freehostia.com” which is better than most people, and if you go the web development branch they support PHP (a very common web language) for you to mess around with.

If you’re looking for cheap but good hosting, 1&1 is great. It’s who I use and they’re very cheap ($2.99 a month with a free domain name). I’ve heard, however, that their support isn’t the greatest. I’ve never had to use their support so I can’t account for personal experiences.

The next paid host I would go to is Godaddy. They are a bit more expesnive (hosting goes from $3.49 to $3.99 a month) and you have to pay separately for their domain. They are supposed to have good support and a good control. I’ve used them once, and they were fine, but 1&1 is cheaper and has some extra functionality.

Hope that helps!
-Kerry

Rich Text Editors (RTE)

Wednesday, March 14th, 2007

For those of you who don’t know, a Rich Text Editor, or RTE, is that really nice looking thing that you can enter text into that will automatically format it (such as bolding, italics, linking, aligning, etc.).

Today, my post is about choosing an implementing an RTE for your website form. Being as frugal as I am, I stuck to the open source selections.

First I was looking for something that was pretty, and when I typed in “free rich text editor”, I naturally got the Free Rich Text Editor website (http://www.freerichtexteditor.com). I took a look at a couple other options, but this one was the prettiest of them all, so I downloaded and started installing it. If you want to skip a nice and long story having to do with this editor, skip a few paragraphs until I talk about the next one.

The first thing I noticed was that it was not designed to be implemented in a page more than once . While it had configuration settings, they were all in a separate js (javascript) file that globally set the identity. I wanted 3 of these on one page, and I wanted unique identities for each one. Well, being the developer that I am, I decided I would fiddle with the code.

I found a way where I could include variables in the initialization function to specify the identity of the form name, it worked! Yay for me! I quickly found out, however, that my javascript form validation wouldn’t work with it. It took me some time to realize why, but I found out that it was in an iframe, meaning it was a separate window, and my validation tool couldn’t pick up iframes. Oh, and as a side note, the actual editor itself created iframes and all the functionality on one of the most confusing javascript pages I have ever seen. In addition, I found no support on the site.

I decided I would make a personal validation tool, I had done it before and I saw no reason why I couldn’t do it now, and I had already spent over an hour, maybe two, working on this and wasn’t about to give it up. Before I did that, I needed to find a way to give each iframe window a unique ID. I tried the same trick of adding it to the parameter list, which I thought worked. I then came to another error, it was in another function. I found where it called that function (in the initialization function) and added it to it’s parameters too. Got by another function, but got hung up on another one.

It had been 2-3 hours now and I was getting sick of it. I needed an RTE that didn’t use iframes, it was a simple as that. I trashed that project and started looking some more, and found that most RTEs use iframes, apparently it was the easier way to do it. Oh, I had also spent about an hour fiddling with some CSS to make it look right, as I found another design on the site had set some CSS properties, so I was thoroughly done having to do anything with it.

I finally decided I would handle it tomorrow (or today), as it was 3:30 AM and I had other work to do. Well, my friend who had heard me complaining about my RTE, decided to search. While I worked elsewhere he kept showing me more RTEs he found, and I kept pointing out the outpoints. He finally found one that looked promising, TinyMCE. MCE stands for “Moxiecode Editor”.

It is an open source editor that converts your textareas into RTE forms. Wow, perfect! I can use my normal names and ids for my textarea and they cross over. I looked into it more, and they had a wiki support form with a LOT of data, tons of example, some special plugins, etc. I decided to install it when I woke up.

The installation went quickly and it worked like a charm, no CSS hassles, the customization I needed was shown in clear examples on the website, was perfect. Well, I thought it was perfect, but then I found my validation didn’t work again. I was curious as to why.

It was a weird symptom because my validation would say it was an empty field when I submitted, when I submitted again (no changes) it found it filled. I found that a special call was being made on the form that takes the data and sticks it into the text area (all documented on their site), but this was done on the submit, and my validation ran right before the form was submitted. I simply placed an onclick event to my form, so that it called it BEFORE my validation got to it, and it worked perfectly. This was the code I added to my form: onclick=”tinyMCE.triggerSave();”
I also installed one of their plugins, TinyMCE Compressor (supports all major scripting languages besides classic ASP). This makes it load much faster, but I warn you, there is a bug. They have an installation guide to it in their wiki, which you should follow exactly except on one point. There is a plugins options and it lists a ton of plugins that the compressor will speed up. If you’re using any of the plugins, fine, leave them in. I found that when I left them at the default, my “add link” button wasn’t working, and found other people had the same thing. I was told to make plugins section empty, which I did and it worked fine. I have a feeling it was a plugin called “advLink”, but I’m unsure. I found this answer on their support forums when I did a couple of searches.

Now, it all works fine and I’m really happy with it. If you need help with any of the tweaks I did, let me know

-Kerry

Regular Expressions

Monday, March 12th, 2007

This is an area that I had/have very little experience with, but is one of the most powerful tools a web developer can use. If you don’t know what it is, I suggest you learn.

So, what is a regular expression? “A regular expression (regex or regexp for short) is a special text string for describing a search pattern.” (Regular-Expressions.info)

You might be thinking “Okay, but what does that mean?” It basically means you can define a set of symbols and letters to find a string or character within a string. A string could be defined as a certain set of letters, words, numbers, symbols or a combination of them all. For example, the regular expression “[0-9]” would find the first digit in this phone number string “(800)123-4567″. It would return saying it found the letter 8.

They are a big use in validating an input on a form. For example, lets say on your Contact page you have an e-mail form where they are asked to put in their name, email and a message to you. Well, you don’t want people to give you a bogus email do you? Using a regular expression like this: “\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b” and that will make sure they use the right email. Of course that is extremely confusing if you don’t know what they do, so that’s why I’m writing this blog so you have some resources so that you can learn or just get regular expressions.

Probably the best site to get regular expressions from is RegExLib.com, where thousands of users submit their own RegEx’s and are all available to you. They have a search so you can search “email” and it will give you tons of different examples, or “date” (I made one that I will get to in a bit) and so on. It also has a resources section, which includes some free downloadable programs that will help you validate or create regular expressions. I got one of them, The Regex Coach. Unfortunately, it tries to be helpful and auto update as you type, but it can severly lag the program. Although this feature can be useful, I’d rather have a hotkey to press to check the Regex, so I might be searching for another program soon.

Another useful link is RegExAdvice.com, where they have a forum where you can ask for help with your regex. There are also tons of blogs specifically about regex, so if you need help with someone from actual live people, this is the place to go. I haven’t actually done that much here, mainly because I hate waiting for other people to continue working, I like finding the answer myself.

Tutorials. Well, that’s probably what I should have infoed you about first. I would have, too, if I had gone in that order, but I only did my tutorial after the rest of my studying recently. I’ve done some here and there but they were really confusing and could only vaguely grasp the concepts. Well, I was searching for a good one so that I could recommend it to other people, and I found one: Regular-Expressions.info. Here you will see some of the same examples I gave at the top, and also a “quick” tutorial. I did that quick tutorial tonight, and though it’s a lot of data to grasp at once (I don’t recommend trying to go through the whole thing in one go), it’s very good. If you have seen regular expressions before and only have a half understanding like I did, it goes over a lot of the symbols that are used and makes things make so much more sense. Apart from their quick tutorial which is divvied up into sections, they also have thorough tutorials on each section (not a paragraph or two). I’m probably going to go through those one at a time to make sure I really understand everything.

Of course that’s the free way of learning, and it’s how I’ve learned pretty much all of my web knowledge. You can, however, also buy books. I’ve had some good recommendation for O’Reilly books (like on CSS and HTML/XHTML), so I checked if there was an O’Reilly Regular Expressions book. They actually have two, a “Pocket Reference” and one called “Mastering Regular Expressions“. I plan on getting the latter first, and once I do “master” them get the pocket reference.

I actually do often learn a lot just by pocket references, or cheatsheets, things that just give you the raw data for you to program. They’re quick and get to the point, and I learned about about regular expressions from RegExLib.com’s Cheatsheet, which goes over a quick definition of pretty much all the symbols, though they aren’t necessarily complete.

Oh, I thought I should note that you need to be careful if you are using a script (such as javascript) that uses “\” for other functions (like “\n” means new line). For instance, “[0-9]” and “[\d]” both specify a single digit and are completely identical, but in javascript you can’t say “[\d]“, you have to say “[\\d]“.

This is to make sure a field contains a format in the php datetime (includes both the date and time) format for a date only, which is “yyyy-mm-dd”: “^[0-9]{4}-[0-9]{2}-[0-9]{2}$”. If you don’t have that specific format, my javascript validator will alert you.

The other one I made, which I reluctantly realized had already been created by someone on RegExLib, is one that validates image extensions. It is true that mine is slightly better in the fact that it validates the whole image file name, and not just the extension, but here you go:
“^[0-9A-Za-z_ \-]+(.[jJ][pP][gG]|.[jJ][pP][eE][gG]|.[gG][iI][fF]|.[pP][nN][gG])$”. I might change it a bit later so that you can enter a folder name, like “/images/logo.jpg” and it will work, rihgt now you have to enter just the name “logo.jpg”. That verifies the formats jpg, jpeg, gif and png.

One last thing, if you need an online validator, RegExLib.com has one and the one I use implements the javascript regex function (as I told you there can be slight differences depending what regex engine you’re using), so that I get as close to right for my javascript validation as possible before I implement. Here’s the link: Regular Expression Tester.

I will probably be doing more updates once I get the O’Reilly book on this subject, or if I come up with more cool regexs, but this is it for now.

-Kerry

P.S. In case anyone is wondering, I am not trying to “promote” these sites or companies, I don’t get any money for it and I don’t have some agreement where I link to them and they link to me (I wish), it’s for the sole purpose that you’ll have the references you need.

Site Maps (Free Script)

Thursday, March 8th, 2007

All praise the glory of sitemaps!

A sitemap can be two things. There is the sitemap page that you see on someone’s website, which can be just some unordered lists or indenting, maybe a touch of CSS (Apple Sitemap), or you can do a little more with it (Download.com Sitemap). You can be completely original and make something really cool, like Websites in a Flash Sitemap. These show you all or the majority of pages on a website, and it is sometimes easier to navigate with them.

Then there is the xml sitemap that helps your SEO. These pages are a bit more complex and have a strict protocol which must be followed. Sitemaps.org goes over this protocol with detail, probably more than you need, if you plan on creating them by hand (I’ll go over other methods below). These sitemaps show crawlers what other pages there are on a site and helps them get indexed, as long as they are in the correct format. It can also tell Google other information, like it’s priority in relation to your other files.

You should submit your sitemap to search engines, obviously the largest being Google. Part of the webmaster tools (an issue for another blog) includes checking out your sitemap and making sure it can be read ok. If you want to submit your sitemap to Google, go ahead and click here. There are two methods that I know to create your sitemap xml file (other than hand coding, and who wants to do that these days?):

  1. Use a website to scan and create your sitemap xml file.
  2. Use a program to create them.

I tried and online website, and I don’t remember why I didn’t use the file, but I ended up with a downloaded program and loved it, so I stuck with it. Here’s a site if you want to try one: http://www.sitemapspal.com/.

The program I got is called GSiteCrawler. If you’ve noticed I’m mainly centered around Google, though I do suggest you put some time to get your sites listed in other search engines, the main ones at least.

Here’s the home page for GSiteCrawler: http://gsitecrawler.com/. This program has a lot of added functionality, you can choose what type of files you want it to pickup, you can exclude files, it has an ftp program so it will automatically upload your sitemap file to your site, you can set it on auto so it will do it periodically, it will help you sign up with the Google and Yahoo tools you submit your sitemap, it will create statistics and much more. The biggest thing is it’s free, and I’m one of those annoying frugal types and hate to buy anything I don’t have to, and I still hold there is a free program that is as good or nearly as good for any paid program (prove me wrong, I dare you).

Now, onto what prompted me to write this post. I’ve always been annoyed by any script or any page where you have to update something twice. If you change one thing, then it should change everything else relevant. Poor programming shows otherwise, if you don’t use includes and you add a page onto your site, you have to go through every page of your site and add another link to your nav bar, and that’s just annoying.

My point being, you shouldn’t have to update your xml file and your sitemap file every time a page changes. Well, how would you fix this? You have to get one to change the other or be based on the other (it reads it and generates a page). I’m sure there are scripts like this out there already, and I just couldn’t find them, but I decided to make my own. I’ve spent pretty much the last 6 hours on it, way too long I know, but I wanted to get out all the bugs and I wanted it to handle all situations.

Realize, if you have a special sitemap like the Websites in a Flash one above, this won’t work. The sitemap xml file has very little data for you to be creative with, all it contains is the link location, possibly the priority of the files, the frequency it was updated, and possibly the last time you modified the page. That’s not much info to move the links around, categorize them, etc., with a automated script. The only real way to separate them is by their link names and the folders they’re in, and then you can use css and do all sorts of things (like you could make a separate div with a box for each folder, and the links are in that div).

Well, I managed to create that script. Right now it can create your sitemap off of two pieces of information, the link to your sitemap and your website link, and voila, it will create it all for you. It automatically gets the name of each file in relation to it’s file name, for example. If you have a page “about-us.php” it will turn it into “About Us”. Right now this only works for -s, but it also has the ability to rename files and folders of your choice. You can say that you want “aboutus.php” to display “About Our Company” or anything else, same with folders.

Here’s the site I was working on: http://www.viewyourrights.com/sitemap.php. If you’re interested in the script and would like to check it out, leave me a comment with your e-mail and I can send you the files. I’ll also help you with changing the structure of it if you want (using CSS to make it look cooler).

Catch ya on the flip side,
Kerry

The Rise From The Ashes

Wednesday, March 7th, 2007

Ok, a dramatic title but not really anything to back it up, even though today is kind of symbolic.

Phoenix Development, my company, finally got a website up and running. Even though it has a temporary layout and is under construction, it has four pages up and is functional. You can see it here: http://www.phoenixdev.net.

Anyway, this blog will probably mainly be things regarding web development, design, hosting, SEO or something in the web line. But just in case, be prepared for that random blog, might hit you when you least expect it. They will also probably be much longer than this, and the links off this page will probably increase, and there are many changes that you will see in the future.

-Kerry