473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

replace query string with post method

I try to replace the following STATEMENT ONE with STATEMENT TWO. But it
doesn't work. How to make it work??? Thanks.

STATEMENT ONE:
<td colspan="10" align="center"><a
href="ExcelExport.asp?noIncludes=yes&sqlStr=<%=rep lace(Server.URLEncode(
strSQl),"'","`")%>"><img src='images/excel.gif' border='0' alt='Export
to Excel'></a></td>

STATEMENT TWO:
<FORM NAME='formname' METHOD=POST ACTION='ExcelExport.asp'
<INPUT TYPE='Hidden' NAME='strSQL' VALUE='" &
replace(Server.URLEncode(strSQl) & "'>
<tr><td BGCOLOR=E4E4E4 ID='bodytext' COLSPAN='8' align='center'><input
TYPE=SUBMIT value='export'></td></tr>
</form>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
1 5097
What "doesn't work" about it? Do you get an error?
You have all kinds of syntax issues there. Is this in a response.write?
Where are the quotes? What's going on here?
Try:
%>

<FORM NAME="formname" METHOD="POST" ACTION="ExcelExport.asp">
<INPUT TYPE="Hidden" NAME="strSQL"
VALUE="<%=replace(Server.URLEncode(strSQl), "'", "''")%>">
BUT, what are you doing here? Why are you putting SQL in a form input? I
could go create a form like this and post it to your site:

<form action="http://yoursite.com/excelexport.asp" method="post">
<input name="strSQL" value="DROP TABLE
TheNameOfTheTableThatISawInAViewSSource">

Ray at work

"eddie wang" <ew***@kmg.com> wrote in message
news:Oq****************@TK2MSFTNGP09.phx.gbl...
I try to replace the following STATEMENT ONE with STATEMENT TWO. But it
doesn't work. How to make it work??? Thanks.

STATEMENT ONE:
<td colspan="10" align="center"><a
href="ExcelExport.asp?noIncludes=yes&sqlStr=<%=rep lace(Server.URLEncode(
strSQl),"'","`")%>"><img src='images/excel.gif' border='0' alt='Export
to Excel'></a></td>

STATEMENT TWO:
<FORM NAME='formname' METHOD=POST ACTION='ExcelExport.asp'
<INPUT TYPE='Hidden' NAME='strSQL' VALUE='" &
replace(Server.URLEncode(strSQl) & "'>
<tr><td BGCOLOR=E4E4E4 ID='bodytext' COLSPAN='8' align='center'><input
TYPE=SUBMIT value='export'></td></tr>
</form>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Barnes | last post by:
Does anyone know of a good way to use the JavaScript string.replace() method in an ASP form? Here is the scenario: I have a form that cannot accept apostrophes. I want to use the replace() so...
3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
12
by: Brian | last post by:
I want to use regxp to check that a form input contains at least 1 non-space charcter. I'd like to only run this if the browser supports it. For DOM stuff, I'd use if (documentGetElementById) {}...
8
by: skinnybloke | last post by:
Hi - I am a newbie to Access & SQL and I would appreciate some help on this if at all possible. I have a query that contains the following code. SELECT DISTINCT Product. AS , Product. AS ; ...
3
by: asd987 | last post by:
Hi, Can anyone tell me if "replace" is supported by Access 97? I use the Dutch version and get the errormessage "sub or function not supported". Or is the Professional Edition needed? Thanks.
2
by: José Joye | last post by:
Hello, I was wondering if there is a method that exists to replace multi-spaces within a string with single-space. eg: "12 3 4 56" --> "12 3 4 56" I think this could be done by...
9
by: Tony | last post by:
Win XP Pro - access 2002 - vs 2002 - vb Can someone tell me why this doesn't work? Dim MyString as string MyString = "Winner's" Mystring.replace("'", " ") I'm trying to remove any single...
6
by: JackpipE | last post by:
Here is my replace query and I need to run this on every column in my table. Right now I manually enter the column name (_LANGUAGES_SPOKEN) but this is time consuming and would like to automate...
2
by: =?Utf-8?B?TWFya19C?= | last post by:
I am trying to replace any occurance of minus-point "-." with minus-zero-point "-0." My regex: Regex repoint_num = new Regex(@"\-\."); My data: string xyz = "-.9"; My...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.