You can do this by using the site: command in your search, for example:
Technorati Tags: google, search, tips, howto
To terminate a process from the command line of windows, use the taskkill command:
When you know the name of the image to stop:
taskkill /IM notepad.exe
Or when you know the process ID, eg 784:
taskkill /PID 784
For more usage variants, type taskkill /?
NB: some of this information about what processes are running can be obtained by the tasklist command.
To view all the currently running processes in windows from the command line, you can use the command 'tasklist'. The output will look something like this:
F:\>tasklist
Image Name PID Session Name Session# Mem Usage ===================== ====== ================ ======== ============ System Idle Process 0 Console 0 16 K System 4 Console 0 52 K smss.exe 592 Console 0 108 K csrss.exe 648 Console 0 5,868 K winlogon.exe 680 Console 0 2,632 K services.exe 724 Console 0 2,376 K (...)
For example:
http://del.icio.us/tag/system:media:audio+indie
http://del.icio.us/tag/system:media:image+nasa
Slyck, a file-sharing news site, published an article discussing eXeem, noting that its website - www.exeem.com - is currently offline. In it they interview SuprNova's Sloncek (who had been doing public relations work for them around the time when he took SuprNova offline). Sloncek revealed that the company behind it have produced version 1.0 but they have also moved on to other projects.
It's not too bad a thing anyway - eXeem was never anything special, even when you ignore the not-too-bad-adware. It still amazes me that a file-sharing application was created with any built in adware, Cydoor none the less, when users still had bad tastes left from KaZaA and the like.
About.com has plublished a top ten of websites where you can get royalty free images for use on your blog (or other personal website). The top one of which is Stock.XCHNG. Followed in second place by Flickr, which allows you to browse other people's photos which are licensed under creative commons licenses (which give you permission to re-use the images in certain conditions, such as not-for-profit use).
Source: Top 10 Places to Find Free Images For Your Blogs [About.com]
Simple guide to creating a torrent using MakeTorrent and the JMStacey.net tracker.
Update: since this article was written, the JMStacey tracker has gone offline, however the majority of content in the article still applies, just the tracker won't work.
Tools used:
MakeTorrent v2.0 RC1
BitTornado-0.1.4
Public Tracker at http://www.jmstacey.net/tracker/
Step 1:
Download and install the tools listed above and sign up (create an account to upload torrents if it lets you) at any public tracker (for a list see http://trackers.thebeehive.me.uk/).
Find the item you wish to distribute and, if you can, make a copy of it - this preserves your version incase something goes wrong later on.
Step 2:
Start MakeTorrent, it should have placed a shortcut to it in the Programs section of your start menu.
a) I like to use "Classic" mode, so switch to that
b) Click on the "(dir)" button, then browse to the directory which you are wanting to distribute. If you want to torrent a single file then click the (file) button instead and select that file. When you have browsed to the directory or file you want to torrent, press the ok button and it will fill in the path in the "Filename or Pathname" box in MakeTorrent.
Step 2 is shown here:
Step 3:
a) Double check the directory displayed in the box is the right one.
b) Now you need to find the announce URL for the tracker which you are using, this usually ends in "/annouce" or "/annouce.php" A good place to look for this is the Upload page of the tracker's website. On the tracker I am using in this example, the announce URL is displayed at the top of the Upload page, and is:
http://www.jmstacey.net/tracker/announce.php
c) When you find this URL, copy it to the clipboard and paste it in the box marked "Tracker:" in MakeTorrent
You can leave the other settings as they are until you learn more about bittorrent and want to do more with it.
Step 3 is shown below:
Step 4:
a) Make sure that the files in the folder are not being used (eg you're not playing one of the mp3s in winamp), it doesn't like that.
b) Click the "Create .torrent" button at the bottom right of the MakeTorrent window.
c) It will then prompt you for a directory to save the .torrent file in, choose somewhere you'll remember and press "Save."
d) It opens a popup with two progress bars, the top one is the progress of the file it is currently working on, the one below it is the overall progress. When the overall progress bar reaches the end, it will allow you to click "Finish" so do so.
e) You have now made your .torrent file! Close MakeTorrent.
Step 4 is shown below:
Step 5:
a) Now you have made the .torrent file, but it's no use just being on your computer, you need to upload it to the tracker you're using. To do this, go to the Upload page on the tracker's website.
b) There should be a box for the torrent file you are uploading, click on the browse button next to the box and browse to the .torrent file you have created, select it and click "Open" in the popup box. It should then put the path to that file in the text box.
c) Fill in any other fields the tracker asks for on the upload form, for example the tracker I am using asks for name, description and type. I filled each in with fairly informative information about the album I am torrenting and chose the correct type (music).
d) Click on the submit button to upload the file to the tracker. In this example the button is labeled "Do It!"
Step 5 is shown here:
Step 6:
a) Now that you've uploaded your .torrent file to the tracker (errors will hopefully be self explanatory and rare) you have to start seeding it. Open your bittorrent client - this example uses BitTornado, you can open this by finding the folder it created in the start menu on installing it. BitTornado opens a box asking you to select a .torrent file, if your client doesn't do this you can either browse to the file in Windows Explorer, then right click on it and choose "Open With" -> (choose your torrent program) or look for a button on your client to add the torrent.
If the dialogue box was displayed browse to your torrent and press "Open"
b) Now BitTornado asks where you want to save the files to. As we already have the files we must browse to that folder - make sure that you select the same folder as you used to make the torrent! When you've selected that folder in the browser, click "Ok."
BitTornado then inspects all the files in the torrent, decides that you have the full versions of all of them and displays a download window, but showing the download as complete. There's a button showing "finish" but don't click this until you're sure that other people have the whole file and are seeding it.
Step 7:
You're now seeding your torrent file. An optional mode on BitTornado and some other clients is the "SUPER-SEED" mode. This can help to distribute files more evenly amongst the people downloading from you, which can help to distribute the file quicker. You should only use this if you are the only seeder, you can switch this on by selecting "SUPER-SEED" from the "Settings for" list box near the bottom left of the download window.
Thanks for following this guide through.
Disclaimer: This article is for informational purposes only and no files were actually distributed to other people creating it. Sharing files that you don't own the rights to is illegal.
Guide to selecting specific files to download in Azureus.
Tools used: Azureus 2.1.0.2
Ever find a torrent with a lot of files when you only wanted a few of them. Azureus offers a way to only download the ones you want, and this guide is to tell you how to do so. Note that this doesn't work when the all files are compressed into a single .rar or .zip file
Step 1: Install Azureus if you haven't done so, and load your torrent into it as normal, selecting where you want to save it. When it's done allocating then start the torrent
Step 2: In the "My Torrents" tab, double click on the name of the torrent so that it opens a new tab with the details of that torrent. Alternatively you can right click on it and select "Show details," as shown below:

