if (isdefined("url.article")) form.article = url.article;
variables.error = arrayNew(1);
if (isdefined("form.name")) {
function IsEmail(str) {
if (REFindNoCase("^['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name))$",str)) return TRUE;
else return FALSE;
}
if (not len(trim(form.name))) foo = arrayAppend(variables.error, "Please enter your name");
if (not len(trim(form.fname))) foo = arrayAppend(variables.error, "Please enter your friend's name");
if (not len(form.email)) {
foo = arrayAppend(variables.error, "Please enter an email address");
} else if ( not IsEmail(form.email) ) {
foo = arrayAppend(variables.error, "Your email address does not appear to be formatted correctly.");
}
if (not len(form.femail)) {
foo = arrayAppend(variables.error, "Please enter your friend's email address");
} else if ( not IsEmail(form.femail) ) {
foo = arrayAppend(variables.error, "Your friend's email address does not appear to be formatted correctly.");
}
}
SELECT articleID, summary, articleTitle, articleDate
FROM tblArticles
WHERE articleID = Dear #form.fname#
#form.name# has sent you the following article from the Credit Today web site, which they though would be of interest to you.
------------------------
#GetArticle.articleTitle# - #dateformat(GetArticle.articleDate, "dd/mm/yyyy")#
#repeatString("=", len(GetArticle.articleTitle)+13)#
#REReplace(GetArticle.summary, "<[^>]*>", "", "All")#
#Application.vRoot#articles/articles.htm?article=#form.article#
-------------------------
Message:
#form.message#
Credit Today
http://www.credittoday.co.uk
UPDATE tblArticles SET referrals = referrals + 1 WHERE articleID =
SELECT firstname, lastname, homeemail, workemail, emailPref
FROM tblUsers
WHERE userID =