Don't Escape "=" Or ";"
We use response.redirect to connect to an external web site which does not work when the "=" sign is translated to "%3B" and the ";" to "%3D". Is there a way to turn this default translation off?
View RepliesWe use response.redirect to connect to an external web site which does not work when the "=" sign is translated to "%3B" and the ";" to "%3D". Is there a way to turn this default translation off?
View Repliesi have a file *.num and when i enter the full URL to download it he give my
a 404 error !
but when i rename the *.NUM by *.TXT everything coming ok !?
so how i can tell to IIS6 to accept *.num files ?
Below is code to display in a drop down menu some addresses. There is two things i need to do. One is to not show if there are no records but also there could be duplicate records, How do i stop duplicates occuring...
View Replies View RelatedI dont have CDONTS support. i am using the following script. with this, even yahoo doesn't consider the email to be HTML and displays all the HTML tags and treats it as TEXT. here is the code i use! Please dont consider it abuse as i dont know how to encloase the code in TAGS!
<%
mes = ""
IsSuccess = false
sTo = Trim(Request.Form("txtTo"))
sFrom = Trim(Request.Form("txtFrom"))
sSubject = Trim(Request.Form("txtSubject"))
sMailServer = "127.0.0.1"
sBody = Trim(Request.Form("txtBody"))
if Request("__action")="TestEMail" then
TestEMail()
end if
Sub TestEMail()
Set objMail = Server.CreateObject("CDO.Message")
Set objConf = Server.CreateObject("CDO.Configuration")
Set objFields = objConf.Fields
With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = sMailServer
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
With objMail
Set .Configuration = objConf
.From = sFrom
.To = sTo
.Subject = sSubject
.TextBody = sBody
End With
Err.Clear
on error resume next
objMail.Send
if len(Err.Description) = 0 then
mes = " Message sent to " + sTo
mes = mes + " EMAIL SENT SUCCESSFULLY!"
IsSuccess = true
else
mes = " " + Err.Description + " TESTS FAILED!"
end if
Set objFields = Nothing
Set objConf = Nothing
Set objMail = Nothing
End sub
Sub Alert(html)
if IsSuccess then
Response.Write "<div class='testRelults' id='testSuccessful'><span class='testResult'>Success:</span>" & html & "</div>"
else
Response.Write "<div class='testRelults' id='testFailed'><span class='testResult'>Fail:</span>" & html & "</div>"
end if
End Sub
%>
am using a join query below to get multiple results from different related tables to form one. e.g
SELECT DISTINCT dbo.e_Wallet.subscriptions, dbo.e_Wallet.username, dbo.e_Wallet.status, dbo.e_Wallet.suspension, dbo.ewalletx_yr_registratn.email, dbo.ewalletx_yr_registratn.Fiscal_Yr, dbo.ewalletx_yr_registratn.end_date, dbo.e_walletpurse.purse
FROM dbo.e_Wallet INNER JOIN dbo.ewalletx_yr_registratn ON dbo.e_Wallet.registrationID = dbo.ewalletx_yr_registratn.registrationID AND dbo.e_Wallet.email = dbo.ewalletx_yr_registratn.email LEFT OUTER JOIN dbo.e_walletpurse ON dbo.e_Wallet.email = dbo.e_walletpurse.email AND dbo.e_Wallet.registrationID = dbo.e_walletpurse.regID
WHERE username = 'variable'
however it dosent seem to work or show any results on my asp page. What is wrong here ?
Im working on an automated email sending script which work real fine. I have to send 2 different list of email ( contact1 and contact2) of an acces database file (.mdb).
The fact is that my script work well but for some reason it only send the second list of email (contact2).
The script process the list contact1 without any error but obviously it isnt sending mail to those email.
It seems to be an easy fix mistake but i cant figure out why the first contact list isnt sending. Must be a "If then" mistake or something with the loop i think.
Heres the code: ......
I have a formview which im using to ammed records in a DB via a gridview. When an item is selected on the gridview its details are shown in the formview. Ive wrote the update statement for the Insert button in the formviews edit mode.
If i edit a record in the formview this updates the DB, but not the gridview striaght away. I have to click on one of the select buttons on the gridview to update this. I have gridview.databind() on the click event of the insert button of the formview and on pageload, if its a callback. Code:
I working on a ASP project (usually I'm a PHP guy) and I wanted to encode a string to make it safe for a SQL insert. Is there a function built into ASP for that or do I just need to replace single quotes?
View Replies View Relatedthe problem is in database the name of customer displays like
%mike O' lee but user want to see name like mike O lee.
How can i do it in asp script.
I'm having a problem finding/using an escape character with this ASP/JScript application I'm creating. Basically I have text sometimes that has apostrophes or double quotations in them, but they won't be INSERTED unless I manually take them out.
Ex: INSERT INTO tbl1 (vendor,reason) VALUES (81,"This is only a test, but there is an apostrophe and it's only going to make things worse.")
That apostrophe in "it's" is kiling everything. I've used the replace method to change it to " ' ", but that STILL doesn't work. I can't find MS SQL's ESCAPE CHARACTER. I've tried several directions of the backslash, but no luck.
I am trying to only have a link show if there is a certin value in the DB. This is what I am trying:
<% if (rsWelcome.Fields.Item("access_level").Value) = "admin" then
response.Write("| - <a href="sps_main.asp">Sales Training Support </a>-")
end if %>
BUT... this is the error I get:
Expected ')'
/sta/topnav_test.asp, line 9 response.Write("| - <a href="sps_main.asp">Sales Training Support </a>-") How do I use quotes in a "response" and have the app server ignore them??
I've a problem reading querystring parameters that are 'uri encoded'. Anyone
has a solution for this?
To reproduce the problem, create a classic ASP containing the following code:
-----------------------
<p>Value sent via querystring: <%=
Server.HTMLEncode(Request.QueryString("value")) %></p>
<input id="input" />
<button id="submit" onclick="window.location.assign('Test.asp?value=' +
encodeURIComponent(input.value));">submit</button>
-----------------------
Now, enter the value "Dré" and submit. The page will show the value "Dré",
but I except Request.QueryString("value") to return the original value, i.e.
"Dré".
I'm still having trouble getting some of my data being returned properly when people use quotes. (ex ProjectName contents being - the "primary" project - The double quotes are the main issue. I am using a function for the single quote and it seems to have resolved the issue.
Code:
Term = trim (Term)
if Term <> "" then
Term = Replace (Term, chr (39), chr (39) & chr (39))
end if
If Term <> "" then
I use this just when passing strings from a form. I tried altering it and using chr (34) for a double quote but it didn't work.
Is it possible to escape asp tags so i can add em to another variable like this:
text = "<% downloads="&cats&" %>"
When chucking data in cookie you cannot use certain characters in this example ‘ : ‘ . To get around this you use escape and unescape. Trying to use the escape as such:
Response.Cookies("Lines")("URL4") = escape("http://www.ASP101.com")
Gives the following result:
URL4=http%3A//www.ASP101.com
Which I don't think does anything to help. So using it like this:
Response.Cookies("Lines")("URL4") = "escape(http://www.ASP101.com)"
Gives the following result:
URL4=escape(http://www.ASP101.com)
Which is the correct result apart from the ‘escape' actually appearing.
im tryin to do this:
response.write("<body topmargin='0' leftmargin='0' onLoad='window.resize('" & width & "', '" & height & "')'>")
i need to run it like this though:
response.write("<body topmargin='0' leftmargin='0' onLoad="window.resize('" & width & "', '" & height & "')">")
in php i can replace it like onLoad = "window.resize
is there something like that in asp?
is escape char in asp script and how we can encode the url in asp script?
View Replies View RelatedI've been looking for it for a while. I found it a week back by accident, but didn't need to use it then. It's a function that escapes SQL strings so that if there is a ' in the string it will escape it for you. I can remeber the name of it.
View Replies View RelatedHere's the line I need to insert into an ASP page.
<script Language="JavaScript" src="/blarg.js"></script></head>
Right now it throws off the asp include with the quotes.
Info
DB: Oracle(9i), where I generate query strings programatically and send them to the DB server.
I have rtfm'd and googled this extensively, but I have not found how to properly esacape the ampersand character in an oracle query (I'm NOT using the SQL+ command line interface).
Oracle uses the & character to denote a variable substitution, and unfortunately one of the fields I must query has data that contains the & character. I need to know how to escape the & character in my query strings so that Oracle will treat it as a string literal. Code:
I have a 'memo' form field being entered into an access database.If people put in characters other then text (Quotes, operators, etc) then I get an insert error:
----
User Input: oh let's see - a va
Error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''oh let's see - a va', 'No additional comments submitted')'.
----
Is there a way to get this into the database? In php, I would simply use the function 'addslashes()' (escaping the string) - is there a similar function in ASP or am I doing something else wrong?
I am inserting records into an Access table using the OleDbCommand class. The insert values come from a basic web form with text boxes. If the values contain ' or " it creates a problem. What is the proper way to escape these characters? Surely there's a built-in function for it somewhere.
View Replies View Relatedi need to convert the escape values which are by mistake updated in DB.
example:
this is a sample text string
is updated in DB as
this%20is%20a%20sample%20text%20string
here %20 is the space.
like wise there are many entries for :,'
is there way that i can update all this in a update statement?
or use asp to to update the records?