I have a working asp page that collects an entry and checks it with a database then shows the results.
I want to show an error message when nothing or a none matching entry is submitted.
Can anyone help?
Here the relevant code...
I want to show an error message when nothing or a none matching entry is submitted.
Can anyone help?
Here the relevant code...
Code:
<%
dim str_PhoneNumber, sql, rs
str_PhoneNumber = Request.Form("input")
If str_PhoneNumber <> "" Then
sql = "SELECT * FROM dbo.NUMBERS WHERE REPLACE([phone1], ' ', '') = REPLACE('" & str_PhoneNumber & "', ' ', '');"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn
do until rs.EOF
response.write("<table width='100%' cellspacing='0' cellpadding='2' border='0'>")
response.write("<tr>")
response.write("<td>" & "Number Inputted" & "</td>")
response.write("<td>" & "Alternative 1" & "</td>")
response.write("<td>" & "Alternative 2" & "</td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td>" & rs.fields("phone1") & "</td>")
response.write("<td>" & rs.fields("phone2") & "</td>")
response.write("<td>" & rs.fields("phone3") & "</td>")
response.write("</tr>")
response.write("</table>")
rs.MoveNext
loop
rs.close
conn.Close
set rs=Nothing
set conn=Nothing%>
<% end if %>