This area is for useful scripts that some of our visitors have
contributed. ASP 101 did not write them and is not responsible for the
operation of these scripts... heck we don't even take responsibility
for our own. ;) We simply found them interesting and or useful and
thought some of you might too!
"Hi,
I used your samples and tips a lot and I have learned a lot from you.
Now, I would like to send you a script of my own that I hope will be
helpful for somebody.
The script is intended to fasten the presentation of a directory
containing files available for download only. It put all files of the
directory in a drop down. Then the user just have to select the file, press
the download button and that's it, the download begins.
Please feel free send me your comments and advice."
This is a variety of the functions code provided
on this domain! I made two different functions
called HEAD and FOOT.
I also made a file called functions.asp calling
the two function bearing files head.asp and foot.asp.
This makes a base for a template file and a head and
foot document, so that you never again have to write
your menu system more than once for an entire web site.
I posted a sample for this one with a nifty bonus
hint on font settings. A bit beginners but its a
quite common error even on some larger domains.
The full source and my template and readme.txt is available here (2,197 bytes!).
"
"A script solving the issues of dropdown menu navigation as
described in the sample presented here under
http://www.asp101.com/samples/pulldown_nav.asp!
This script will not issue and JavaScript cross-browser
problems as JavaScript is obsolete in it.
It does the following for you;
Hitlog tracking in a simple form!
Navigation menu from a drop down box!
Describes a usage of the CASE!
Shows a simple form of form-2-db entry!
And all that in one script!
The script is available for download from here
and contains the readme notes from me, full source code, sample database for MS Access 97 and the
files menu.html and redir.asp with the navigation source sample. The zip file is 8,729 bytes!
I did not bother to create the link files as you will be able to create
those yourself by reading the code in redir.asp"
"I wrote it to be a Batch File Reader (so that I could instantly
check the contents of another batch file), but could easily be converted
into any other file type. It creates a link to any files of that type
in the file that is read. I.E. If there is a file called hello.bat
being called in the file you are editing, then there will be a link
placed so that you can read the contents of that file as well. Just
thought I'd share this with you.
It is a single ASP script that would only need two changes. The
function call at the bottom (change to directory you would like to
search through) and the Constant file_type at the top, (change to
the file_type that you would like to search for.)"
"Here is a copy of the SQL DDLs for creating table structures and
inserting the data for a SQL Server set of tables suitable for producing
pick lists for validation of the Month Names, Month Numbers, Days in each
Month and Years in the 20th Century, for example. I will be posting ASP
Source later this week which accesses these tables to produce linked pick
lists to assure that cross field valids are handled correctly. Leap year
logic and Century crossover will be handled in the code produced later.
This is my first attempt at producing some modestly valuable data and code
to contribute to generally available freeware as a payback for some of the
nice code I received previously."
"I don't really have an article but moreover a piece of code that
is very useful is getting DB connectivity in a hurry. All you have to
set is the server name, database name, username and password and it does
everything for you.
It's really handy in the fact that it dynamically figures out how many
columns you have in the SQL statement and writes them back. No messing
around with objRecodset("field name") stuff. It just loops through them
and outputs the names of the columns and the data returned."
"Here is a useful script to validate that a number is an integer.
Is a short file, similar to your PCase function. If you find it useful, let
me know."
"Hey I have a contribution to send to you guys. It would work great as an
added feature for your bar charts. The code below excepts two variable
from a drop down boxs, "number of bars (N)" and "shade of color spectrum.
It then produces a row of N cells that contains the color spectrum. Try
it and see what I mean, it is hard to explain but could be very useful.
Thanks a lot and keep up the good work!"
"I have some new code that you may be instested in. It is used
with credit cards to make sure they appear valid. This is a bit
advanced, but is commonly needed when dealing with ecommerce sites
that can not afford real credit card validation. The most advanced
feature in this code is the operater known as Mod. I have fully
commented code showing what is happening to perform a Mod10 check
on credit cards. You are free to use this code on the site. I
have attatched a working example to this message, and also provided
links for you to view the working code online."
"We come across lot of times a need to convert an Array from ASP page
to Javscript, so that we can manipulate in the HTML form using Javascript.
Here is an example of how to do that. I have two include files, one for
1D array, one for 2D array and one example page calling those files. You
can modify the array, ie calling from a Database (result set) or a COM
Component (VB Array) and have the array in Javascript and populate HTML
forms and manipulate. Some documentation is available in the code itself.
Happy programming!!!"