AdMentor homepage

/asp/freeapps/topsitementor/joinlist.asp

<% OPTION EXPLICIT Response.Buffer = True %> <!--#include file="inctopsite.asp"--> <!--#include file="incgenmail.asp"--> <% Function VerifyName( sName ) ' Dim nCount ' Const szValidChars = "abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ0123456789" If sName = "" Then VerifyName = "Must enter a name" Exit Function End If ' For nCount = 1 To Len(sName ) ' If InStr( szValidChars, InStr( nCount, sName, 1 ) ) <= 0 Then ' VerifyName = "Valid characters are A-Z,a-z, 0-9" ' End If ' Next VerifyName = "" End Function Function VerifyPasswords( s1, s2 ) If s1 = "" Then VerifyPasswords = "Must enter passwords" Exit Function End If If s1 <> s2 Then VerifyPasswords = "Password and password again not equal" Exit Function End If If Len(s1) < 5 Then VerifyPasswords = "Password must be at least 5 chars" End If End Function Function IsValidEmail( ByVal sString ) Dim sEmail, nIndex, nDotIndex IsValidEmail = False sString = Trim(sString) 'Check if it does contain any '@' nIndex = InStr(1, sString, "@") If nIndex < 2 Then 'Cant be first either Exit Function End If 'Now check where the dot is nDotIndex = InStrRev(sString, "." ) If nDotIndex < nIndex + 1 Then Exit Function End If 'String can only have one '@' If InStr( nIndex + 1, sString, "@" ) > nIndex Then Exit Function End If 'Check domain - at least two characters ' Response.Write "DOTINDEX:" &nDotIndex &":::Len(sString)" &Len(sString) & "<br>" ' Response.Write "Minus:" &Len(sString)-nDotIndex &"<br>" If nDotIndex > Len( sString ) - 2 Then Exit Function End If If Len(sString)-nDotIndex >3 Then Exit Function End If IsValidEmail = True End Function Function VerifyEmail( s1 ) If s1 = "" Then VerifyEmail = "Not a valid email address" Exit Function End If If IsValidEmail(s1)=False Then VerifyEmail="Not an valid email address" End If End Function Function VerifyUrl( s1 ) If s1 = "" Then VerifyUrl = "Not a valid url" Exit Function End If End Function Function VerifyBannerUrl( s1 ) If s1 = "" Then VerifyBannerUrl = "Not a valid url" Exit Function End If End Function 'Some before doings... Dim oConn, sRubrik Set oConn = IncTopsite_GetDatabaseConn() Dim sPassword, sPasswordAgain, sBannerUrl, sUrl, sEmail, sSiteName, sSiteDescr, sCat Dim sPasswordError, sBannerUrlError, sUrlError, sEmailError, sSiteNameError, sSiteDescrError '1. Are we saving If Request.QueryString("save")="yes" Then ' sPassword=Request.Form("password") sPasswordAgain=Request.Form("password1") sUrl=Request.Form("url") sEmail=Request.Form("email") sSiteName=Request.Form("sitename") sSiteDescr=Request.Form("sitedescr") sCat = Request.Form("cat") sSiteNameError = VerifyName( sSiteName ) ' sSiteDescrError = VerifyDescr( sSiteDescr ) sPasswordError = VerifyPasswords( sPassword, sPasswordAgain ) sEmailError = VerifyEmail( sEmail ) sUrlError=VerifyBannerUrl( sUrl ) If sSiteNameError="" And sSiteDescrError="" And sPasswordError="" And sEmailError="" And sUrlError="" Then 'Save it... Dim oRSTC Set oRSTC = Server.CreateObject("ADODB.Recordset") oRSTC.Open "select * from " & IncTopsite_GetTablePrefix() & "site where id=-1", oConn,1,3 oRSTC.AddNew() oRSTC("sitename")=sSiteName oRSTC("sitedescr")=Left(sSiteDescr,255) oRSTC("password")=sPassword oRSTC("url")=sUrl oRSTC("email")=sEmail oRSTC("catid")=sCat oRSTC("joinedwhen")=Now() oRSTC("incount")=0 oRSTC("outcount")=0 oRSTC.Update Dim nNewId nNewId = oRSTC("id").Value oRSTC.Close Set oRSTC = Nothing If nNewId = "" Then Set oRSTC = oConn.Execute("select @@identity as newid") nNewId = oRSTC("newid").Value oRSTC.Close Set oRSTC = Nothing End If oConn.Close Set oConn = Nothing 'Send a mail... Dim sMsg sMsg = "Thanks for joining " & g_strTitle & "!" & vbCrLf & vbCrLf sMsg = sMsg & "Here are some info you need:" & vbCrLf sMsg = sMsg & "-----------------------------" & vbCrLf sMsg = sMsg & "Userid:" & nNewId & vbCrLf sMsg = sMsg & "Password:" & sPassword & vbCrLf sMsg = sMsg & "-----------------------------" & vbCrLf sMsg = sMsg & "1. HTML to place on your website:" & vbCrLf& vbCrLf sMsg = sMsg & "<a href='" & g_strPath & "/rankem.asp?manager=aspcode.net&id=" & CStr(nNewId) & "'><img src='" & g_strButtonImagePath & "'></a>" & vbCrLf& vbCrLf sMsg = sMsg & "2. To change your profile login at: " & g_strPath & "/admin.asp" & vbCrLf sMsg = sMsg & "3. See the list at: " & g_strPath & "/showlist.asp" & vbCrLf& vbCrLf SendEmail g_MailServer, g_OutgoingMailFrom, sEmail, g_strTitle & " information", sMsg 'Redirect to show page Response.Redirect "added.asp?id=" & nNewId Response.Flush Response.End End If End If %> <html> <head> <meta http-equiv="Content-Language" content="en"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>LinkMentor demo</title> <style type="text/css"> <!-- body { font-family: Verdana,Arial,Helvetica; font-size: smaller; color: #000000} td { font-family: Verdana,Arial,Helvetica; font-size: smaller; color: #000000} th { font-family: Verdana,Arial,Helvetica; font-size: smaller; color: #000000} A:link {text-decoration: none;} A:visited {text-decoration: none;} A:hover {text-decoration: underline;} --> </style> </head> <body bgcolor="<%=g_strBodyColor%>"> <table border="0" width="100%"> <tr> <td width="100%" align="center"> <%=FAQ_GetAd( 1 )%> <hr> </td> </tr> <tr> <td width="100%" align="center"><font color="#660000" face="Tahoma,Verdana,Arial" size="+3"><b>Join our toplist!</b></font><BR><b><font size="2"><br> 1. Enter the information</font></b> <p><b><font size="2">2. You will receive the HTML code to add to your site immedietly as well as some account information and the url to the account admin page, where you can change password, description, category etc.</font></b></p> <p><b><font size="2">3. That's it!&nbsp;&nbsp;As soon as someone clicks on the button on your site you will get credit on the list!&nbsp;</font></b></p> <p>&nbsp;</p> </td> </tr> </table> <table border="0" width="100%"> <tr> <td valign="top" align="center"> <hr> <table border="0" width="100%"> </table> <form method="POST" action="joinlist.asp?save=yes"> <table border="0"> <tr> <td width="50%">Email address:</td> <td width="50%"> <input type="text" name="email" size="20" value="<%=sEmail%>"> <%If sEmailError <> "" Then%><br><font size="1" color="#FF0000"><%=sEmailError%></font><%End If%> </td> </tr> <tr> <td width="50%">Desired password:</td> <td width="50%"><input type="password" name="password" size="20"> <%If sPasswordError <> "" Then%><br><font size="1" color="#FF0000"><%=sPasswordError%></font><%End If%> </td> </tr> <tr> <td width="50%">Password again:</td> <td width="50%"><input type="password" name="password1" size="20"></td> </tr> <tr> <td width="50%">Site name:</td> <td width="50%"><input type="text" name="sitename" size="20" value="<%=sSiteName%>"> <%If sSitenameError <> "" Then%><br><font size="1" color="#FF0000"><%=sSitenameError%></font><%End If%> </td> </tr> <tr> <td width="50%">Site description ( max 255 letters ):</td> <td width="50%"><textarea rows="2" name="sitedescr" cols=