Salve, ho da fare una modifica ad una newsletter che ho finito da poco anche con il Vostro aiuto in post precendenti...
Siccome le aziende sono due devo poter dare la possbilità agli utenti di iscriversi ad una o l'latra ma non tutte e due...
Ho modificato il DB aggiungendo un campo "azienda", ho risolto per l'invio separato delle newsletter, ma non so come fare per risolvere quello dell'iscrizione...
Questo è il form che è presente nella pagina di iscrizione:
Codice PHP:
</div>
<span style="font-family:arial;font-size:12px;color:#000080;font-weight:bold">Enter your Email address below to subscribe to our Newsletter</span>
<form action="proccess.asp" method="post">
<input type="hidden" name="confirm" value="no" />
<table width="75%" align="center">
<tr>
<td align="center"><input type="text" name="email" size="20" /></td>
</tr>
<tr>
<td align="center"><input type="submit" value="Subscribe" /></td>
</tr>
</table>
</form>
La mia idea era quella di aggiungere un piccolo menù a tendina..... ma non so come intregarlo qui nel form....
Questa invece è la pagina di gestione gernerale delle iscrizioni, conferma e cancellazione...
Codice PHP:
Dim rsNews, strEmail, strConfirm, strSQL
strEmail = Trim(Request("email"))
strConfirm = Trim(Request("confirm"))
If strConfirm = "yes" Then 'confirm the subscription
Set rsNews = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM newsLetter WHERE email = '" & strEmail & "';"
rsNews.Open strSQL, objConn, adOpenForwardOnly, adLockOptimistic, adCmdText
rsNews("confirm") = strConfirm
rsNews.Update
Response.Write "<div align=""center"">
" & _
"<span style=""font-family:arial;font-size:12px;color:#000080;font-weight:bold;text-align:left"">" & _
"Success! " & rsNews("email") & " has been confirmed!" & _
"
Thank you for subscribing to the " & strSiteTitle & " newsletter
</span></div>"
rsNews.Close
Set rsNews = Nothing
ElseIf strConfirm = "no" Then 'New subscriber
Set rsNews = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM newsLetter WHERE email = '" & strEmail & "';"
rsNews.Open strSQL, objConn, adOpenForwardOnly, adLockOptimistic, adCmdText
If NOT rsNews.EOF Then
Response.Write "<div align=""center"">This email address is already subscribed!</div>"
rsNews.Close
set rsNews = Nothing
Else
strSQL = "INSERT INTO newsletter ([email],[Date],[confirm]) VALUES('" & strEmail & "','" & Now & "','" & strConfirm & "')"
objConn.Execute strSQL
Set rsNews = Server.CreateObject("ADODB.Recordset")
rsNews.Open "newsLetter", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
Response.Write "<div align=""center"">
" & _
"<span style=""font-family:arial;font-size:12px;color:#000080;font-weight:bold;text-align:left"">" & _
"An email has been sent to:
" & strEmail & "
" & _
"Confirm your subscription by following the instructions in the email" & _
"
Thank for subscribing to the " & strSiteTitle & " Newsletter</span></div>"
dim mailObj, cdoMessage, cdoConfig, addrList, strEmailMsg, subject
subject = strSiteTitle & " Newsletter confirmation"
'send email so subscriber can confirm
strEmailMsg = "Thank you for subscribing to the " & strSiteTitle & " Newsletter
" & _
"Please confirm your subscription by clicking on the link below.
" & _
"<a href=""http://" & strDomain & "/newsletter/proccess.asp?email=" & strEmail & "&confirm=yes"">" & _
"http://" & strDomain & "/newsletter/proccess.asp?email=" & strEmail & "&confirm=yes</a>
" & _
"You received this email because you submitted this email address to our mailing list.
" & _
"If you did not subscribe or wish to be removed from our list - click on the link below
" & _
"<a href=""http://" & strDomain & "/newsletter/proccess.asp?email=" & strEmail & "&cancel=yes"">" & _
"http://" & strDomain & "/newsletter/proccess.asp?email=" & strEmail & "&cancel=yes</a>
" & _
"Our Thanks
" & strSiteTitle
Ovviamente nel SELECT devo aggiungere il nuovo campo del DB, ma non so come passarglielo dalla pagina precedente...
Spero che qualcuno di voi mi possa dare una mano, io intanto continuo a fare prove...
Non conosco molto bene il linguaggio...
Grazie a tutti