Step 3: In the torrent details tab, choose the "File" section by clicking on it as shown below:

Step 4: Now you are shown a view of each file in the torrent and what bits of each file have been downloaded. If you don't get this view then make sure that the torrent is downloading and not queued or stopped. Then select the files that you don't want to download, you can hold down the control and/or shift keys to select more than one.
Step 5: When you've selected them all, right click on one of the ones you've selected and in the right click menu select Set Priority then Do not download. This is shown below:

Step 6: Then just leave it to download, note that if it had already started downloading bits of those files then it will continue to, so you might end up getting some of them anyway. When it has finished, it will still appear in the downloading (top) part of the "My Torrents" tab, but it will not be downloading anything. You should go back to the files view to make sure that all the files you wanted have been downloaded correctly then seed until you've uploaded enough before removing the torrent.
Step 7: It still created the files on your hard-disk, and telling it not to download them does not delete them, so you'll have to go and do that now - make sure you delete the right ones :)
Thanks for following this guide through.
Disclaimer: This article is for informational purposes only and no files were shared while creating it. Sharing files that you don't own the rights to is illegal.
Guide to creating a torrent using MakeTorrent v2.1 and PunkHC Tracker.
Tools used:
MakeTorrent v2.1
BitTornado-0.3.3
PunkHC tracker at http://punkhc.dyndns.org
Note: This guide is essentially the same as the create a torrent using MakeTorrent and the JMStacey.net tracker, except this features updated versions of the software involved and the tracker interface is slightly different.
Step 1:
Download and install the tools listed above and sign up (create an account to upload torrents) at the PunkHC tracker.
Find the item you wish to distribute and, if you can, make a copy of it - this preserves your version incase something goes wrong later on.
Step 2:
Start MakeTorrent, it should have placed a shortcut to it in the Programs section of your start menu.
a) I like to use "Classic" mode, so switch to that
b) Click on the "(dir)" button, then browse to the directory which you are wanting to distribute. If you want to torrent a single file then click the (file) button instead and select that file. When you have browsed to the directory or file you want to torrent, press the ok button and it will fill in the path in the "Filename or Pathname" box in MakeTorrent.
Step 2 is shown here:
Step 3:
a) Double check the directory displayed in the box is the right one.
b) Now you have to find the announce URL of the tracker, this is displayed at the top of the "Upload" page, and unless it has changed is it:
http://punkhc.dyndns.org/announce.php
c) When you find this URL, copy it to the clipboard and paste it in the box marked "Tracker:" in MakeTorrent
You can leave the other settings as they are until you learn more about bittorrent and want to do more with it.
Step 3 is shown below:
Step 4:
a) Make sure that the files in the folder are not being used (eg you're not playing one of the mp3s in winamp), it doesn't like that.
b) Click the "Create .torrent now!" button near the bottom right of the MakeTorrent window.
c) It will then prompt you for a directory to save the .torrent file in, choose somewhere you'll remember and press "Save."
d) It opens a popup with two progress bars, the top one is the progress of the file it is currently working on, the one below it is the overall progress. When the overall progress bar reaches the end, it will allow you to click "Finish" so do so.
e) You have now made your .torrent file! Close MakeTorrent.
Step 4 is shown below:
Step 5:
a) Now you have made the .torrent file, but it's no use just being on your computer, you need to upload it to the tracker you're using. To do this, go to the Upload page on the tracker's website. on the PunkHC Tracker, this is: http://punkhc.dyndns.org/upload.php
b) The "Torrent file" box is to select the torrent file you are uploading, click on the browse button next to the box and browse to the .torrent file you have created, select it and click "Open" in the popup box. It should then put the path to that file in the text box.
c) Fill in the "Torrent name" field with an informative name and the "Description" field with - for example - a track listing, information about the artist, quality of the rip, etc. Then select the correct type for the torrent.
d) Click on the "Do it!" button to upload the torrent file to the tracker.
Step 5 is shown here:
Step 6:
a) Now that you've uploaded your .torrent file to the tracker (errors will hopefully be self explanatory and rare) you have to start seeding it. Open your bittorrent client - this example uses BitTornado, you can open this by finding the folder it created in the start menu on installing it. BitTornado opens a box asking you to select a .torrent file, if your client doesn't do this you can either browse to the file in Windows Explorer, then right click on it and choose "Open With" -> (choose your torrent program) or look for a button on your client to add the torrent.
If the dialogue box was displayed browse to your torrent and press "Open"
b) Now BitTornado asks where you want to save the files to. As we already have the files we must browse to that folder - make sure that you select the same folder as you used to make the torrent! When you've selected that folder in the browser, click "Ok."
BitTornado then inspects all the files in the torrent, decides that you have the full versions of all of them and displays a download window, but showing the download as complete. There's a button showing "finish" but don't click this until you're sure that other people have the whole file and are seeding it.
Step 7:
You're now seeding your torrent file. An optional mode on BitTornado and some other clients is the "SUPER-SEED" mode. This can help to distribute files more evenly amongst the people downloading from you, which can help to distribute the file quicker. You should only use this if you are the only seeder, you can switch this on by selecting "SUPER-SEED" from the "Settings for" list box near the bottom left of the download window.
Now that you have created a .torrent you're gonna want to tell people about it, right? Well due to the nature of the PunkHC tracker, you must link people to the tracker site so they can register before they are able to download from the torrent. This means it is not suitable for sites such as suprnova. However this is possible on forum style sites, such as punktorrents.com.
To submit your torrent on punktorrents.com:
A) Go to punktorrents.com in your browser and login or signup if you have yet to do so. Navigate to the correct forum, this will either be Punk, Ska, Hardcore, Local Bands or Videos within the Downloads category.
B) When you are in the correct forum, press the "New Topic" button:
C) Fill in the fields it presents to you:
Topic Title: Should be the name of the album you're posting with maybe the year or quality/format, keep it short and descriptive.
Topic Description: Any additional information or comments you have can go here.
Enter Your Post: This is the main post text, here it is always appreciated if you put some information about what your torrent. You should explain how the tracker works to people viewing your post, as I have done below:
For example:
Bouncing Souls - Anchors Aweigh
Tracklist:
01 - Apartment 5F
02 - Anchors Aweigh
(...)
Quality: 192kpbs mp3
This torrent is on the PunkHC tracker, which requires you to sign up before you can download to help prevent leeching. If you haven't signed up, go to http://punkhc.dyndns.org to do so then download the torrent from the tracker.
Link to torrent on tracker: [url=http://punkhc.dyndns.org/details.php?id=197&hit=1]http://punkhc.dyndns.org/details.php?id=197&hit=1[/url]
I also like to ask people to say thanks for downloading and request they don't leech. Also if you are distributing a group release which came with a .nfo file, you could simply paste that in this box, although enclose it in [ code]..[/code] brackets to keep the formatting.
That's all the fields that have to be filled out, although you can choose a post icon if you want.
D) There is a box to attach a file to your post, however do not attach the .torrent file as the PunkHC tracker requires that people download it from their site.
E) Check what you've entered above, and click on "Post New Topic" at the bottom.
That's it! You can keep an eye on your thread for problems and people requiring reseeds, etc. Thanks for contributing!
Thanks for following this guide through.
Disclaimer: This article is for informational purposes only and no files were actually distributed to other people creating it. Sharing files that you don't own the rights to is illegal.








