Below are snippets for Cyber-Drugs.
9
The below may be a simple line of code, but it is extremely useful to help prevent SQL Injection. There are many other methods, such as removing certain values from your string, but this is by far superior, as it does not limit what can be inserted to your database.
6
Ever used the Explode() function, and in some parts of the returned array, are NULL values? Below is a function which will only return values which are not NULL. Depending on what you are trying to achieve, this could turn out to be useful.
6
Ever created a webpage, and it didn't need a scrollbar, yet IE still displays the verticale scrollbar (but as disabled)? Well the code below will remove that problem for you. Unfortunately it is not W3C compliant code, although it does work, it's not really meant to be used.
5
Cyber-Drugs
Below is a very simple bit of code you can use to test a MySQL Database Connection.
5
Before any wars start, I want to clarify that the code below is NOT my own code, but unfortunately I am uncertain where I obtained it from. The code below basically create dynamic thumbnails of an image, you parse the following to it:
Image location,
Maximum Width
Maximum Height
It will then scale your image down, please do not confuse this with converting your image into a square, or whatever shape you are after. The code below will maintain aspect ratio of your image, and will use the values you parse as a guidline. Extremely handy when you are building gallery websites.
Image location,
Maximum Width
Maximum Height
It will then scale your image down, please do not confuse this with converting your image into a square, or whatever shape you are after. The code below will maintain aspect ratio of your image, and will use the values you parse as a guidline. Extremely handy when you are building gallery websites.
5
Ever wanted to determine what is the highest Z-Index out of everything displayed on your page, so that you can move an object to a higher position? Well the code below will do exactly that, it's not my own code, I've been using it for quite a few months now, so unfortunately I cannot remember where I got it from.
5
Below is the code you can use in Access Database Forms, to test a DSN connection. Handy if you want to link some of your Forms to another database via DSN.
2
Cyber-Drugs
Below is a bit of code, which I needed to make when creating an application which did a lot of file manipulation. If you ever want to load the contents of a file, but remove X amount of lines from the end of the file, use the function below.
2
Ever wanted to disable the ability to highlight/select anything on a page? Below is the code you use to achieve this.
2
Ever noticed that with the new Netscape, which allows you to view your pages in FireFox or IE Display mode, when in IE mode:
navigator.appName
Thinks Internet Explorer is actually being run, rather than Netscape?
Well below is the code you need to get around this problem.
navigator.appName
Thinks Internet Explorer is actually being run, rather than Netscape?
Well below is the code you need to get around this problem.









