Billybonga
IS-IT--Management
I've only begun playing with SQL and ASP this week so any code I've written may be completly incorrect.
What I'm creating is an e-poll system where users of our Intranet register this votes. I am logging thier domain usernames to a table and wish to query this table when the submission form is loaded.
If the page detects that the user has already submitted a record i.e. if their name is already in the table - then it should re-direct them to an alternative page to prevent them re-submitting. If their name is not in the table then it will display the submission form etc.
Here is what I have
How do I finsih this e.g. if $username exists then response.redirect("Thank_You.htm")
Any help is appreciated.
What I'm creating is an e-poll system where users of our Intranet register this votes. I am logging thier domain usernames to a table and wish to query this table when the submission form is loaded.
If the page detects that the user has already submitted a record i.e. if their name is already in the table - then it should re-direct them to an alternative page to prevent them re-submitting. If their name is not in the table then it will display the submission form etc.
Here is what I have
Code:
<%
$username = request.servervariables("LOGON_USER")
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open "DSN=database1"
SQL_Query = "SELECT * from tbl_people WHERE Name '$username'"
%>
How do I finsih this e.g. if $username exists then response.redirect("Thank_You.htm")
Any help is appreciated.