Thanks to Llyenn from punktorrents.com for writing this guide!
Firstly, to create a Java program you need to install a few things:
1. Assuming that you have installed that correctly (if you have any problems then please ask for help in our forum), start notepad or your desired text editor and enter the following code:
public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
It's not terribly important that you understand what the code does just now, as the main emphasis of this lesson is on compiling and running your code, what the code does will be explained in a future lesson.
2. Save that file as HelloWorld.java (the filename is important) and start the command prompt (usually done by selecting start->run, entering "cmd" then pressing ok).
3. At the command prompt, browse to the directory where you saved your program using the command cd "directory name" to change directories (to change drives, type the letter of the drive followed by a colon, for example E: to change to the E: drive).
4. When you've made it to the folder, type:
javac HelloWorld.java
to compile your code. If you recieve an error message similar to "'javac' is not recognized as an internal or external command, operable program or batch file." then ensure that you have followed instruction number 5 in the JDK install instructions.
If your program compiles successfully then you won't recieve any output but you will notice that a new file has appeared in the same directory as HelloWorld.java - this one being called HelloWorld.class which is your compiled program.
5. Now you are ready to run the program! At the command prompt again, type:
java HelloWorld
(note that this time you type java, without the c, and no file extension). You should notice the output "Hello World!" in the cmd window.
Phew, that's the first lesson over - in this lesson you've seen how to create, compile and run a program in Java using just notepad and a command prompt (there are less tedious ways to do it as we shall see, but it is helpful to know that it is possible this way).
This lesson is demonstrated in a flash video: Lesson 1 (370KB)
One of the most useful features of Firefox is it's "Quick Searches." You might not know about them, so say you wanted to search Google, instead of typing in www.google.com in the adress bar then typing in your search string, eg pie, you can simply type "google pie" in the address bar and Firefox will skip straight to the results. Sure there's that custom search box at the top right, but I can never be bothered moving my mouse all the way over there and clicking the icon to change it.
There are more quick searches already defined in Firefox, for example dict searches dictionary.com (you can see them all by looking in Bookmarks->Quick Searches). This guide will tell you how to add one for an alternative dictionary site, UrbanDictionary.com.
This way goes through the whole process, so you know how to create quick searches for other sites, there are shortcuts you can make which become apparent once you realise how it works.Step 1
First, go to www.UrbanDictionary.com in Firefox. There's a search box at the top right, so type monkey in that and hit Search. The page changes to the search results for monkey, it's defined as "One of the three primary ingredients of a good game," but that's not important. What you're now interested in is the address bar, which now shows the url http://www.urbandictionary.com/define.php?term=monkey&r=f.
Step 2
What you now want to do is, in the menu bar at the top of the screen, choose Bookmarks->Bookmark This Page. Shorten the name to UrbanDictionary and select to save it in the Quick Searches directory (if this is not showing you may have to press the down arrow next to the "Create In" list of folders).
Step 3
In the menu bar, go toBookmarks->Quick Searches->UrbanDictionary, right click on it then choose "Properties." The properties of the bookmark open in a small window, look at the URL in the Location field: it should say http://www.urbandictionary.com/define.php?term=monkey&r=f. To create the Quick Search, we need to change this to a general search, so edit the URL to say http://www.urbandictionary.com/define.php?term=%s&r=f. What we've done is changed monkey for %s. In the "Keyword" field, enter the term you want to use to activate the search, for example I'm using udict, then enter a description if you wish. The bookmark's properties should now look something like this:
Hit the Ok button.
Step 4
That's it, now you can test it by typing udict pie in the address bar. The UrbanDictionary definition for pie should then load. If that doesn't happen then try checking you've gone through everything correctly.
Update
Since this article was written, the UrbanDictionary quick search has been included with Firefox, with the usage slang [word]. Also, an earlier version of this article was linked from the UrbanDictionary "in the press" page, which was kinda neat. :) This article is being left on the site as it still provides the theory behind adding a Quick Search and so may still prove useful to someone.
.rar files are archives, like zip files. You can open them using a program called WinRAR, available in the downloads section of rarlab.com. For Mac/Linux users, there's a command line tool also available from that site. You can then install WinRAR and decompress the archive to get the files inside. OS X Users OS X users can also try the application UnRarX to extract rar files. (Thanks to Scubs for mentioning this!)
This guide tells you how to rip a CD to Ogg Vorbis Format using the dBpowerAMP Music Converter.
Step 1. 
Clicking that takes you to a page with three Ogg codecs. You probably want the Standard codec, which is the top one so click on its download link:

