Archive for the ‘ Web Development ’ Category

In accessing radio button using javascript, it must be searched first on which boxed is checked to get the value.

 
/* Language : Ecma a.k.a. Javascript */
 
function get_radio_value(){
var oRadio=document.form_name.radio_name;
    for (i=0;i<oRadio.length;i++) {
     if (oRadio[i].checked) {
	  radio_value = oRadio[i].value;
     }
    }
}
 

MySQL versions 4.0 used a different timestamps rather than 4.1 and above.

Example:

Version 4.0 and below - 20080331152726
Version 4.1 and above - 2008-03-31 15:27:26

In order to protect files from viewing or downloading by using .htaccess

 
<Files *.ext>
Order allow,deny
Deny from all
</Files>
 

sometimes little things count much. ;)

CSS coding

by admin | February 12, 2008 | In Web Development No Comments

Been very busy coding sites in CSS, my favorite document type is xhtml transitional, i don't do much strict these days because some of sites am working on have flash objects which don't validate well. It's very hard to do code which would render on the 3 major browsers, Firefox, IE and Safari. Like in Firefox you are crap shooting in rounding some property values, in IE some default margin is implemented and in Safari once it encountered a property which it does not supported all the css definitions are ignored.

Example in Safari:

 
/* CSS Code */
.wrap_center{
margin:auto;
display:inline-block;
}
 

The margin would not set in auto since the value of the property display : inline-block; is not supported.

Once in a while a visit Scriptlance.com, I have an account there also if I want to know the trend web master's ask. If I have free time, I bid on interesting projects. Today there's a job post which I got interested, a webmaster before he would hire a coder he needs to pass this task:

1) Using absolute position center #container and set the width to 800px

2) Add a border 15px color #ececec around #container

3) Construct horizontal tabs from the #nav

4) Capitalize the first letter of the first word of each paragraph in #main

5) position the h1 Logo 15px from the top margin 15px from the left margin. Set it's size to 18px. Set the padding to 5px, the back ground color to black and the font color to white.

Here's the link to the original file:orig_test1.html

Here's the solution:

  1.  
  2. /* CSS Code */
  3.  
  4. #container{
  5. /* position:absolute; */
  6. left:0;
  7. right:0;
  8. margin-left: auto;
  9. margin-right: auto;
  10. width:800px;
  11. border:15px #ececec solid;
  12. }
  13.  
  14. #nav{
  15. padding: 3px 0;
  16. margin-left: 0;
  17. margin-bottom: 0;
  18. margin-top: 0.1em;
  19. font: bold 12px Verdana;
  20. border-bottom: 1px solid gray;
  21. }
  22.  
  23. #nav li{
  24. list-style: none;
  25. display: inline;
  26. margin: 0;
  27. }
  28.  
  29. #nav a{
  30. text-decoration: none;
  31. padding: 3px 0.5em;
  32. margin-right: 3px;
  33. border: 1px solid #778;
  34. border-bottom: none;
  35. background: white;
  36. }
  37.  
  38. #nav li a:link, #tablist li a:visited{
  39. color: navy;
  40. }
  41.  
  42. #nav li a:hover{
  43. color: black;
  44. background: lightyellow;
  45. border-color: navy;
  46. }
  47.  
  48. #nav li a.current{
  49. background: lightyellow;
  50. }
  51.  
  52. #main{
  53. text-transform:capitalize;
  54. }
  55.  
  56. #logo{
  57. margin-top:15px;
  58. margin-left:15px;
  59. font-size:18px;
  60. padding:5px;
  61. background-color:black;
  62. color:white;
  63. }
  64.  

I just prepared a coding guidelines for a next project which I have someone who is developing it with me.

Prefix
a - array
b - boolean
d - date
n - number
o - object
rs - recordset / db objects
s - string
xml - xml
m - variant / mixed
cls - class declaration

Variables must be declared with a prefix and succeded by a capital letter.

Example:

 
/* Language : php */
$nMyNumber=1234;
$sName='Carey Dayrit';
$dToday=now();
$oFile=new clsFileUpload();
 
class clsPaging{
...
}
 

also would use phpDocumentors syntax

On my regular job, I have a task that would require accessing an MS Access database on IIS server.

Here's some simple list that I've do.

1. Make sure ODBC is supported on your install of php.
2. Make a data source name on Control Panel -> Administrative Tools -> Data Sources (ODBC) click the System DNS tab.
3. Point to the .mdb file location
4. Use php ODBC functions

Here are some equivalent functions if you have an existing code in php that uses mysql, you just rename some mysql functions to odbc.


mysql_connect / mysql_pconnect = odbc_connect / odbc_pconnect
mysql_query = odbc_execute
mysql_fetch_array = odbc_fetch_array
mysq_free_result = odbc_free_result

Be sure to check the php manual for proper arguments.

Netscape has been my first browser when I first experienced the web, it was a beautiful experience. Until I start developing HTML sites back then Internet Explorer has a good support for lazy HTML coders. Then suddenly Netscape sucks. :) So I switch to Internet Explorer as it is freely comes with every windows installation and back then the rendering of HTML was faster than Netscape. After a wink of an eye Internet Explorer rules the market then came bugs and security issues specially if you use the Internet on e-commerce. You'll see people complaining their credit card or e-wallet accounts get hacked in every part of the online forums when do made purchases online.

Then came Mozilla a w3c compliant browser, then a much more strip down version called Firefox. Until now I use it as a browser. I heard that AOL wants to revived Netscape back again to it's glory days. I was happy with Firefox so I did'nt bother.

Then came the news last December 28, 2007, on every tech email that I've been subscribe to pointing to the Netscape Blog, it is official that Netscape will end it's support on Feb 2008. Even though I didnt use it anymore I was sadden about the news, I dont know maybe first love never dies, hahaha.

I think a wrong marketing approach has been used by AOL that contributes to the death of Netscape.

It's been an ease using Windows XP as my development machine having the best of both worlds. I have the three major browsers on my personal computer. All of them is unique and each has a very special purpose in my web development career.

Let's start with Firefox, this I used for debugging javascript code, specially with these add ons FoxyProxy, Firebug and Web Developer. I used it as starting test on created pages.

Internet Explorer 7, IE has been the leading in terms of users. It would not be complete if I would not test it on these browser as many are using it. I just do a special stylesheet just for it. Kinda buggy CSS feature.

I am glad that there is Safari for windows under Beta Stage kinda more stable rather than the alfa release. If your client's target market is the US you need to test the page on Safari. Theres an upswing for the MAC users these days.

  Article printed from SiteProNews: http://www.sitepronews.com

  HTML version available at: http://www.sitepronews.com/archives.html



10 Steps To Top 10 Rankings In Google
By Titus Hoskins (c) 2007

Most webmasters go totally "gaga" for top 10 rankings in Google.
And for good reason, Google is the most dominant search engine
on the net and will deliver the largest amount of traffic.

More importantly, those same webmasters will also inform you,
getting top 10 rankings in Google often means your site will
prove profitable. Mainly because obtaining targeted traffic is
usually your first obstacle in creating a viable online
business. In other words, if you get top ten listings in Google
for good searchable keywords, it is almost impossible not to
earn money.

How To Proceed?

First, you must know the rudimentary basics of how keywords work.
Keywords and keyword phrases are the exact words someone types
into a search engine to find what they're looking for online. If
you have a site on "dog training" then your goal is to get a top
10 ranking for the keywords "dog training".

Now if no one searches for "dog training" it would be a useless
keyword, you would get no traffic no matter how perfectly your
site is optimized for that keyword.

How Do You Know If A Keyword Is Good?

To find out, you have to do some keyword research on your
particular keywords. Many professional online marketers use
keyword research software like Brad Callen's Keyword Elite.
However, you can also use the keyword suggestion tools supplied
by Google Adwords or Overture. Try here:

http://www.digitalpoint.com/tools/suggestion/

Now if you check "dog training", you will find it receives around
4,469 searches each day. That's a lot of traffic but you must
realize that it may be too good, or rather too competitive for
your purposes, especially if you have a new site.

Biggest Mistake When Choosing Keywords.

The most common mistake most novice webmasters make is targeting
keywords which are too competitive. You simply will not be able
to compete or place for extremely competitive keywords. Well
established sites and businesses with very deep pockets have the
resources to completely dominate those keywords.

While it is not entirely futile nor a waste of time to
concentrate your efforts on highly competitive keywords, you
will have better success if you target low to medium competitive
keywords.

Long Tail Keyword Marketing

Besides online marketers have discovered that longer keyword
phrases are usually the most lucrative. These phrases deliver
traffic which is better targeted and more likely to convert into
a sale. "Dog hunting training" which gets around 100 searches a
day will be more targeted than the general term "dog training"
and if you have a site devoted to training hunting dogs then
this keyword phrase may convert better for you.

Always keep this "Long Tail" keyword strategy in the back of
your mind as you implement the following steps to achieve your
own Top 10 Rankings in Google.

1. Make A Master Keyword List

Your first step is to make a master list of the keywords you
wish to target. Obviously these should be closely related to the
theme of your site. Check the keyword competition by seeing how
many sites are listed in Google for that keyword. Webmasters
should also check the Google PageRank of the sites that hold the
top 10 positions. If all those sites are PR6 and above it may be
hard to get ranked high for your keywords.

2. Choose Related Keywords

Once you have your master list of keywords, find long tail
related keywords to target. Again, check out the competition
and daily searches made for each chosen keyword.

3. Use Quality Content For Your Keywords

Creating quality content should always be your main goal. Write
for actual visitors who will see and read your content. First
and foremost you must have good useful content that your visitors
will use themselves and recommend to their friends or colleagues.
Tie this quality content in with your chosen keywords. Use one
keyword phrase per page.

4. Keyword In Domain Name, Title and URLs

Having your keyword in your domain name will score big points
from search engines. Plus, each page of content should contain
your keywords in the title & meta tags for that page. Most
experts also suggest you have your keyword in the URL and use
hyphens to separate your keywords. Although the author has
gotten good results by using an underscore and htm in URLs.

