Forum Moderators: open
I need two simple ASP scripts.
1) A date function that adds 30 days to to the current date ( i will use it als a value in a dropdownlist...)
2) A script that compares the current date to a date i get from a recordset. If the dates are the same if should redirect the user to an URL.
Thanks for your help
GJ
mySQL has a DATE_ADD function which you can build right into the SQL statement.
VB has a dateadd() function which you can use on the script itself.
JavaScript doesn't have a native date add function, but I found a way to do it with a few lines of code.
<%
response.write "<select size='1' name='mydate'>" & chr(13)
For i = 0 to 30
thisdate = Date + i
response.write "<OPTION VALUE='" & thisdate & "'>" & formatdatetime(thisdate,1) & "</OPTION>" & chr(13)
Next
response.write "</select>" & chr(13)
%>
Except the comparison... whats wrong with this?
Thanks in advance
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT mem_id, mem_name, mem_email, mem_subsc, mem_start_date, mem_end_date FROM members WHERE mem_name = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
if Date() = FormatDateTime(mem_end_date,2) then Response.Redirect "http://www.webmasterworld.com"
%>
GJ
Except the comparison... whats wrong with this?
Thanks in advance
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT mem_id, mem_name, mem_email, mem_subsc, mem_start_date, mem_end_date FROM members WHERE mem_name = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
if Date() = FormatDateTime(mem_end_date,2) then Response.Redirect "http://www.webmasterworld.com"
%>
GJ