| Pick a newsletter to read - you can receive these every Saturday by subscribing. You can also read the article that describes how this is implemented. undefined NaN NaN Jun 5 2002 Apr 30 2002 Mar 31 2002 Feb 28 2002 Jan 23 2002 Jan 22 2002 Jan 15 2002 Jan 14 2002 Jan 7 2002 Dec 24 2001 Dec 11 2001 Nov 27 2001 Nov 12 2001 Aug 1 2001 Jul 14 2001 Jun 24 2001 Jun 10 2001 May 26 2001 May 12 2001 Apr 30 2001 Apr 22 2001 Apr 14 2001 Apr 8 2001 Mar 29 2001 Mar 24 2001 Mar 17 2001 Mar 10 2001 Mar 3 2001 Feb 24 2001 Feb 17 2001 Feb 10 2001 Feb 3 2001 Jan 27 2001 Jan 20 2001 Jan 13 2001 Jan 6 2001 Dec 30 2000 Dec 23 2000 Dec 16 2000 Dec 9 2000 Dec 2 2000 Nov 29 2000 Nov 25 2000 Nov 18 2000 Nov 11 2000 Nov 4 2000 Oct 28 2000 Oct 21 2000 Oct 14 2000 Oct 9 2000 Oct 7 2000 Oct 3 2000 Oct 1 2000 Sep 29 2000 Sep 27 2000 Sep 25 2000 Sep 23 2000 Sep 21 2000 Sep 18 2000 Sep 14 2000 Sep 11 2000 | | Jun 10 2001____________________________________________________________
C o v e r Y o u r A S P . c o m
Welcome to the latest newsletter!
http://CoverYourASP.com/
____________________________________________________________
I heard a useful phrase this week that I think I'll be using
quite a lot in my replies to the many "How do I.." emails
that I get each day.
Very few relate to my site at all, and are questions that
can only way be answered by writing the code. To these
emails the following phrase can be applied!..
"It's a SMOP!"
SMOP stands for Simple Matter Of Programming! I usually
follow this up with a pointer to my two most recommended
books for developers new to ASP or JavaScript:
http://www.amazon.com/exec/obidos/ASIN/1565923928/qid=961363675/sr=1-1/shawthingcom
http://www.amazon.com/exec/obidos/ASIN/0672318636/qid=969150309/sr=1-11/shawthingcom
____________________________________________________________
A W O R D F R O M M Y S P O N S O R S
http://www.nsoftware.com/
____________________________________________________________
IP*Works! V4 ASP Edition includes 30 components, optimized
for Active Server Page programming. The standard IP*Works!
components are all included, HTTP, FTP, SMTP, POP, IMAP,
REXEC etc. Also included are new, higher level components
such as WebUpload, WebForm, FileMailer, TraceRoute, and
more.
The package includes sample ASP pages demonstrating how to
access Web Services such as Yahoo Stock Quotes and UPS
Address Verification.
http://www.nsoftware.com/
____________________________________________________________
T H E D I A R Y
The events of the last week
http://CoverYourASP.com/ShowDiary.asp
____________________________________________________________
______
29 May
______
- A reader, J de Silva, published a kind review of me and my
site today - I took a look and was very impressed by his,
so you should check it out. I love the design - one to
watch.
http://j.desilva.tripod.com/
______
1 Jun
______
- Quite often I get emails like the one this afternoon
concerning email validation:
"Try [email protected] - you say it's ok but the domain and
email don't exist."
WRONG! Simply typing http://www.fsf.com into a browser
doesn't test if the domain exists! Go to Hexillion's
validation page and enter that email address and you'll
see a conversation with the fsf.com mail server!
http://hexillion.com/samples/EmailDossier.asp
______
6 Jun
______
- Thanks Alalia! Seems Alalia Lundy got the honor of
GirlGeek of the Week from GirlGeeks.com - and then
listed CoverYourASP as one of her favorite sites.
Cool. ;-)
http://www.girlgeeks.com/innergeek/gkwk/gkwk.html
______
7 Jun
______
- For those of you following the progress of my new
site - ASPRSS, being launched on June 18th - I have now
published the source code that enables you to create
your own RSS XML file.
It is available in VBScript and JavaScript in this zip
file: http://asprss.com/Source/Publishers.zip
and documented here: http://asprss.com/CreateRSS.asp
______
8 Jun
______
- Like a good scare, or think you know this internet
stuff? You should read Steve Gibson's article on
grc.com about the Distributed Denial Of Service (DDOS)
attacks against him by a 13 year old.
It'll take you an hour to read, but afterwards you
might be surprised how little you know. I was.
http://grc.com/
____________________________________________________________
R E C O M M E N D T H E S I T E !
Please recommend my site to your colleagues
http://CoverYourASP.com/Recommend.asp
____________________________________________________________
No new articles this time, all my time has been spent on
ASPRSS. New articles will be appearing soon about code I've
written for that site - including submitting data to forms
on other sites using the superb IPWorks component from
nSoftware.
I've been using the free trial version of the beta Version 5
which is being released soon. I have to say I was amazed how
much functionality the package has. Most components do one
or two things well, this one does far more than I can list
here.
If you haven't checked it out yet go to their website at
http://www.nsoftware.com/ - everyone has a list of "extra
somethings" that they want to add to their site, but don't
because it's too much work.
These components make those hard enhancements trivial to
implement.
http://www.nsoftware.com/
____________________________________________________________
H E R O O F T H E W E E K !
____________________________________________________________
Ron Gines is this weeks Hero of the Week. Ron started by
sending this email:
"Thanks for putting your site together. It has been a great
tool for me as I have taken a crash course in ASP and IIS
(I prefer Apache, Zope, etc. etc. etc. ...)
One of the first requirements for the client that I am
working with was to be able to use NT Authentication (using
NTLM and not Basic security). I just got done experimenting
with adding this functionality and have gotten it to work
enough that I believe that I can start building a site around
it.
I've created two now pages and made mods to a handful of
others. I was wondering if you would be interested in seeing
the code. I would have no problem with having you include
it in your distribution as long as all references to my
client were removed. Giving me any credit would be up to
you. [James: Ron, everyone gets credit!]
I also want to use some of your toolset for multiple sites,
so I started moving some of the configuration information
down into global.asa so that gross site changes could be
made rather simply."
Following this email ron sent a zip file containing all his
changes, which I will look at following the launch of ASPRSS
on June 18th.
____________________________________________________________
N E E D A N A S P I S P ?
Use mine. You won't find a nicer bunch of guys.
Cheap, efficient and extremely helpful.
http://EverPlanet.com/
____________________________________________________________
I made a small but useful enhancement to the database code
this week which I will add to the download soon - the
ability to pass in a recordset to the DBGetRecords( )
function as an optional parameter.
This comes in very handy when you need two recordsets open
at once, like I did on ASPRSS when writing the code to
automatically submit articles to directories:
// connect to database
DBInitConnection ( );
// create recordset for subscribed publishers
var oRSpub = Server.CreateObject( 'ADODB.Recordset' );
// get a list of RSS publishers
DBGetRecords ( 'SELECT SiteName,PublisherURL,ContactName,
ContactEmail FROM Members WHERE Confirmed=True
AND PublisherOnline=True AND MemberLevel>9', oRSpub );
// create recordset for directories
var oRSdir = Server.CreateObject( 'ADODB.Recordset' );
// get a list of RSS directories
DBGetRecords ( 'SELECT SiteName,DirectoryURL,ContactName,
ContactEmail FROM Members WHERE Confirmed=True
AND DirectoryOnline=True', oRSdir );
Not sending in a recordset will continue to fill in the
global recordset 'oRecordSet' as before.
Here's the simple change I made to DBGetRecords:
function DBGetRecords ( sSQL, oRS )
{
// use default recordset if none given
if ( oRS == undefined )
oRS = oRecordSet;
// if the Recordset is already open, close it
DBReleaseRecords ( oRS );
if ( oConnection )
oRS.Open ( sSQL, oConnection, adOpenForwardOnly, adLockReadOnly );
}
and DBReleaseRecords:
function DBReleaseRecords ( oRS )
{
// use default recordset if none given
if ( oRS == undefined )
oRS = oRecordSet;
// Don't call Close if the Recordset failed to Open properly,
// i.e. its State is still adStateClosed
if ( oRS != undefined && oRS.State != adStateClosed )
oRS.Close();
}
____________________________________________________________
F E E D B A C K
Have something to say? Please share!
http://CoverYourASP.com/Contact.asp
____________________________________________________________
Steve Smith: (of http://ASPAlliance.com/ )
"FYI, I just added the following error handler to your
ShowFile function that you may want to include in your
version. It was bombing because I was passing it a
physical file path (which was all I had at the point
at which I was calling ShowFile). Here's the fix to
handled both physical and virtual paths:"
function ShowFile ( oFSO, sFile, bPassHTML, bShowName, bLiveLinks )
{
var ForReading = 1;
// var ForWriting = 2;
// var ForAppending = 8;
var sPhysicalFilePath = '';
// open asp file for reading
try
{
sPhysicalFilePath = Server.MapPath(sFile);
}
catch(e)
{
sPhysicalFilePath = sFile;
}
var fFile = oFSO.OpenTextFile ( sPhysicalFilePath, ForReading );
Me:
Thanks Steve, good idea! Note that try..catch is only
available in JavaScript 5.5, so get the update from:
http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/msdownload/vbscript/scripting.asp
______
Koh:
"I met a problem while learning your site from my server.
I can't find the solution in your troubleshooting area,
Below is the problem:
Microsoft JET Database Engine error '80004005'
Selected collating sequence not supported by the
operating system.
Please help me to solve this. Thanks"
Me:
See http://support.microsoft.com/support/kb/articles/Q202/1/50.ASP
It looks as though your computer is using a language other
than English, so you need to install Multilanguage support
to access my database. The article above shows you how -
please let me know how you get on.
______
Peter Boekelheide:
"I'm doing some database stuff with my webserver, but the
database is on a different computer than the webserver and
it would be very difficult to move it to there. When I try
to just map a drive, I get an error complaining
"The Path parameter for the MapPath method must be a
virtual path. A physical path was used."
Is there something I can do to get around this? Any help
would be GREATLY appreciated. Thanks."
Me:
My original answer was "Just don't use MapPath if you have
a physical path - just use the path itself. All MapPath
does is turn a virtual path into a physical one...", but
as Steve Smith pointed out above you can always catch the
exception in the code so you can use both...
______
Here's a problem that I'd like help with - if anyone has any
ideas why this is happening I'd appreciate knowing!
Basically when Stephane uses the DBEditRecord.asp page, it
shows some very strange behaviour when the enumerator is
used at the top of the page to get the data from the
QueryString.
Given this URL...
DBEditRecord.asp?table=Diary&DiaryID=82&secret=1
...the enumerator returns the following:
oItem = 'table'
Request.QueryString ( oItem ) = 'Diary'
oItem = 'secret'
Request.QueryString ( oItem ) = '1'
As you see, the DiaryID=82 is completely skipped! After
running a whole bunch of tests on the IIS5 machine I had
to throw up my arms! Why would this happen?
______
Sing Cheng:
"I met problems again when doing a guestbook. In the
TEXTAREA of my guestbook form, when i enter
First line
Second line
Third line
then I submit my form and post the record into my
database. But when it display, it will display as
First line Second line Third line
So, I am asking your help! Could you please tell me
how to Insert the line break code (<BR>) into each
line of the text in the TEXTAREA before it be
submitted into the datebase?
If you have plenty time, please do tell me how to
REMOVE HTML Tags before my text which with HTML tags
being submitted into the database.
Thank you very much and I will very appreciate your
help."
Me:
I haven't checked, but you probably want to replace
linefeeds with <br>, which you can do with this statement:
sStr = sStr.replace ( /\n/g, '<br>' );
To remove all HTML from a string, try this:
sStr = sStr.replace ( /<[^>]*>/g, '' );
______
Ivan:
"I have tried to make a new newsletter(copied one from the
download, renamed it with a new date, and uploaded it into
folder Newsletters!
BUT I don`t find a link as the 3 link there were in the
download ! Why ? Am I missing something? I have tried the
ASPlist and some asplists in DK, but I don`t get an answer
that I can use.
Please give me a hint. I also have read all your articles
on the issue, but i still don`t see what I am missing?
Keep up the good work!"
Me:
Ivan, I use Application variables A LOT to cache data from
the database and in this case, the folder Newsletters too!
You're right that it's not referenced in the newsletter
articles (my bad), but it IS documented in the article
about administering the application variables - see it
at http://CoverYourASP.com/ApplicationAdmin.asp
The short answer to your question is to run this:
ResetNews.asp?SECRET=1
______
Conan:
"I have finally overhauled my companies site from FP
(boo,hiss!) to pure JScript ASP. You may like to take a
look (http://www.365digital.net ) and include it in your
Mini Me's perhaps? Just a thought... :-)
It also may interest you to know that the page "engine" is
OOP, as based on your article about Object Oriented
approaches to JScript:
http://CoverYourASP.com/Classes.asp
Oh, and have you ever realised:
JS = JavaScript
JS = James Shaw
Coincidence?"
Me:
hehehe! I added your site to the MiniMe page Conan.
Talking of FP, I came across another example of the cr*p it
produces last week. Just take a look at this, and figure out
which of the HTML is actually needed: (this is REAL!)
<TD width="44%"><!--mstheme--><font face="arial, Arial,
Helvetica"><!--mstheme--></font><!--msthemelist--><table
border="0" cellpadding="0" cellspacing="0" width="100%">
<!--msthemelist--><tr><td valign="baseline" width="42">
<img src="/_themes/ice36/36bullet.gif" width="24"
height="19" hspace="9" alt="bullet"></td><td valign="top"
width="100%"><!--mstheme--><font face="arial, Arial, Helvetica">
<STRONG><FONT size="3"><A href="/wordwrap/wordwrap.htm"
name="wordwrap">WordWrap</A></FONT></STRONG><!--mstheme-->
</font><!--msthemelist--></td></tr><!--msthemelist--></table>
<!--mstheme--><font face="arial, Arial, Helvetica">
<!--mstheme--></font></TD>
That's 679 bytes. Here is what it some *very simple* editing
will do, and there's much more to optimize..
<td width="44%"><table border="0" cellpadding="0"
cellspacing="0" width="100%"><tr><td valign="baseline"
width="42"><img src="/_themes/ice36/36bullet.gif"
width="24" height="19" hspace="9" alt="bullet"></td>
<td valign="top" width="100%"><font face="Arial, Helvetica"
size="3"><strong><a href="/wordwrap/wordwrap.htm"
name="wordwrap">WordWrap</a></strong></font></td></tr>
</table></td>
That's 405 bytes, or 60% of the original HTML...
______
Justin:
"Dear James, Just found your site today, and I must say
*supurb*, some very interesting articals, keep up the good
work.
I recieve an automated e-mail from one of my sites giving
me basic user information when the site is entered. One of
the snippets of information I recieve is the users browser
type.
In your article on 'hiding meta tags' your mention that
spiders don't generally use the name Mozilla; my sites
frequently get hit by (at least) one which does, below is
the full name string:
Mozilla/3.0 (Slurp/cat; [email protected]; http://www.inktomi.com/slurp.html)
Hope this helps. Much respect"
Me:
Thanks Justin. You're right of course, in fact the article
hasn't kept pace with the code as it's evolved. In fact
"slurp" is one of the keywords I look for when checking for
bots now. The current code says this:
function IsKnownBrowser ( sAgent )
{
// check it's not an obvious spider/crawler first
// (some of these are mozilla as well)
if ( -1 != sAgent.indexOf ( 'spider' ) ||
-1 != sAgent.indexOf ( 'crawler' ) ||
-1 != sAgent.indexOf ( 'robot' ) ||
-1 != sAgent.indexOf ( 'gulliver' ) ||
-1 != sAgent.indexOf ( 'slurp' ) )
return false;
// it's well known if it contains mozilla (IE or Netscape) or opera
if ( -1 != sAgent.indexOf ( 'mozilla' ) ||
-1 != sAgent.indexOf ( 'opera' ) )
return true;
// don't recognize this agent
return false;
}
______
Venakata:
"Hi James, Can you tell me where is the interface for
uploading the images for the ad system in your site? Can
you also give me a link where I can find the source code
for uploading the images and where and how are you
collecting the money from the advertisers who wanted to
advertise?
I appreciate any light you through regarding this."
Me:
In short, there isn't one! Advertisers don't come along
every day, and they haven't needed to change banners often,
so I just FTP them onto the site. I just haven't needed to
write the upload code, so I haven't!
As far as payment is concerned, it varies. Some send
checks, others pay through the credit card page as
documented on http://CoverYourASP.com/CreditCards.asp
____________________________________________________________
A W O R D F R O M M Y S P O N S O R S
http://www.hexillion.com/refer.asp?id=cya7&dest=%2F
____________________________________________________________
Get FREE sample code, online utilities, and articles at
Hexillion.
Add intelligence to your ASP applications! Look up Whois
records, check email addresses, do DNS lookups, find network
problems with Ping and Traceroute, and more.
http://www.hexillion.com/refer.asp?id=cya7&dest=%2F
____________________________________________________________
H A V E I H E L P E D Y O U ?
If I've helped you, help me help others!
http://CoverYourASP.com/Donate.asp
===> now with new ways to say thanks! <===
____________________________________________________________
Thanks for your patience while I finish up ASPRSS this week,
it's been a long while coming! First FSS, then STORS, but
finally I have a working system. Next time I want to save
my self a few hours a week I hope I remember this, and don't
spend over a month writing a brand new web site.
I think I could have manually submitted over 650 articles in
the same amount of time. ;-)
Thanks Guys! Speak to you in two weeks.
Warmest Regards,
James Shaw
[email protected]
885 Woodstock Road, Suite 430, #108
Roswell, GA 30075-2247, U.S.A.
____________________________________________________________
S U B S C R I P T I O N S
Do you want to subscribe or unsubscribe?
http://CoverYourASP.com/Subscribe.asp
____________________________________________________________ |
| |