Hi im having a proble with this code, please can someone help it says unexpected error on line 5, event = Replace(Server.HTMLEncode(Request.Form("event"))," '","''")
thanks in advance
here is my code can anyone see anything wrong with this? - <%
-
response.buffer = true
-
-
date = Replace(Server.HTMLEncode(Request.Form("date")),"'","''")
-
event = Replace(Server.HTMLEncode(Request.Form("event")),"'","''")
-
venue = Replace(Server.HTMLEncode(Request.Form("venue")),"'","''")
-
details = Request.Form("details")
-
details = Replace(details , "'", "''")
-
details = Replace(details, vbcrlf, "<br>")
-
-
if date = "" OR event = "" OR venue = "" OR details = "" then
-
Response.Redirect("post.asp?error=1")
-
end if
-
if instr(LCase(details), "<script") <> 0 then
-
Response.Redirect("post.asp?error=2")
-
end if
-
-
set conn = Server.CreateObject("ADODB.connection")
-
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
-
"Data Source=" & Server.MapPath("\upcoming Events\db\upcoming.mdb") & ";" & _
-
"Persist Security Info=False"
-
conn.Open(sConnection)
-
-
sqlstring = "INSERT INTO board ( date, event, venue, details ) " &_
-
"values ('" & date & "','" & event & "','" & venue & "','" & details & "')"
-
conn.Execute(sqlstring)
-
conn.Close
-
set conn = Nothing
-
Response.redirect "\upcoming events\defualt.asp"
-
%>
-
2 2650
Request.Form("") might have returned a Null or nothing value. Replace function will return an error if the string in the first argument is a null/nothing.
If it is possible that Request to a form will return nothing (eg, "event" doesn't exists in your form), it is good that you check the returned value first.
You may use "Is Nothing" or "IsNullOrEmpty" for that...
Request.Form("") might have returned a Null or nothing value. Replace function will return an error if the string in the first argument is a null/nothing.
If it is possible that Request to a form will return nothing (eg, "event" doesn't exists in your form), it is good that you check the returned value first.
You may use "Is Nothing" or "IsNullOrEmpty" for that...
Thanks for the help is working now silly mistake take care
Sign in to post your reply or Sign up for a free account.
Similar topics
by: |
last post by:
Some time ago I installed VC# 2003, made a small generic project, compile
with the allow unsafe flag and I get the error below:
"error CS1577: Assembly generation failed -- Unexpected exception...
|
by: Eric Anderson Vianet SAO |
last post by:
hello all
When i tried ´pg_dump -v -f dump.dmp dtbtransporte´ I got the error:
pg_dump: restoring data for table tbdmovimento
pg_dump: dumping out the contents of table tbdmovimento
...
|
by: Vijayakrishna Pondala |
last post by:
Hi,
We are using the following error randomly, when accessing a webservice
method/servlet hosted on JBoss application server:
The underlying connection was closed: An unexpected error occurred...
|
by: r.nikhilk |
last post by:
Hi,
Currently, we are porting C++ applications from 32 bit to 64 bit on AIX
platform. (The current version of AIX is 5.3 and xlC verison is 8.0).
We are able to compile the applications by...
|
by: Jim Michaels |
last post by:
C:\prj\quiz\withusers>php tareports.php
PHP Parse error: syntax error, unexpected T_ELSE in
C:\prj\quiz\withusers\tareports.php on line 205
this is the section of code.
if (isset($row4)) {...
|
by: MLH |
last post by:
Private Sub ButtonP_Click()
On Error GoTo Err_ButtonP_Click
Dim ThisForm As String
ThisForm = Me.Name
Exit_ButtonP_Click:
Exit Sub
Err_ButtonP_Click:
Dim r As String, k As String, Message3...
|
by: Wescotte |
last post by:
The error message Parse error: syntax error, unexpected $end in FILE on
line X is one I run into frequently and I know the cause is I missed an
ending quote.
Is there an easy way to determine...
|
by: soidariti |
last post by:
database error - parse error, unexpected $, expecting kEND
AddUserAuthorisationToUsers.rb migration file
1. class AddUserAuthorisationToUsers < ActiveRecord::Migration
2. def self.up
...
|
by: Mrozik |
last post by:
Hi!
I have a problem - after deploying application in client
environment, on some client machines occured error.
Environment:
App server: ASP.NET WebService/Win 2003/ secured SSL (.NET 2.0)...
|
by: Jim Michaels |
last post by:
I have a 638 line glob of PHP code & HTML that won't run.
I get "PHP Parse error: syntax error, unexpected '}' in quiz\\quiz.php
on line 594".
I wrote a brace checker that checks perens, square...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |