Development [Web] [Graphics] [Web Code]

Web Links to some great Web Development help sites

 

Complete Resource Sites

Echo Echo
Webmonkey
CNET Web Building
The Free Site
Big Nose Bird

HTML Specific Sites

Sizzling HTML Jalfrezi

Java/CGI/DHTML Sites

Dynamic Drive
The CGI Resource
Codephobia
Hot Scripts

Graphics Graphic tutorial and help sites

 

Tutorial Sites

Dhabih Eng
Computer Arts
Think Dan
Team Photoshop
Wasted Youth
Phong

Eyeball Design
Spoono
Steel Dolphin Creative

Visit the links section for some of my favorite graphics sites.

Web Code Some usefull code examples

 
  1. Making a link open in a new optionless window
  2. Auto-opening popup window
  3. Display today's date/time (PHP Required)
  4. Display special characters or code on a page

1. Making a link open in a new optionless window

The following code takes a regular text link, and opens whatever source in a new window of defined size and parameters. Simply place it anywhere within the <body></body> tags where you want your link. You can turn on the different toolbars and display options for the window by changing the values to yes. You can also change the size of the window by entering a different width and height.

<a href="#" onClick="MyWindow=window.open('YOUR LINK URL', 'MyWindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=500, height=300'); return false;">LINK TEXT</a>

2. Auto-opening popup window

Similar to the link window, this code opens a popup window as soon as your page loads. This works great for featuring items on your website or advertising something. To use this code, you must place the first block of code somewhere within your <head></head>. As in #1, you can turn on the different toolbars by changing the 0 values to 1 and setting the height and width. Do not edit anything else.

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0, scrollbars=0, location=0, statusbar=0, menubar=0, resizable=0, width=300, height=370');");
}
// End -->
</script>

Then, you must place the second part within the actual <body> tag as shown below.

<body onLoad="javascript:popUp('YOUR POPUP URL');">

3. Display today's date/time (PHP Required)

To display the day's current date/time you only need to enter 1 simple line of code. However, when you use this line of code you need to do 1 of the following:

  1. Make sure the file the code is in has the extension .php so the browser recognizes it as PHP and executes the line.
  2. Change your .htaccess file so that your server will parse all files that have PHP regardless of the extension (works well if you do not wish to change links throughout your site or want to keep a .html extension and still use PHP). To do this, simply add the following line to your .htaccess file to have your server parse .php, .htm, and .html files. You can add more extensions if you wish, but it is not recommended.

    AddType application/x-httpd-php .php .htm .html

Now to add the date, you simply need to add <?php print date("var1 var2 var3", time()); ?> where the vars are actually letter codes tell the browser how to display your date. Below is a reference table for the codes you would commonly use. Be careful though, as the codes are CASE SENSITIVE.

a - "am" or "pm"
A - "AM" or "PM"
d - day of the month; "01" to "31"
D - day of the week; "Fri"
F - month; "January"
g - hour, 12-hour format; "1" to "12"
G - hour, 24-hour format; "0" to "23"
h - hour, 12-hour format; "01" to "12"
H - hour, 24-hour format; "00" to "23"
i - minutes; "00" to "59"
j - day of the month; "1" to "31"
l - day of the week; "Friday"
m - month; "01" to "12"
M - month, "Jan"
n - month; "1" to "12"
s - seconds; "00" to "59"
t - days in month; "28" to "31"
T - Timezone setting; "EST" or "MDT"
w - day of the week; "0 "to "6"
Y - year; "1999"
y - year; e.g. "99"

For example,

<?php print date("l, F j, Y", time()); ?>

Would display:

4. Display special characters or code on a page

As you probably have noticed by now, I've been showing you the html or script code for whatever directly on this page. You might be asking yourself, how in the world can I get my code to actually display a tag instead of using it. Well, the answer lies within special codes.

HTML has various codes uses to display certain characters, such as the copyright symbol (©) and the double alligator brackets («). When your browser interprets your code, it looks for the tags that define the page. Therefore if it sees something within a set of <>, then it will not display. So, to make the browser display the 2 brackets, you need to use the special code to display each of them. That way, the browser will see that and display it on screen rather then see it as a tag.

Here is a chart of some of the most commonly used special characters:

< > &lt;
&gt;
Bracket   &#151; Em-Dash
« » &laquo;
&raquo;
Double Bracket   ¿ &iquest; Inverted ?
“ ” &#147;
&#148;
Quotes     &nbsp; Non-Breaking Space
& &amp; Ampersand   ° &deg; Degree
© &copy; Copyright   £ &pound; Pound
® &reg; Registered TM   ¥ &yen; Yen
&#153; Trademark   &euro; Euro

If you have any questions or have problems getting these things to work, feel free to email kris@destral.net.