Archive

Posts Tagged ‘site’

Knowing What to Use (or make) for Your Site

May 26th, 2009 admin 1 comment

So it seems quite often new webmasters are at their wit’s end when the question arises: what features does my site need? Well, this common question can be quickly turned into a daunting test of thought to new and experienced webmasters alike. So how can one even begin to approach this question? Well, why am I asking you? That’s what you’re reading this for ;) .

Alright, so you are creating a new site and are not sure what features you should start packing it with. Well, the most important thing to keep in mind is that the site should always be updated. So if at first you forget some features, don’t rush to get them finished right away; save them for future updates. By keeping sites updated, as I’ve mentioned in previous posts, you keep users coming back to your site. Once you have that out of the way, you can move on to deciding site essentials.

Deciding site essential features is an absolutely necessary step to creating a successful site. Consider your site’s purpose, function, and most importantly, what makes it unique. Whatever makes it unique should be the most important feature you first include. Followed by what it does and its purpose. For example, I have created a blog here. So I would not make this site a giant forum and expect people to simply read my blog posts, but rather I setup the blog and add an RSS feed so people can subscribe and stay updated.

So more or less, when a user is trying to figure out what is necessary, those functions that make your site worth viewing are what you need to include. Then, if you feel you’ve forgotten something, add them in for later additions so people have yet another reason to keep coming back to your site! Remember, with the web changing literally every second, one needs to keep their content and sites updated frequently (hmm maybe I should follow my own advice, eh? :p).

Regards,
Dennis M.

Categories: PHP, Software Reviews Tags: , , , , ,

Importance of RSS Feed and What it Is

April 18th, 2009 admin No comments

Well, first thing’s first. Let’s explain what RSS Feed is. RSS stands for Rich Site Summary. It basically allows a user to keep updated on their favorite sites while not actually having to go to them unless they want to read the whole article or object.

Of course, RSS feed is not available for all sites, but why is the number of sites who are using the feed increasing so rapidly? Well, from an end-user’s point of view, RSS feed is a great tool to keep them (users) interested in a website. Without compromising security (like giving your e-mail out to a mailing list then being hit with spam) or any other true commitment, one can easily get the information they need from a site at the time it is available on the site (they know when this is by checking their feed).

Also, for users who subscribe to the RSS feed, it provides more “traffic security” for the website itself. From the owner’s point of view, it makes it more difficult for a user to simply “forget” your site and never return. When a user looks at their RSS feed and sees an interesting article, they will most likely click it and read the full article; thus returning traffic to your site.

Now that we understand the concept of RSS and its importance, if you enjoy the contents of this site, please subscribe to the Microsonic RSS Feed! :) It is the large orange RSS icon in the top right of the page. Or, if you’re using FireFox, click the RSS icon by the URL and hit “Subscribe to ‘RSS 2.0-all posts’”; your efforts are much appreciated!

This has been the last article in the series listed (oh maybe 5 posts ago?) so I’ll be starting on some new topics very soon! As usual, internet related and jam-packed full of useful information! Be sure to come back and check those out if you’re interested. Or better yet, subscribe to the feed here and just keep checking that and read the articles you find useful! ;)

Regards,
Dennis M.

Categories: Other Tags: , , , , ,

What is CGI and How Can It Be Useful?

April 17th, 2009 admin 2 comments

Well, to be honest, in the present day the CGI wrapper is used much less commonly with all the new web programming languages such as: PHP, Ruby, etc. However, CGI, to put it simply, is a kind of C wrapper for websites. The concept sounds confusing and the truth is, it is just like any other programming language.

Let’s begin discussing the uses of it. The most important use of it today is for hosts that are not PHP (or any other language) enabled. Most hosts allow CGI (even though if programmed wrong can make the system vulnerable) if they don’t allow PHP or some other advanced server-side scripting. Normally, these files need to be placed in the “cgi-bin” to execute. Hosts do this as a sort of precaution, trying to confine the areas of break-ins due to poor programming.

Actually using it is different now. If you’re writing a Perl script, there is no compilation needed, you write like normal. However, if you are a C programmer, such as myself, and wish to use C, compile the source as program.cgi. Now, I’ve dabbled with Perl and can program in it fairly decently, but I’d much rather use C. It’s much easier for me. So, I’ll provide source examples for both styles here!

Now, let’s look at an example script:
The first and most basic script to any sort of programming is “Hello World” so I’ll provide the source for each (and the compiled binaries in the package below for the C-version scripts)

hello_world.pl (This will run properly as is)

#!/usr/bin/perl
# Hello World CGI Script (Perl Version) by Dennis M.
#
# Remember now, comments in Perl must begin with the '#' character

## Our content type ##
print "Content-type: text/html\n\n";

## Now print the page! ##
print "<html>\n
<head><title>Hello World! :D </title></head>\n
<body>\n
<h1>Hello World!</h1>\n
Hello World Script!\n
</body>\n
</html>";

and here is the C source (which, again, needs to be compiled)
hello_world.c

/**
 * Hello World CGI Script (C Version) by Dennis M.
 *
 * I prefer this (although it needs to be compiled) because
 * I'm a C programmer ;)
 *
 * oh yeah, and because we're compiling it with GCC or whatever
 * you use, we can use normal comments ;)
 *
 */

#include <stdio.h>

int main(){
  // Our content type
  printf("Content-Type: text/html;charset=us-ascii\n\n");

  // Our page!
  // We're going to break it up line by line so you can
  // see what's going on here.
  printf("<html>\n");
  printf("<head><title>Hello World! :D </title></head>\n");
  printf("<body>\n");
  printf("<h1>Hello World!</h1>\n");
  printf("Hello world! C style ;) \n");
  printf("</body>\n");
  printf("</html>\n\n");

  // Let's terminate the program now :)
  return 0;
}

Now, we won’t go too deep into the code because simply, they are two completely different languages. But, it’s important to point out that both send headers (Content-type: text/html). You can Google content-type’s and figure what does what, but there are many different types. Another commonly used type is Content-type: text/plain. Notice, if this had been the case, no HTML would have been parsed by the server and everything would have been displayed as plain-text!

So that’s basically it :) CGI is just a wrapper to run Perl and C programming on the web!

Here you can download the sources AND binaries:
CGI Tutorial – Hello World

One more tutorial left in the series! Keep sending in the questions so I have a few more topics to write about! ;)

Regards,
Dennis M.

Categories: C/C++, Other Tags: , , , ,