<%@ Language="VBscript" %>
<html>
<head>
<title>Submitted Postcode</title>
</head>
<body>
<%
'declare the variables that will receive the values
Dim fishery, street_address, town_city, county, postcode
'receive the values sent from the form and assign them to variables
fishery=Request.Form("fishery")
street_address=Request.Form("street_address")
town_city=Request.Form("town_city")
county=Request.Form("county")
postcode=Request.Form("postcode")
'print out the received values in the browser
Response.Write("Fishery: " & fishery & "<br>")
Response.Write("Street Address: " & street_address & "<br>")
Response.Write("Town/City: " & town_city & "<br>")
Response.Write("County: " & county & "<br>")
Response.Write("Postcode: " & postcode & "<br>")
%>
</body>
</html>
<%
strConn = (your DB connection here)
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open(strConn)
strFishery=chkString(Request.Form("fishery"))
strAddress=chkString(Request.Form("street_address"))
strTown=chkString(Request.Form("town_city"))
strCountry=chkString(Request.Form("country"))
strPost=chkString(Request.Form("postcode"))
strSql="INSERT INTO POSTCODES (FISHERY,STREET_ADDRESS,TOWN_CITY,COUNTRY,POSTCODE) VALUES (strFishery,strAddress,strTown,strCountry,strPost)"
my_Conn.Execute(strSql)
my_Conn.Close
Set my_Conn=Nothing
Response.Write "<p align=""center"">Complete</p>"
Response.End
Function chkString(fString)
fString = Trim(fString)
fString = Replace(fString, "'", "''")
fString = Replace(fString, "\", "\\")
fString = Replace(fString, ">", ">")
fString = Replace(fString, "<", "<")
chkString = fString
Exit Function
%>
<%@ Language="VBscript" %>
<html>
<head>
<title>Submitted Postcode</title>
</head>
<body>
<%
'declare the variables that will receive the values
Dim fishery, street_address, town_city, county, postcode
'receive the values sent from the form and assign them to variables
'note that request.form("name") will receive the value entered
'into the textfield called name
fishery=Request.Form("fishery")
street_address=Request.Form("street_address")
town_city=Request.Form("town_city")
county=Request.Form("county")
postcode=Request.Form("postcode")
'let's now print out the received values in the browser
Response.Write("Fishery: " & fishery & "<br>")
Response.Write("Street Address: " & street_address & "<br>")
Response.Write("Town/City: " & town_city & "<br>")
Response.Write("County: " & county & "<br>")
Response.Write("Postcode: " & postcode & "<br>")
%>
<%
strConn = "DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost; DATABASE=dbname; " &_
"UID=user;PASSWORD=password; OPTION=3"
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open(strConn)
strFishery=chkString(Request.Form("fishery"))
strAddress=chkString(Request.Form("street_address"))
strTown=chkString(Request.Form("town_city"))
strCounty=chkString(Request.Form("county"))
strPost=chkString(Request.Form("postcode"))
strSql="INSERT INTO POSTCODES (FISHERY,STREET_ADDRESS,TOWN_CITY,COUNTY,POSTCODE) VALUES (strFishery,strAddress,strTown,strCounty,strPost)"
my_Conn.Execute(strSql)
my_Conn.Close
Set my_Conn=Nothing
Response.Write "<p align=""center"">Complete</p>"
Response.End
Function chkString(fString)
fString = Trim(fString)
fString = Replace(fString, "'", "''")
fString = Replace(fString, "\", "\\")
fString = Replace(fString, ">", ">")
fString = Replace(fString, "<", "<")
chkString = fString
Exit Function
%>
</body>
</html>
<html>
<head>
<title>Address Submitted</title>
</head>
<body>
<%
dim strFishery, strAddress, strTown, strCounty, strPost, strConn, my_Conn, strErr
strErr = ""
If Request.Form("fishery")>"" Then
strFishery=chkString(Request.Form("fishery"))
Else
strErr="[li]You must specify the fishery.[/li]"
End If
If Request.Form("street_address")>"" Then
strAddress=chkString(Request.Form("street_address"))
Else
strErr=strErr & "[li]You must specify the street address.[/li]"
End If
If Request.Form("town_city")>"" Then
strTown=chkString(Request.Form("town_city"))
Else
strErr=strErr & "[li]You must specify the town/city.[/li]"
End If
If Request.Form("county")>"" Then
strCounty=chkString(Request.Form("county"))
Else
strErr=strErr & "[li]You must specify the county.[/li]"
End If
If Request.Form("postcode")>"" Then
strPost=chkString(Request.Form("postcode"))
Else
strErr=strErr & "[li]You must specify the post code.[/li]"
End If
If strErr > "" Then
Response.Write "<table align=""center"" width=""50%"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""black""><p><b><u>Missing Information</u></b></p><ul>" & strErr & "</ul>"
" Go <a href=""javascript:history.go(-1)"";>back</a> to correct." & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
Response.End
End If
Response.Write "Fishery: " & strFishery & "<br />Street Address: " & strAddress & "<br />Town/City: " & strTown & "<br />County: " & strCounty & "<br />Post Code: " & strPost & "<br />"
strConn = "driver={MySQL ODBC 5.1 Driver};option=67108867;server=127.0.0.1;user=user;password=password;DATABASE=dbname;"
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open(strConn)
strSql="INSERT INTO POSTCODES (FISHERY,STREET_ADDRESS,TOWN_CITY,COUNTY,POSTCODE) VALUES ('" & strFishery & "','" & strAddress & "','" & strTown & "','" & strCounty & "','" & strPost & "')"
my_Conn.Execute(strSql)
my_Conn.Close
Set my_Conn=Nothing
Response.Write "<p align=""center"">Complete</p>"
Response.End
Function chkString(fString)
fString = Trim(fString)
fString = Replace(fString, "'", "''")
fString = Replace(fString, "\", "\\")
fString = Replace(fString, ">", ">")
fString = Replace(fString, "<", "<")
chkString = fString
End Function
%>
</body>
</html>
<html>
<head>
<title>Address Submitted</title>
</head>
<body>
<%
Function chkString(fString)
fString = Trim(fString)
fString = Replace(fString, "'", "''")
fString = Replace(fString, "\", "\\")
fString = Replace(fString, ">", ">")
fString = Replace(fString, "<", "<")
chkString = fString
End Function
If Request.Form("sendme") > "" Then
dim strFishery, strAddress, strTown, strCounty, strPost, strConn, my_Conn, strErr
strErr = ""
If Request.Form("fishery")>"" Then
strFishery=chkString(Request.Form("fishery"))
Else
strErr="[li]You must specify the fishery.[/li]"
End If
If Request.Form("street_address")>"" Then
strAddress=chkString(Request.Form("street_address"))
Else
strErr=strErr & "[li]You must specify the street address.[/li]"
End If
If Request.Form("town_city")>"" Then
strTown=chkString(Request.Form("town_city"))
Else
strErr=strErr & "[li]You must specify the town/city.[/li]"
End If
If Request.Form("county")>"" Then
strCounty=chkString(Request.Form("county"))
Else
strErr=strErr & "[li]You must specify the county.[/li]"
End If
If Request.Form("postcode")>"" Then
strPost=chkString(Request.Form("postcode"))
Else
strErr=strErr & "[li]You must specify the post code.[/li]"
End If
If strErr > "" Then
Response.Write "<table align=""center"" width=""50%"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""black""><p><b><u>Missing Information</u></b></p><ul>" & strErr & "</ul>" & vbNewLine & _
" Go <a href=""javascript:history.go(-1)"";>back</a> to correct." & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
Response.End
End If
strSpace=" "
Response.Write "<font face=""consolas"">Fishery:" & left(strSpace,54) & strFishery & "<br />Street Address: " & left(strSpace,6) & strAddress & "<br />Town/City: " & left(strSpace,35) & strTown & "<br />County: " & left(strSpace,54) & strCounty & "<br />Post Code: " & left(strSpace,35) & strPost & "<br /></p></font>"
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb") ' strConn = "driver={MySQL ODBC 5.1 Driver};option=67108867;server=127.0.0.1;user=user;password=password;DATABASE=dbname;"
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open(strConn)
strSql="INSERT INTO POSTCODES (FISHERY,STREET_ADDRESS,TOWN_CITY,COUNTY,POSTCODE) VALUES ('" & strFishery & "','" & strAddress & "','" & strTown & "','" & strCounty & "','" & strPost & "')"
my_Conn.Execute(strSql)
my_Conn.Close
Set my_Conn=Nothing
Response.Write "<p align=""center"">Complete</p>"
Response.End
End If
Response.Write "<form action=""address.asp"" method=""post"">" & vbNewLine & _
" <input type=""hidden"" name=""sendme"" value=""doit"" />" & vbNewLine & _
" <table align=""center"" width=""600px;"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <table align=""center"" width=""100%"" bgColor=""black"" border=""1"" style=""border-collapse:collapse;"" cellpadding=""4"" cellspacing=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Fishery: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""fishery"" value=""" & Request.Form("fishery") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Street Address: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""street_address"" value=""" & Request.Form("street_address") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Town/City: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""town_city"" value=""" & Request.Form("town_city") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>County: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""county"" value=""" & Request.Form("county") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Post Code: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""postcode"" value=""" & Request.Form("postcode") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr height=""40px;"" valign=""bottom"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" width=""100%"">" & vbNewLine & _
" <input style=""color:maroon; font-weight:bold; padding:5px 10px 5px 10px; border:1px solid black; text-shadow:0px 1px 1px #000; text-decoration none; border-radius:25px; -moz-border-radius:25px; -webkit-border-radius:25px; background:lightgrey;"" type=""Submit"" name=""Submit"" value=""Submit"" />" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
%>
</body>
</html>
<html>
<head>
<title>Address Submitted</title>
</head>
<body>
<!--#INCLUDE file="inc_sha256.asp"-->
<%
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("test.mdb") ' strConn = "driver={MySQL ODBC 5.1 Driver};option=67108867;server=127.0.0.1;user=user;password=password;DATABASE=dbname;"
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open(strConn)
strCookieURL = Left(Request.ServerVariables("Path_Info"), InstrRev(Request.ServerVariables("Path_Info"), "/"))
strUniqueID = "FishAddy"
Const intCookieDuration = 30
Function chkString(fString)
fString = Trim(fString)
fString = Replace(fString, "'", "''")
fString = Replace(fString, "\", "\\")
fString = Replace(fString, ">", ">")
fString = Replace(fString, "<", "<")
chkString = fString
End Function
If not Session("UID") > 0 Then
If Request.Form("Pass") > "" Then
strUser = trim(Request.Form("User"))
strPass = sha256(Request.Form("Pass"))
Else
strUser = Request.Cookies(strCookieURL & "User")
strPass = Request.Cookies(strCookieURL & "Pass")
End If
If strUser > "" Then
strSql = "SELECT USER_ID, USER, PASS FROM USERS WHERE USER='" & strUser & "' AND PASS='" & strPass & "'"
Set rsID = my_Conn.Execute(strSql)
If not rsID.EOF Then
Session("UID") = rsID("USER_ID")
Response.Cookies(strUniqueID & "User")("User") = strUser
Response.Cookies(strUniqueID & "User")("Pass") = strPass
Response.Cookies(strUniqueID & "User").Expires = dateAdd("d", intCookieDuration, Now())
rsID.Close
End If
Set rsID = Nothing
Else
Response.Write "<form action=""address.asp"" method=""post"">" & vbNewLine & _
" <table align=""center"" width=""600px;"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <table align=""center"" width=""100%"" bgColor=""black"" border=""1"" style=""border-collapse:collapse;"" cellpadding=""4"" cellspacing=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>User: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""User"" value=""" & Request.Form("User") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Pass: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""password"" name=""Pass"" value="""" style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr height=""40px;"" valign=""bottom"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" width=""100%"">" & vbNewLine & _
" <input style=""color:maroon; font-weight:bold; padding:5px 10px 5px 10px; border:1px solid black; text-shadow:0px 1px 1px #000; text-decoration none; border-radius:25px; -moz-border-radius:25px; -webkit-border-radius:25px; background:lightgrey;"" type=""Submit"" name=""Submit"" value=""Submit"" />" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
Response.End
End If
End If
If Request.Form("sendme") > "" Then
dim strFishery, strAddress, strTown, strCounty, strPost, strConn, my_Conn, strErr
strErr = ""
If Request.Form("fishery")>"" Then
strFishery=chkString(Request.Form("fishery"))
Else
strErr="[li]You must specify the fishery.[/li]"
End If
If Request.Form("street_address")>"" Then
strAddress=chkString(Request.Form("street_address"))
Else
strErr=strErr & "[li]You must specify the street address.[/li]"
End If
If Request.Form("town_city")>"" Then
strTown=chkString(Request.Form("town_city"))
Else
strErr=strErr & "[li]You must specify the town/city.[/li]"
End If
If Request.Form("county")>"" Then
strCounty=chkString(Request.Form("county"))
Else
strErr=strErr & "[li]You must specify the county.[/li]"
End If
If Request.Form("postcode")>"" Then
strPost=chkString(Request.Form("postcode"))
Else
strErr=strErr & "[li]You must specify the post code.[/li]"
End If
If strErr > "" Then
Response.Write "<table align=""center"" width=""50%"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""black""><p><b><u>Missing Information</u></b></p><ul>" & strErr & "</ul>" & vbNewLine & _
" Go <a href=""javascript:history.go(-1)"";>back</a> to correct." & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
Response.End
End If
strSpace=" "
Response.Write "<font face=""consolas"">Fishery:" & left(strSpace,54) & strFishery & "<br />Street Address: " & left(strSpace,6) & strAddress & "<br />Town/City: " & left(strSpace,35) & strTown & "<br />County: " & left(strSpace,54) & strCounty & "<br />Post Code: " & left(strSpace,35) & strPost & "<br /></p></font>"
strSql="SELECT FISHERY, POSTCODE FROM POSTCODES WHERE FISHERY='" & strFishery & "' AND POSTCODE='" & strPost & "'"
Set rsFish=my_Conn.Execute(strSql)
If not rsFish.EOF Then
rsFish.Close
Response.Clear
strErr = "[li]Already in database.[/li]"
Response.Write "<table align=""center"" width=""50%"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""black""><p><b><u>Duplicate Information</u></b></p><ul>" & strErr & "</ul>" & vbNewLine & _
" Go <a href=""javascript:history.go(-1)"";>back</a> to correct." & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
Set rsFish = Nothing
Response.End
Else
Set rsFish = Nothing
End If
strSql="INSERT INTO POSTCODES (FISHERY,STREET_ADDRESS,TOWN_CITY,COUNTY,POSTCODE) VALUES ('" & strFishery & "','" & strAddress & "','" & strTown & "','" & strCounty & "','" & strPost & "')"
my_Conn.Execute(strSql)
my_Conn.Close
Set my_Conn=Nothing
Response.Write "<p align=""center"">Complete</p>"
Response.End
End If
Response.Write "<form action=""address.asp"" method=""post"">" & vbNewLine & _
" <input type=""hidden"" name=""sendme"" value=""doit"" />" & vbNewLine & _
" <table align=""center"" width=""600px;"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <table align=""center"" width=""100%"" bgColor=""black"" border=""1"" style=""border-collapse:collapse;"" cellpadding=""4"" cellspacing=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Fishery: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""fishery"" value=""" & Request.Form("fishery") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Street Address: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""street_address"" value=""" & Request.Form("street_address") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Town/City: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""town_city"" value=""" & Request.Form("town_city") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>County: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""county"" value=""" & Request.Form("county") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Post Code: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""postcode"" value=""" & Request.Form("postcode") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr height=""40px;"" valign=""bottom"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" width=""100%"">" & vbNewLine & _
" <input style=""color:maroon; font-weight:bold; padding:5px 10px 5px 10px; border:1px solid black; text-shadow:0px 1px 1px #000; text-decoration none; border-radius:25px; -moz-border-radius:25px; -webkit-border-radius:25px; background:lightgrey;"" type=""Submit"" name=""Submit"" value=""Submit"" />" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
%>
</body>
</html>
<!--#INCLUDE file="inc_sha256.asp"-->
<%
strConn = "driver={MySQL ODBC 5.1 Driver};option=67108867;server=127.0.0.1;user=user;password=password;DATABASE=dbname;"
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open(strConn)
strCookieURL = Left(Request.ServerVariables("Path_Info"), InstrRev(Request.ServerVariables("Path_Info"), "/"))
Function chkString(fString)
fString = Trim(fString)
fString = Replace(fString, "'", "''")
fString = Replace(fString, "\", "\\")
fString = Replace(fString, ">", ">")
fString = Replace(fString, "<", "<")
chkString = fString
End Function
If Request.Form("Pass") > "" Then
strUser = trim(Request.Form("User"))
strPass = sha256(Request.Form("Pass"))
Else
strUser = Request.Cookies("FishAddy" & "User")("User")
strPass = Request.Cookies("FishAddy" & "User")("Pass")
End If
If strUser > "" Then
strSql = "SELECT USER_ID, USER_NAME, USER_PASS FROM USERS WHERE USER_NAME='" & strUser & "' AND USER_PASS='" & strPass & "'"
Set rsID = my_Conn.Execute(strSql)
If not rsID.EOF Then
Response.Cookies("FishAddy" & "User").Path = strCookieURL
Response.Cookies("FishAddy")="FishAddy"
Response.Cookies("FishAddy" & "User")("User") = strUser
Response.Cookies("FishAddy" & "User")("Pass") = strPass
Response.Cookies("FishAddy" & "User").Expires = dateAdd("d", 30, Now())
rsID.Close
Else
Set rsID = Nothing
strUser=""
Response.Write "End of file reached. <mark>No record found.</mark> Go <a href=""javascript:history.go(-1);"">back</a> to try again."
Response.End
End If
Set rsID = Nothing
End If
If Request.Form("sendme") > "" Then
dim strFishery, strAddress, strTown, strCounty, strPost, strConn, my_Conn, strErr
strErr = ""
If Request.Form("fishery")>"" Then
strFishery=chkString(Request.Form("fishery"))
Else
strErr="[li]You must specify the fishery.[/li]"
End If
If Request.Form("street_address")>"" Then
strAddress=chkString(Request.Form("street_address"))
Else
strErr=strErr & "[li]You must specify the street address.[/li]"
End If
If Request.Form("town_city")>"" Then
strTown=chkString(Request.Form("town_city"))
Else
strErr=strErr & "[li]You must specify the town/city.[/li]"
End If
If Request.Form("county")>"" Then
strCounty=chkString(Request.Form("county"))
Else
strErr=strErr & "[li]You must specify the county.[/li]"
End If
If Request.Form("postcode")>"" Then
strPost=chkString(Request.Form("postcode"))
Else
strErr=strErr & "[li]You must specify the post code.[/li]"
End If
If strErr > "" Then
Response.Write "<table align=""center"" width=""50%"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""black""><p><b><u>Missing Information</u></b></p><ul>" & strErr & "</ul>" & vbNewLine & _
" Go <a href=""javascript:history.go(-1)"";>back</a> to correct." & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
Response.End
End If
strSpace=" "
Response.Write "<font face=""consolas"">Fishery:" & left(strSpace,9) & strFishery & "<br />Street Address: " & left(strSpace,1) & strAddress & "<br />Town/City: " & left(strSpace,7) & strTown & "<br />County: " & left(strSpace,9) & strCounty & "<br />Post Code: " & left(strSpace,7) & strPost & "<br /></p></font>"
strSql="SELECT FISHERY, POSTCODE FROM POSTCODES WHERE FISHERY='" & strFishery & "' AND POSTCODE='" & strPost & "'"
Set rsFish=my_Conn.Execute(strSql)
If not rsFish.EOF Then
rsFish.Close
Response.Clear
strErr = "[li]Already in database.[/li]"
Response.Write "<table align=""center"" width=""50%"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""black""><p><b><u>Duplicate Information</u></b></p><ul>" & strErr & "</ul>" & vbNewLine & _
" Go <a href=""javascript:history.go(-1)"";>back</a> to correct." & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
Set rsFish = Nothing
Response.End
Else
Set rsFish = Nothing
End If
strSql="INSERT INTO POSTCODES (FISHERY,STREET_ADDRESS,TOWN_CITY,COUNTY,POSTCODE) VALUES ('" & strFishery & "','" & strAddress & "','" & strTown & "','" & strCounty & "','" & strPost & "')"
my_Conn.Execute(strSql)
my_Conn.Close
Set my_Conn=Nothing
Response.Write "<p align=""center"">Complete</p>"
Response.End
End If
%>
<html>
<head>
<title>Address Submission</title>
</head>
<body>
<%
If strPass = "" Then
Response.Write "<form action=""address.asp"" method=""post"">" & vbNewLine & _
" <table align=""center"" width=""600px;"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <table align=""center"" width=""100%"" bgColor=""black"" border=""1"" style=""border-collapse:collapse;"" cellpadding=""4"" cellspacing=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>User: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""User"" value=""" & Request.Form("User") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Pass: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""password"" name=""Pass"" value="""" style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr height=""40px;"" valign=""bottom"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" width=""100%"">" & vbNewLine & _
" <input style=""color:maroon; font-weight:bold; padding:5px 10px 5px 10px; border:1px solid black; text-shadow:0px 1px 1px #000; text-decoration none; border-radius:25px; -moz-border-radius:25px; -webkit-border-radius:25px; background:lightgrey;"" type=""Submit"" name=""Submit"" value=""Submit"" />" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
Response.End
End If
Response.Write "<form action=""address.asp"" method=""post"">" & vbNewLine & _
" <input type=""hidden"" name=""sendme"" value=""doit"" />" & vbNewLine & _
" <table align=""center"" width=""600px;"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <table align=""center"" width=""100%"" bgColor=""black"" border=""1"" style=""border-collapse:collapse;"" cellpadding=""4"" cellspacing=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Fishery: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""fishery"" value=""" & Request.Form("fishery") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Street Address: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""street_address"" value=""" & Request.Form("street_address") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Town/City: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""town_city"" value=""" & Request.Form("town_city") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>County: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""county"" value=""" & Request.Form("county") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" bgColor=""lightblue"" width=""30%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy""><b>Post Code: </b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" bgColor=""lightblue"" width=""70%"">" & vbNewLine & _
" <font face=""times new roman"" size=""5"" color=""navy"">" & vbNewLine & _
" <input type=""text"" name=""postcode"" value=""" & Request.Form("postcode") & """ style=""text-align:center; width:95%; background-color:lightgrey; font-weight:bold; color:maroon;"" />" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr height=""40px;"" valign=""bottom"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" width=""100%"">" & vbNewLine & _
" <input style=""color:maroon; font-weight:bold; padding:5px 10px 5px 10px; border:1px solid black; text-shadow:0px 1px 1px #000; text-decoration none; border-radius:25px; -moz-border-radius:25px; -webkit-border-radius:25px; background:lightgrey;"" type=""Submit"" name=""Submit"" value=""Submit"" />" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
%>
</body>
</html>
strPass = sha256(Request.Form("Pass"))
strPass = Request.Form("Pass")