|
<% @Language=VBScript %> <html> <head><title>TEAM COBALT :: Add News</title> <style> A {color:blue;text-decoration: none;} a:hover {color:#FFFFFF;} TD {FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: verdan} </style> </head> <% IF request.form("Flag")="OK" THEN Fr=request.form("From") Fr=Replace(Fr, "'", "''") Su=request.form("Subject") Su=Replace(Su, "'", "''") Co=request.form("Comment") Co=Replace(Co, "'", "''") Ti=FormatDateTime(Now)
'String1 Set objConn = Server.CreateObject("ADODB.Connection") strConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("*****.mdb") & ";User ID=*****; Password=*****;" objConn.Open(strConnection) SQLstmt = "INSERT INTO myowngb (fr,subject,comment,ti)" SQLstmt = SQLstmt & " VALUES (" SQLstmt = SQLstmt & "'" & Fr & "'," SQLstmt = SQLstmt & "'" & Su & "'," SQLstmt = SQLstmt & "'" & Co & "'," SQLstmt = SQLstmt & "'" & Ti & "'" SQLstmt = SQLstmt & ")"
set RS = objConn.Execute(SQLstmt) objConn.Close
Set RS = Nothing Set objConn = Nothing
response.write("<BR><CENTER>") response.write("Thank you!</CENTER><BR><BR>")
ELSE %> <center> <img src=" http://www.team-cobalt.com/images/headnews.jpg - http://www.team-cobalt.com/images/headnews.jpg "> <Body background=" http://www.team-cobalt.com/images/tcbg.jpg - http://www.team-cobalt.com/images/tcbg.jpg "> <form method="POST" action="signgb.asp"> <table border="1" width="500" bgcolor="lightblue" bordercolor=cyan cellpadding="0" cellspacing="1"> <tr> <td> <table border="0" width="500" bgcolor="skyblue" align="center"> <tr> <td width="25%" align="right" bordercolor="#663333"><b><font >Poster: </font></b> </td> <td width="75%"> <input type="text" name="From" size="25"> </td> </tr> <tr> <td width="25%" align="right"><b><font >Title: </font></b> </td> <td width="75%"> <input type="text" name="Subject" size="25"> </td> </tr> <tr> <td width="25%" align="right" valign="top"><b><font >News: </font></b> </td> <td width="75%"> <textarea name="Comment" cols=25 rows=5 WRAP=SOFT></textarea> </td> </tr> <tr> <td height="60" align="right" colspan="2"> <p align="center"> <input type="hidden" value="OK" name="Flag"> <input type="submit" value="Submit" name="submit"> <input type="reset" value="Reset" name="reset"> </td> </tr> </table> </td> </tr> </table> </form> <% END IF %> <CENTER> <table border="1" width="500" bgcolor="skyblue" bordercolor=cyan cellpadding="0" cellspacing="1"> <tr><td><a href="viewgb.asp"><center>View News</a> <b> ::: </b> <a href="signgb.asp">Add News</a> </CENTER>
</body> </html>
is there a an easy way to make an Authorization code for this.... like make a new <input type=text name=auth size=25> and then have a part of this script only allow the script to work if it has the right auth code?? please help me... this is a modded guestbook that i turned into a news thing... check it out at http://www.team-cobalt.com/news/viewgb.asp - www.team-cobalt.com/news/viewgb.asp
|