When you've downloaded that, install it and proceed to the next step.
Step 2.
Now that you've installed dBpowerAMP, you need to put your CD in the drive and start the CD Converter. You can launch it from the Start Menu by selecting "dMC Audio CD Input" from the "dBpowerAMP Music Converter" folder.
(A) When you start it, it should display a list of the tracks on the CD, if it does not fill in the titles automatically then you can press the "freedb" button on the toolbar and it will try to retrieve the CD's information from the internet.
(B) Next, click on the options button to configure some settings.

Step 3.
In the options, click on the "set" button in the second row down (called "File Creation"):

This will pop up a new window which allows you to set how you want the files to be ripped as. The default is [artist] - [track], so if that's what you want then leave it at that, but I like track numbers so I changed it (in the text box at the top) to [track number xx] - [artist] - [track]. This means that it will rip to files with names:
01 - ArtistName - Track1.ogg
02 - ArtistName - Track2.ogg
And so on. You can play around with it to have it make folders and use the album name too as the examples in the window show.

When you have the name you want, press the Ok buttons to exit that window and the options one.
Step 4.
(A) If you like you can change the track names by selecting them and pressing the F2 button.
(B) When you're ready, right click on the "rip" button. This opens up a dialog to change settings for this rip:

Step 5.
In the settings, click on the drop down list at the top, next to "Convert files to" and choose "Ogg Vorbis":