Example: www.yoursite.com/your_keyword.htm

5. Do On Page Optimization

Keyword ratio is a much discussed topic by SEO experts and many
suggest you should have your keyword in the H1 or headline title
of your page. Sprinkle your keyword and variations of it
throughout your page. Don't over do it but make sure the
robot/spiders will clearly discover what your page is about.
Many webmasters make sure they include their main keyword in the
first and last 25 words on their pages.

6. Use Traffic Modules

One technique that works extremely well in Google is clustering
a closely related topic or subject into a distinct separate
section on your site. For example, if you have a marketing site,
you could create a whole section on article marketing where you
would have 50 to 100 keyworded pages all relating to your
subject. Writing articles, formatting articles, submitting
articles, article software... place a keyword linked menu on
each page to connect all your pages together.

Keep in mind, your main objective is to supply quality
information to your visitors. One reason Google may favor this
type of structure is because they want quality content returned
in their SERPs.

7. Try Article Marketing

Article marketing is writing short informative articles on
keyword topics related to your sites. You then submit these
helpful keyworded articles to ezine directories on the web. When
your articles are picked up by related sites, you receive
quality One-Way links. The higher the quality of your article,
the more links you will receive.

Another ranking tactic to use: If you're just starting out your
site will probably have a low PR rank and you will find it hard
to rank for even modest keywords. That's why it's useful to take
advantage of the higher PageRank of the major ezine directories.
Your keyworded articles on these high PR sites will get picked
up by Google and displayed in the top 10 rankings. Now the
displayed URL will be the article directory site but the links
in the resource box will be pointing back to your site. Over
time this article marketing technique will raise your own site's
rankings for those keywords. Simple but effective.

8. Anchor Text And One Way Links

Off page optimization is important in obtaining high rankings in
Google. Getting quality One-Way links is very important. Anchor
Text simply refers to "the underlined clicked on words" in your
links. Most webmasters include their keywords in their anchor
text as this tells the search engines exactly what the links are
about.

9. Tags, Blogging And Web 2.0

Take advantage of Web 2.0 by using blogs, RSS feeds and the
social bookmarking sites like Reddit and Digg. Try AddThis.com
for a simple social bookmarking system. At the very least your
site should have a blog and RSS feed attached to it as this is
an effective way of boosting your keyword rankings.

Tags have become very important for getting higher rankings.
Keep in mind, in free blogging software such as WordPress,
categories will automatically be seen as tags. Blogger, which
is owned by Google, now has a form where you put your keywords
(tags) for each post you make.

10. PPC vs Organic Search

Of course, one of the fastest ways to get your links displayed
on Google is to pay for them by using Google Adwords. Your ad
and links will sit side by side with the organic link results.
In Pay Per Click advertising you bid or pay so much per click
for your keywords and you only pay when someone clicks your
links. But smart marketers also know since you're getting
millions of impressions advertising your products, acquiring
name recognition and branding through PPC advertising can be a
major side-benefit.

However, most webmasters would say that organic links (SERPS)
will return better traffic than paid links or advertising. In
most cases, this may be true because Google's organic rankings
are becoming more respected and more trusted by users. They
simply carry more weight with surfers.

This makes it even more beneficial to obtain top 10 rankings for
your keywords in Google. Depending on the competitiveness of
your chosen keywords reaching the first page listing or even the
favored number one spot is well within any webmaster's reach.
Just go for it. The rewards are well worth your efforts.
================================================================
The author is a full-time online marketer who contributes his
high rankings in Google as the major source of his online income.
For the latest web marketing tools try:
http://www.marketingtoolguide.com For the latest Internet
Marketing Strategies go here: http://www.bizwaremagic.com
Titus Hoskins. This article may be freely distributed if this
resource box stays attached.
================================================================



Copyright © 2007 Jayde Online, Inc.  All Rights Reserved.

SiteProNews is a registered service mark of Jayde Online, Inc.

Finally since I started making websites Homesite is my HTML editor of choice. It's been my first editor and for the last 5 years of web development. The shift to Dreamweaver came when I decided to learn action scripting on flash objects which Dreamweaver supports it.

Dreamweaver has improved it's UI since Dreamweaver MX which I notice a good environment for hand coders. I think Dreamweaver superceded Homesite on features and extensive support for other web related documents.

One thing that Dreamweaver doesnt have is the code sweeper in Homesite, which I use to organize HTML code. I just use a light weight editor which is PSPad for HTML/XHTML and PHPBeautifier to orgranize my php code.

Well the color coding of Dreamweaver is different from Homesite but I do customize it to look like Homesite.

dreamweaver

Before you pull your hair here is a simple solution in combining flash and DHTML.

Problem Scenario: flash object is blocking the display of a javascript menu.

Solution: add the wmode="transparent"

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=
"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="690" height="250">
<param name="movie" value="images/slide.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="images/slide.swf" width="690" height="250" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent">
</embed>
</object>

good luck