Where to begin?<br><br>I have a login page using table1.userid, with a field called fldnews.<br>fldnews is a yes/no field. I need to always set this field to no when <br>a user logs in.<br><br>But, If "I" have it set to yes when a user logs in I'm wanting to <br>display a news.txt using asp and when the user closes the txt file <br>the script should redirect the user to searchform.asp after setting <br>fldnews back to no.<br><br>If a user logs in with the fldnews already set to no then redirect to <br>searchform.asp without the news.txt
1) First query to see if the user has the news flag set:<br><br>cmd.CommandText = "SELECT fldnews FROM tblusers WHERE Userid = '" & Session("log_in") & "'"<br><br>2) Is it set to True? or False?<br><br>Dim bRedirType<br>If rsCheckUser.Fields("fldnews") = True Then<br> bRedirType = 1<br>Else<br> bRedirType = 2<br>End if<br><br>3) Set the fldnews field to False or 'NO'<br><br>cmd.CommandText = "UPDATE tblusers SET fldnews = False WHERE Userid = '" & Session("log_in") & "' AND fldnews = True"<br><br>4) And lastly, redirect:<br><br>If bRedirType = 1 Then<br> Response.Redirect("news.asp")<br>Else<br> Response.Redirect("searchform.asp")<br>End If
Was this answer helpful ?
Yes No
Thanks but I already have it finished... <img border="0" src="/forum/emoticons/yeah.gif" height="25" width="19" alt="yeah" />
Was this answer helpful ?
Yes No
Yes, I know. But I wanted to put something in there in case someone was following this post.<br><br><br><br> <img border="0" src="/forum/emoticons/smilewinkgrin.gif" height="15" width="15" alt="smilewinkgrin" />
Was this answer helpful ?
Yes No