Archive for October, 2005
Want to set something to a random colour in Macromedia Flash? Once upon a time I did, and I found this code which did the trick.
Call changeColor(<target>) to set the color of <target> to a random one
Click here to view the below code as plain text
CODE:
function changeColor(targ)
{
myColor = new Color(targ);
myColor.setRGB(Math.random()*0xffffff);
}
To find the SHA1 hash of a string, first include the library 'digest/sha1' then use the code below, where 'password' is the string we're computing the hash of.
Click here to view the below code as plain text
CODE:
require ‘digest/sha1′
# ... then later on ...
password = "blah"
sha1_pass = Digest::SHA1.hexdigest(password)
This article tells you how to pass variables to an ASP page using the QueryString, and how to access them from that page.
Have you ever seen a URL which looked like "www.example.com/page.asp?mode=1&style=red"? Well, this page is being passed variables and their values through the QueryString, here the variables "mode" and "style" are being passed, with [...]
The full URL to a page comes in three parts: The domain name, the path to the file then the filename, and the QueryString. For example, take the URL http://www.example.com/example/page.asp?name=Bob. The three parts of this are:
1. The domain name: www.example.com2. The path to the page: /example/page.asp3. The QueryString: name=Bob
So how do you find it all [...]
Do you want to know the IP address of a visitor? This can be useful for many reasons, such as tracking site usage or blocking access to specific people. Here's how you can find it.
In an ASP page, within the ASP tags, <% ... %>, you can retrieve the IP address of a user through [...]
Write text on a dynamically generated image using PHP
6 Comments Published 3 years, 1 month ago in Image Handling and PHPThis tutorial will tell you how to write text to a blank dynamically generated PNG image in PHP. This is fairly simple, so it will just be the first step in a series of tutorials dealing with images in PHP. The image functions require the GD library to be installed.
The code we're using and the [...]
Write Text on to an existing PNG image using PHP
9 Comments Published 3 years, 1 month ago in Image Handling and PHPThis article will tell you how to write text on an existing PNG image using PHP using PHP's image manipulation functions. The image functions require the GD library to be installed. This article is fairly basic, however some more detail on the basic functions used is included in the article, "write text on a dynamically [...]
This article shows you how to display a calendar for a given month, mainly using PHP's date() function.
The date() function
The date() function displays the date in your desired format, at a given time. It works by accepting one or two parameters, the first is a string with the format, the letters in the string tell [...]
Search
About
You are currently browsing the DiscoMoose weblog archives for October, 2005.
Longer entries are truncated. Click the headline of an entry to read it in its entirety.Categories
- ASP (3)
- ASP Basics (3)
- Blogs (2)
- C# (1)
- Firefox (1)
- Flash (1)
- Google (6)
- Hacks (3)
- Java (1)
- PHP (12)
- Basics (8)
- Files (1)
- Image Handling (3)
- Puzzles (1)
- Ruby (1)
- Tips (10)
- Web Hosting (3)
- Web Hosting Articles (1)
- Web Hosting News (2)
- Windows (6)
- Wordpress (2)
Latest
- Brainteaser: Which letter comes next?
- Hacking the translation plugin for nicer URLs
- How to Access a Page in Google’s Cache
- How to Control the Mouse Pointer Without a Mouse in Windows XP
- Use Google to define words
- List all processes with the Windows Command Line
- Kill a Process from the Windows Command Line
- Google: Search within a site
- Google Currency Conversion
- Save Embedded Media and Other Files in Firefox
Archives
Categories
- ASP (3)
- ASP Basics (3)
- Basics (8)
- Blogs (2)
- C# (1)
- Files (1)
- Firefox (1)
- Flash (1)
- Google (6)
- Hacks (3)
- Image Handling (3)
- Java (1)
- PHP (12)
- Puzzles (1)
- Ruby (1)
- Tips (10)
- Web Hosting (3)
- Web Hosting Articles (1)
- Web Hosting News (2)
- Windows (6)
- Wordpress (2)
