Arc and Angle To me programming is more than an important practical art. It is also a gigantic undertaking in the foundations of knowledge. – Grace Hopper

9Sep/110

Find A Website’s IP Address

I started this blog when my whole focus was about learning and sharing, and since I've had a job, I've neglected the poor thing. Noo! I'll try to be better. I tend to make too big of a deal out of blog ideas and then put them off, instead of just regularly and spontaneously sitting down and just sharing random thoughts/tidbits. I tend to wait until I have a great big lesson, as though I'm planning a web design course or something. I think I'm going to attempt to simply share a thing or two a week. They don't need to be major.

So, for today's small little tidbit, I'm going to share something that I knew, but forgot about and was reminded only a few minutes ago while watching a Youtube clip. Sometimes, one needs to find the IP address of a website. Maybe you're really interested in the numbers that represent your own website, but most likely, you need it for some sort of functional purpose.

A recent example of this has happened at my job when we had built a new website for a client on our own server. We had simply pointed their domain name from their previous hosting account to their new hosting account with us. It turned out that some of the company's employees had saved some bookmarks to certain pages of their previous website on their desktops, and when we pointed the domain name to new servers, they couldn't access their page anymore...even though they hadn't yet canceled their old hosting account. The files were still on it, but the domain name wasn't pointing to that server anymore.

So we told them that as long as they still had access to their hosting account, we could probably get the specific directory moved to the new server. We had the proper FTP username and password, but the domain name wasn't going to work. We needed their IP address in order to connect to that server. They didn't know what their IP address was.

When I need a client's IP address and they don't know it off the top of their head, which is rather normal and probably healthy, I was sending them to http://whatismyipaddress.com/, which is fine, but it's much faster and much more responsible to simply get the IP myself...and I forgot that I could use command prompt to do just that.

So, to all dorks, web designers and others, this is a really really simple way of getting a websites IP address:

How To Ping A Website for it's IP Address

Step 1: Open your command prompt. On my current computer using Windows XP, you just go to the Start menu, then click run. Type "cmd" (without the quotes) to open command prompt and click OK.

