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 2652
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: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |