Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP-500 Error when posting

Status
Not open for further replies.

mattster

Programmer
Apr 26, 2007
15
US
Hi, on my forum system, I can't post messages that aren't REALLY short. I have no clue why... Can anyone give me a reason why it would be doing that?
 
i've narrowed the problem down to either my INSERT statement, or something with the database.
Here's my post source, can you guys see anything wrong with it?
============================================================
<%@ LANGUAGE=&quot;VBSCRIPT&quot; %>
<%
Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Conn.ConnectionString = &quot;DSN=mattfest&quot;
Conn.Mode = adModeReadWrite
Conn.Open &quot;mattfest&quot;, &quot;sa&quot;, &quot;&quot;

%>

<%
IF Request.Form(&quot;author&quot;) = &quot;&quot; OR Request.Form(&quot;email&quot;) = &quot;&quot; OR Request.Form(&quot;subject&quot;) = &quot;&quot; OR Request.Form(&quot;Message&quot;) = &quot;&quot; OR Request.Form(&quot;author&quot;) = &quot; &quot; OR Request.Form(&quot;subject&quot;) = &quot; &quot; THEN
%>

You left one or more fields blank. Please <a href=&quot;javascript:history.back(1)&quot;>go back</a> to the post form and fill it in completely.

<%
ELSE
%>

<%
Function Smile(string)
String = replace(String, &quot;:)&quot;, &quot;<img src=&quot;&quot;smile.gif&quot;&quot;>&quot;)
String = replace(String, &quot;:p&quot;, &quot;<img src=&quot;&quot;tongue.gif&quot;&quot;>&quot;)
String = replace(String, &quot;:(&quot;, &quot;<img src=&quot;&quot;sad.gif&quot;&quot;>&quot;)
String = replace(String, &quot;;)&quot;, &quot;<img src=&quot;&quot;wink.gif&quot;&quot;>&quot;)
String = replace(String, &quot;:mad:&quot;, &quot;<img src=&quot;&quot;angry.gif&quot;&quot;>&quot;)
String = replace(String, &quot;:D&quot;, &quot;<img src=&quot;&quot;grin.gif&quot;&quot;>&quot;)
String = replace(String, &quot;:O&quot;, &quot;<img src=&quot;&quot;shock.gif&quot;&quot;>&quot;)
String = replace(String, &quot;8)&quot;, &quot;<img src=&quot;&quot;pimp.gif&quot;&quot;>&quot;)
String = replace(String, &quot;&quot;, &quot;<b>&quot;)
String = replace(String, &quot;
&quot;, &quot;</b>&quot;)
String = replace(String, &quot;&quot;, &quot;<i>&quot;)
String = replace(String, &quot;
&quot;, &quot;</i>&quot;)
String = replace(String, &quot;&quot;, &quot;<u>&quot;)
String = replace(String, &quot;
&quot;, &quot;</u>&quot;)
String = replace(String, &quot;&quot;, &quot;<img src=&quot;&quot;&quot;)
String = replace(String, &quot;&quot;, &quot;&quot;&quot;>&quot;)
String = replace(String, &quot;[scroll]&quot;, &quot;<marquee>&quot;)
String = replace(String, &quot;[/scroll]&quot;, &quot;</marquee>&quot;)
String = replace(String, vbCrLf, &quot;<br>&quot;)
Smile = String
End function


Author = Server.HTMLEncode(Request.Form(&quot;author&quot;))
Email = Server.HTMLEncode(Request.Form(&quot;email&quot;))
Subject = Server.HTMLEncode(Request.Form(&quot;subject&quot;))
Message = Smile(Server.HTMLEncode(Request.Form(&quot;Message&quot;)))
IP = Request.ServerVariables(&quot;REMOTE_ADDR&quot;)
Original = Request.QueryString(&quot;original&quot;)
TopicID = Request.QueryString(&quot;topic&quot;)
theDate = NOW

'Cookies! mmmm
' Sets cookies for the post form
Response.Cookies(&quot;lith2k&quot;)(&quot;Author&quot;)= Request.Form(&quot;Author&quot;)
Response.Cookies(&quot;lith2k&quot;)(&quot;Email&quot;)= Request.Form(&quot;Email&quot;)
Response.Cookies(&quot;lith2k&quot;).Expires= dateAdd(&quot;d&quot;, 90, now)







%>



<%


sSQL = &quot;INSERT INTO Messages(ForumID, Author, Email, Date, Subject, Message, Original, IP) Values(&quot; & Request.QueryString(&quot;topic&quot;) & &quot;, '&quot; & Author & &quot;', '&quot; & Email & &quot;', '&quot; & theDate & &quot;', '&quot; & Subject & &quot;', '&quot; & Message & &quot;', &quot; & clng(Original) & &quot;, '&quot; & IP & &quot;')&quot;

Set RS = Conn.Execute(sSQL)

Conn.Close
Response.Redirect &quot;main.asp?topic=&quot; & TopicID


%>
<% end if %>
============================================================
the script is at btw, if anyone wants to check it out... thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top