Step 2: Once your command prompt is open, type: ping websitename.com (don't actually type websitename.com. Type in the name of the website that you want to retrieve the IP address from.) So for example, you could type: ping arcandangle.com and it was display a few bits of information including the IP address.

That's it. I should mention that in the example I started with, I wouldn't be able to ping that client by their domain name and get their old IP address. It would have given me the current IP address that their domain name was pointing to, which would have been our own server. BUT, the lesson here is that before transferring a domain name, I could have pinged and recorded their IP address just in case I needed it in the future.

28May/110

Dynamic Select Menu With Javascript

OK, so I promised I'd write something about how to dynamically change parts of a web form using javascript. As an example, I'm going to change the options on an HTML select menu based on which radio button a user selects. Do to the fact that it is spring and I'm anxious to plan a vacation, I decided that my example should be travel-related. So what I'm going to do is show you how to present two radio button options to your user asking them if they'd prefer a domestic vacation or a vacation abroad. Then, depending on which radio button they select, the options of destinations which change.

First I'll show you the code that goes in your header and then I'll show you the code that goes in the body section of your page. After both code blocks, I'll explain what's happening.


This code goes in the header of the page:




This code goes in the body of the page:


What type of travel destination would you prefer? Abroad Domestic

Explanation

The code in the body section of the page is an HTML form with two radio buttons and one selection menu. When either radio button is clicked, it calls the function that is written in the header and passes the function its value (in this case, it's either passing the function a value of '1' if the abroad button is clicked or '2' if the domestic button is clicked.) The statements in the function then set the values and text of the options list depending on which value it receives.

So, starting with the form. The first line is the opening form tag containing three form attributes: action, method and name. The action is the address of where to send the form-data when a form is submitted. Since this is just an example, I just put a generic web page down. Usually it would be sent to a form processing page. The method is how the form is sent, either by "post" or "get" method. The name is the name of the form. So this form is submitting its data to a page on my site called dynamic-option-list.html via the post method and the name of the form is "travel".


The next few lines create the two radio buttons. They are part of the same set, so they have the same name attribute: type. The first one has an initial value of 1. It is set to be initially checked when the page first opens. It also uses the "onclick" event, which performs whatever action is in the quotes when a mouse is clicked on that object. In this case, when the mouse clicks either radio button, the onclick event calls the function named ChangeOptions() and passes it its value. So if a user clicks the second button, the onclick event calls the ChangeOptions function and passes it a value of "2".



What type of travel destination would you prefer?
Abroad
Domestic



The function is declared in the header inside of script tags. The function is named "ChangeOptions" and receives the value from the element that called the function. In this case, let's pretend a user clicked the second radio button. That button has a value of 2, so when it is clicked, the onclick event calls the ChangeOptions function, which receives the button's value of 2.


function ChangeOptions(ElementValue)

The statements inside of the function's brackets then check to see if the value is 1 or 2 and sets the values and text of the selection menu's options accordingly. It uses the javascript "with" statement, which basically allows you to write less code. We could write code for each option that basically says, "If the value is 1, then set the text on the element named "optionList" of the form named "travel". Instead, we're using the "with" statement to say, "In all instances contained within these brackets, we're referring to the form named travel....so please don't make me repeat it each time." Document refers to the web page itself.

The "if" statement grabs the value received by the function (in this example 2) and says, if the value is equal to 2, then do these following statements. optionList [0] refers to the first option (originally "Australia") and sets its text to "California" and changes its value to 0. The options are basically an array that can be identified by an index number starting with 0. So the first option has an index of 0, the next option has an index of 1, etc.


{
	with (document.forms.travel)
	 {
		if (ElementValue == 1)
		{
			optionList [0].text = "Australia"
			optionList [0].value = 1
			optionList [1].text = "South America"
			optionList [1].value = 2
			optionList [2].text = "Europe"
			optionList [2].value = 3
		}
		if (ElementValue == 2)
		{
		optionList [0].text = "California"
		optionList [0].value = 0
		optionList [1].text = "Florida"
		optionList [1].value = 1
		optionList [2].text = "New York"
		optionList [2].value = 2
		}
	 }

	}


17May/110

Illustrator Compound Path

What is a compound path?

A "compound path" is an object made of two or more paths.

You may create a compound mask to:

  • Add "holes" to a path
  • When "creating outlines" of text and you want to preserve the transparent holes in some letters (like the middle section of an "O" "A" "R", etc.
  • When applying a gradient across multiple paths

So, let's say you have some text and you want to "create outlines". If you have a black "O" on top of a red circle, you want the middle of the "O" to be transparent so that the red will show through. Illustrator lets you create your own compound paths.

How to make a compound path in Illustrator

It's very easy to create a compound path in Illustrator.

  • Create a shape
  • Create another shape
  • Position one shape over the other
  • Select the objects
  • Go to Objects --> Compound Path --> Make

Done.

29Apr/113

Dynamic Contact Form for WordPress

I wanted to write a little bit about some challenges encountered while creating dynamic contact forms using WordPress. There are many wonderful plugins that are suitable for the majority of user's requirements.  However, every now and then, there comes a scenario where a user-friendly plug-in just isn't going to do the trick (or, if there is a suitable plug-in out there, we may not want to spend several hours installing several different ones trying to see if they work for our specific needs).

Today at work I encountered one of those situations that falls outside of the typical contact form protocol and I thought it might be useful to walk through the problem and how we solve it.

Real-Life WordPress Contact Form Scenario

We are developing a website using WordPress as a platform for a client who wants to be able to add and edit their own pages down the road by themselves without calling us for every little edit & update that comes there way. Wonderful, we love building sites out on WordPress. We do this quite a bit, partly because WordPress is quite flexible. It's open source and has a huge community of developers creating plug-ins and widgets for all sorts of purposes and if we ever have a question, we're hardly ever the first WordPress users to encounter it and the answer is nearly always found online after a bit of searching.

Our aforementioned client sent us about 40 pages of content which included a Word Document (.doc) where they created a contact form as best as one can reasonably expect in a Word document. Obviously, instead of text boxes, check boxes, buttons and so on they simply utilized underscores and brackets with descriptions of what they wanted:

For example: [SUBMIT BUTTON]

Usually, when we're working on a WordPress site, we install a plug-in called Contact Form 7. It generally strikes an appropriate balance of simplicity making it easy to quickly create a nice looking form with a nice behind-the-scenes complexity that creates a processing page without us even needing to look at it. It's flexible so that we can easily control the layout/wording of both the form and corresponding email and it's quick. It is almost always good enough for any form that is simply meant to send data as an email instead of being stored in a database.

This client does not need any data stored in a database, just an email that gets sent to their main email address containing the content filled out in the form. The problem is that they want a form that is rather complex and more dynamic than a typical contact form. This is no fault of theirs; they're not web developers and don't know what they're asking.

The client wants visitors to be able to select one option from a series of "status" descriptions and then, for some of the options, they want additional information if it is selected.

For example:

( ) I am a friend / relative of a former client....IF SELECTED....enter client’s name: ______
( ) I would like to become a client...IF SELECTED.... click here to be redirected to appropriate form

This is a bit more of an involved effort because it has a select box with 15-20 options, several of which include follow-up questions if selected. If we had known what they'd be needing, we probably would have accounted for additional time building out the contact form in our estimate. As is sometimes the case, we did not know specifically what they'd want and they did not know that it was beyond the typical realm of contact form creation. So, we have a situation that requires a bit more coding and we want to accomplish it as quickly as possible because we've only allotted a certain amount of time to dedicate towards form development.

This is a bit beyond the scope of our usual handy dandy contact form plugin. So, what we do then is create the form in a php document using Dreamweaver. We then use some software called "Forms To Go" that we upload our form to and it helps us quickly create a corresponding PHP processing page. We then upload the php processing page to the server, copy the HTML form that we created in Dreamweaver and paste it into a WordPress post or page and voilá , we have a great form.

Forms To Go won't be sufficient for this particular form either (although we can still use it to create a processing page), but this form will ALSO require client-side Javascript so that it responds to user choices as they fill out the form instead of only responding when the submit button is clicked and sends that data to a server. We need a dynamic form that, when a specific option is clicked from a selection menu, reveals a related text field requesting further information or redirecting the user to another page/form.

I wrote a similar post on how to create a dynamic menu using Javascript.

2Jan/110

Building A Website for Affiliate Advertising

I've been reading a bit about various ways to make money with advertising. I'm looking into various affiliate programs, trying to decide how to focus my next website/blogging project. My first experiment with Google Adsense is on an informational site running on the WordPress platform called marinecorpsrecruit.com. It's doing fairly well, making around $15-$20/month, but it took a lot of blog posts just to get it to that point and since its my first blog with ads, I'm not sure how well that will last in the longer term. The answer to how often I have to update it to maintain a steady (or better, growing) amount of traffic is yet to be known.

I'm looking for my next idea. I was considering trying my hand at an affiliate program, but there's so much out there and I'm not finding a ton of useful information about which programs are actually good, how people are making money with them, how to promote certain products, etc. I don't mind putting in some time making a website, but I don't want something that's going to take several weeks and then only pay a few cents a week. It should be worth it I hope!

I checked out Commission Junction, which looks OK, but I can't get approved to use their advertisers links until I have a website to put them on. I don't want to spend time building out a site, only to not get approved by the advertisers; it's too much risk. For my Marine recruit site, I applied for a hotel ad and was automatically denied...not sure why.

12Dec/100

How To Use Adsense Selection Targeting

Just thought I'd share a little thing I just learned about: Google Adsense selection targeting. Adsense ads are placed on your site based on matching adsense keywords with keywords found on your pages. Sometimes, you may be writing a few paragraphs that are relevant to the overall purpose of your site, but when you look at the keywords out of context, they aren't usually ones that your target audience would be interested in and would therefore not click. So you want to try to make sure that the ads that are shown on your site are relevant to your audience.

For example, for this blog, it's safe to say that most of my readers would be interested in web design. Since I write about that a lot, Google will often display ads that have web design-related keywords and the content is often very relevant to anyone who might be visiting my page. BUT, maybe I was writing a tutorial on how I developed a website for a car insurance company and as part of that post, I wrote a paragraph describing that company. Google would pick up those keywords like "car insurance", and suddenly that post would have ads trying to entice people to get a free insurance quote, which is not very relevant to my audience and will probably mean that I get less ad clicks.

A way to help make the ads that are showing up on your site relevant to your visitors, you can insert code in your page to target a selection that you do not want Google to consider for adsense keywords.
<!-- google_ad_section_start -->
Here is the content that I do not want Google to use for adsense keyword targeting.
<!-- google_ad_section_end -->

It's super simple and can help you deliver relevant content to your visitors.

8Dec/100

Google Font API

At work we discovered that a few websites had some pretty awesome looking fonts that weren't image based and also weren't installed on our own computers. Up until recently, web pages would only show fonts that are installed on your computer, so web developers always use common and easy to read ones that are installed on almost every computer like Arial, Georgia, etc. If you were seeing a cursive or stylized font, you were usually seeing an image or Flash.

One of the developers at my work noticed that the site was linking to a Google stylesheet, and lo and behold we discovered the Google Font Directory and Google Font API. It looks pretty cool; we'll need to be trying it out soon.

Google Font Directory

Google's font directory is fun to explore. It lets you browse a bunch of the fonts and read a bit about the font designer. It seems super easy too. I'd do an example of it now but I'm not on a computer where I have FTP and a text editor installed, so it's too much work to upload the header file. However, assuming that wasn't the case, all you have to do is choose the font you like and Google will provide two bits of code. One line needs to go in the header section of your HTML file and the other part just needs to be applied just like any other CSS class. Why didn't this exist a long time ago?

23Nov/100

SEO Outline

So I've been working at my "new" job for several months now and have learned quite a bit. Shamefully, I've neglected to record the things I"m interested in and learning on a regular basis. I will make a Thanksgiving reconciliation to try a bit harder to record and share what's up in my web world.

First off, I've been working at a web design firm that specializes in SEO (search engine optimization). SEO is interesting because in some ways, it's really really basic. It means making sure your website is structured in a way that search bots can easily navigate and index your site, making sure that you use various HTML tags to "optimize" your content and checking out your competition to come up with a few strategies for improving your page rank.

That's a really basic explanation and for a long time, that's really all I thought that SEO meant. In reality, success in SEO is a much more strategic affair that involves some rather complex strategies, which is both the most challenging and rewarding and exciting part of SEO. There's a certain morale boost that comes in the form of boosting your site or a client's site a few positions or even a few pages higher in search engine rankings. It's not just a scorecard competition; a single boost in page rank can equal hundreds of additional page hits (and thus sales or ad conversions) a month. It's fun and important basically.

The basics of SEO:

Learn how to research keywords & phrases


  • You need to identify your competition and figure out why they are ranking high in search engines
  • You need to understand how people are searching for the services your site/business provides
  • You need to consider your goals in relations to your strategy. Do you plan on making money through ad clicks or by getting people to fill out an affiliate quote form? Or purchase products from your store? A high visitor rate is great, but pay off only really occurs when you are pulling in targeted visitors who are looking for the service you're offering.

Build your site in a way that search bots can easily navigate and index it


  • Make sure you use correct HTML structure and properly nest your content
  • Create meta information that targets your keywords and phrases
  • Don't forget to use alt and title tags for things like images and links
  • Don't overuse your top keywords. Change them up. Your most important ones should be in your domain name, title tag and h1 tags (but not worded exactly the same). Use long-tail keywords for additional headings tags.
  • Include an .htaccess file that will instruct bots on what files/folders should be indexed or ignored. Try to avoid having duplicate content indexed...like blog archives. Most search engines will recognize duplicate content and consider it as spam or as irrelevant.
  • Keep the most important information early on in your code.
  • Promote your site

    • Online advertising is a whole conversation in and of itself. It can be incredibly beneficial if done right, but it can also be a gigantic waste of money if done wrong. Generally speaking, you want to use ads if your site offers a service that you know people are looking for and usually its a competitive field. Sometimes a client sells a product that is highly highly competitive, like auto insurance for example. They can optimize their site to death, but it still will have a hard time ranking high because there are so many other sites out there doing the same or similar thing that have been around a long time. To make money, they often have to advertise to pull targeted customers into their site.

    That's the general outline of what I've been learning about SEO at Zeus. I know I should probalby write more useful specific posts and I intend to do so. But for today, you can my outline. Enoy.

8Sep/100

Faster Google Search | SEO Longtail Keywords

Wow! Google's new search is so fast! I wonder how this is going to affect SEO strategies. We discovered this new feature while I was at work today and one of the first things we noticed was that people may be less likely to type in longtail keyword searches. At the stroke of a single key, Google is suggesting new keywords directly below the search box and offering up search results in real-time. Are people going to bother typing in their words or will they see a bunch of promising leads before they even get to the keywords?

This may have a rather disproportionate affect on smaller and newer websites, because premium domain names are already taken, so the majority of people building sites are chasing after various longtail keywords now. Time will tell.

21Aug/106

WordPress Upgrade “Cannot Copy” FTP Permission Issue In Layman Terms

Solution: Contact your webhost and ask them to change your ftp server to ProFTPd.

Oh my goodness, WordPress upgrades have been giving me such a headache! As previously posted in "Automatic Update Fail" I was only able to upgrade my accounts either manually or after deleting the "upgrade" folder myself. I had hoped that this would solve future problems, but with the release of WordPress 3.0.1, all my blogs were failing to upgrade (including plugin updates) giving me a variety of changing error messages saying some variation of "cannot copy /public_html/..." and it would give me a path to different files, usually ending in dev.css. After countless hours of messing around with file permissions through Filezilla and/or through the file manager in CPanel, after deactivating my plugins, after manually deleting the upgrade folder and the .maintenance.html file...I was extremely frustrated and nothing was solving the problem.

The repeated "solution" posted on several forums was to simply manually upgrade when things don't automatically upgrade...which works, but I'm a "why" person. It bugs me to not know why something is occurring and it's a pain to have to repeatedly manually upload & upgrade when you have several different WordPress blogs & plugins, as is my case.

The solution has been found and is resolved (knock on wood).  I had read a few forums where people had mentioned a thing or two about ftp user permissions and how sometimes there are permissions problems with your ftp server. I honestly didn't understand it all (and still don't entirely) as I'm not a server person by any means, but my understanding was that it wasn't a permission issue that I was going to be able to manually change through Filezilla or the CPanel file manager  and it had something to do with dhappache user or Nobody User permissions.

On a whim, I decided to check out my web host's forum to see if other folks were have similar issues. I found out they were, but there were no posted solutions besides the usual manual upgrade. Argh. I then checked out their twitter account and they had posted a link to a WordPress forum thread that explained this:

"From what I'm able to tell by looking at the logs during an upgrade or plugin installation, the script attempts to write to an invalid path (usually /public_html/somefile rather than /home/username/public_html/somefile) before using the correct path. It does this for each and every file, so during a major operation like an upgrade where a lot of files are involved it takes a very long time. Eventually the script freaks out and tries to access more memory than is allowed by our suhosin php security module. In most cases it attempts to access 256MB while our default limit is 32M. Suhosin blocks the script and the installation fails."

This made sense to me because I had used an .htaccess file to increase the amount that PHP memory could use and it helped for a plugin I was trying to upgrade, but it didn't solve my overall upgrading problems.

Long story short, I needed to contact my web host to change my ftp server so that instead of using pureFTPd, it uses proFTP. For now, whenever I want to upgrade, I have to send them a ticket (thankfully they respond quickly) and have them change it. When that is done, I do my upgrades and then let them know when I'm done so that they can change it back. Hopefully this will be fixed in the future, but for now, it's nice to know what the problem is and how to go about easy upgrades.