NB. Changing the settings here is only for the current rip, if you want to keep them more permanently then you can change them in the options window we used in Step 3.
(A) By default, it saves ripped tracks to the folder called C:\Converted Music, so if you want to change this then click on the browse button to the right of the folder name and browse to a new directory.
(B) Now you're ready to rip the CD! Review the settings and press the "Convert>>" button in the bottom right to start it ripping.

Step 6.
dBpowerAMP will now rip the CD, you should see a window similar to the one below:

When it is done, it will either wait for you to press the "Finished" button or just return to the CD track list screen, which means it's done and you can access the Ogg files in the folder you set it to save to in step 5.
Conclusion
Thanks for following this guide through, hopefully you will have found it helpful!

network.http.pipelining

network.http.pipelining.maxrequestsin the filter box and find that setting in the list below. When you find it, right click on the setting and choose "Modify."



nglayout.initialpaint.delayAnd press ok.


Is there a long and tedious form which you don't want to fill out, or do you not want to give them your email address? Here's a few tips for those situations.
BugMeNot
The website www.bugmenot.com allows users to submit and retrieve logins for various websites which require you to sign up. If you go there and type in the address of a website, then BugMeNot will tell you if somone has submitted a working login and password for that site which you can then use, avoiding registration completely. To supplement the web site, there is a Firefox extension to open BugMeNot in a popup window and check the site you're browsing.
If BugMeNot doesn't have a working password for the site, there are some ways you can protect your privacy when registering.
Mailinator
Mailinator gives you a disposable email address for sites which ask for your email so they can activate your account but you don't want to give them your real one, perhaps because you don't want their spam. When you go to the Mailinator site, they generate a random email address for you, eg edwdcxsactlonx@mailinator.com. You can then enter this email into signup pages. When they send you the confirmation email you can login to that mailbox through the Mailinator site to check for activation codes then forget about that email address forever.
Some alternatives to Mailinator are: http://pookmail.com/ and http://www.spamgourmet.com/.
Gmail
Google's free email service, Gmail offers a neat trick which can help you to filter and block spam, when asked to enter your email address to sign up for a site, enter username+sitename@gmail.com where username is your gmail address and sitename is something to recognise the site by. For example if your email address was jim123@gmail.com and you were registering on this site, you could use jim123+vdhri@gmail.com. Then if we sell your address to companies which procceed spam you (we would't though, we're nice!) then you can easily filter the spam as well as identify the source. Note that this trick doesn't always work, as many sites which validate email addresses won't allow you to put a + in your address.
-inurl:htm -inurl:html intitle:"index of" +("/ebooks"|"/books") +(chm|pdf|zip)Which performs this Google search.-inurl:htm -inurl:html intitle:"index of" +("/ebooks"|"/books") +(chm|pdf|zip) linuxWill do this Google search and find you Linux eBooks!-inurl:htm -inurl:html intitle:"index of" mp3This searches Google for mp3s in directory listings, as above.
-inurl:htm -inurl:html intitle:"index of" ogg "daft punk"Which performs this Google search.
To transfer java games from your computer to your phone without the use of a USB cable can be achieved by uploading the game files on to your webspace and using your phone's WAP capabilities to download them from there. Here's a rough guide describing how to do that.
1) Get MyGame.jar (for example) file
2) Use JADMaker to create a MyGame.jad file if you dont have one (some phones need this)
3) Add MIME types in the directory:
Create a .htaccess file containing these four lines:
AddType application/java-archive jar
AddType text/vnd.sun.j2me.app-descriptor jad
AddType text/vnd.wap.wml wml
AddType text/vnd.wap.wmlscript wmls
(the wml and wmls types aren't really relevant here though).
4) Upload .htaccess, MyGame.jar and MyGame.jad to a directory of your webserver.
Then you can go to that url using your phone's WAP capability and download the game :)
If you are getting "Item Not Supported" errors then make sure you've done step 3 properly (I was getting them on my sony-ericsson T630 before I did that)
Call changeColor(<target>) to set the color of <target> to a random one
function changeColor(targ)
{
myColor = new Color(targ);
myColor.setRGB(Math.random()*0xffffff);
}
This article contains a Flash video (193kB) demonstrating how a user can enable the fast reply box by default on Invision Power Board.
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.
require 'digest/sha1'
# ...
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 values "1" and "red" respectively. The question mark indicates the start of the query string and the ampersand, &, symbol seperates variable=value assignments.
The page is then able to read these variables and react according to them, for example to display them to the user.
Passing a QueryString to a page
There are two ways to pass a QueryString to a page, the first is to enter it manually, for example:
<a href="page.asp?mode=1">Mode 1</a>
The above HTML creates a link to a page passing the variable mode with the value "1".
An alternative, and perhaps more useful, way is to use HTML forms. The main thing to remember with forms is that you need to use the GET method to send information via the QueryString, for example:
<form method="GET" action="page.asp">
Please enter your name: <input type="text" name="username" />
<input type="submit" value="submit" />
</form>
This code displays a simple HTML form with a text box and a submit button. When the user enters their name and presses submit, the information in the name box is passed to a page called "page.asp" (specified in the form's action attribute) via the QueryString. So, if I entered "mooseh" and pressed submit, the form will call page.asp?username=mooseh. Remember that "username" was what we entered as the text input's name attribute.
Accessing a QueryString element in ASP
In ASP, all the information passed via the QueryString is held in the Request.QueryString collection. To access an item, type Request.QueryString("varName"), where varName is the name of the variable in the QueryString.
To demonstrate, let's create page.asp to process the information from the form above:
<%@language="VBScript"%>
<% If Request.QueryString("username") "" Then
Response.Write "Hello, " & Request.QueryString("username")
Else
Response.Write "You did not enter a name."
End If
%>
So now, me typing in mooseh and pressing submit will generate the reply "Hello, mooseh".
Listing the contents of Request.QueryString
Should you wish to find out everything that's in the QueryString, you can do so with the following code which displays the variables next to their values in a table:
<%@language="VBScript"%>
<table border="1">
<tr><th>variable</th> <th>value</th></tr>
<%
Dim variable
For Each variable in Request.QueryString
Response.Write "<tr><td>" & variable & "</td>"
Response.Write "<td>" & Request.QueryString(variable) & "</td></tr>"
Next
%>
</table>
Conclusion
This article showed you how to pass information between pages with the QueryString, and a use which allows you to add some increased interactivity. There are a lot of other uses, for example selecting which section of a site to display based on a variable in the QueryString, and processing form data.
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.com
2. The path to the page: /example/page.asp
3. The QueryString: name=Bob
So how do you find it all out with your own scripts?
Well the following code should do it:
<%@language="VBScript"%>
<%
Dim strDomain, strPath, strQueryString, strURL
' find out the domain:
strDomain = Request.ServerVariables("HTTP_HOST")
' find out the path to the current file:
strPath = Request.ServerVariables("URL")
' find out the QueryString:
strQueryString = Request.ServerVariables("QUERY_STRING")
' put it all together:
strURL = "http://" & strDomain & strPath & "?" & strQueryString
Response.Write "The current URL is: " & strURL
%>
In an ASP page, within the ASP tags, <% ... %>, you can retrieve the IP address of a user through the ServerVariables collection of the Request object. To do this, you use the code Request.ServerVariables("REMOTE_ADDR").
Display The IP Address
So, if you want to display the IP Address to the user then the following page will suffice:
<%@language="VBScript"%>
<%
Response.Write "Hello! Your IP Address is: " & Request.ServerVariables("REMOTE_ADDR")
%>
Exploring Request.ServerVariables
You might be wondering what other information you can get from Request.ServerVariables, well you can find out with the following script which displays all the variables in it along with their values if set, in a HTML table:
<%@language="VBScript"%>
<table border="1">
<tr><th>Variable</th><th>Value</th></tr>
<%
Dim variable
For Each variable In Request.ServerVariables
Response.Write "<tr><td>" & variable & "</td>"
Response.Write "<td>" & Request.ServerVariables(variable) & "</td></tr>"
Next
%>
</table>
Finally, the following code works harder to find the true IP of the user by checking for proxies:
Function UserIP()
' This returns the True IP of the client calling the requested page
' Checks to see if HTTP_X_FORWARDED_FOR has a value then the client is operating via a proxy
UserIP = Request.ServerVariables ( "HTTP_X_FORWARDED_FOR" )
If UserIP = "" Then
UserIP = Request.ServerVariables ( "REMOTE_ADDR" )
End if
End Function
This 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 output is below, and below that is an explanation of what the code does.
<?
// create an image with width 100px, height 20px
$image = imagecreate(100, 20);
// create a red colour for the background
// as it is the first call to imagecolorallocate(), this fills the background automatically
$red_background = imagecolorallocate($image, 255, 0, 0);
// create a black colour for writing on the image
$black = imagecolorallocate($image, 0