Solved

Send text as query string

Posted on 2014-11-24
7
114 Views
Last Modified: 2014-11-24
Is this possible?  ie: can I have a variable sSuppMsg that has the value "This is a test supplemental message." and attach it to an address as follows: "http://www.somesite.com/somepage.asp?supp_msg=" & sSuppMsg
0
Comment
Question by:Bob Schneider
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 333 total points
ID: 40462330
yes you can, it will be encoded automatically in the querystring when you send it over. just give it a try:

sSuppMsg = "This is a test supplemental message."
<a href="http://www.somesite.com/somepage.asp?supp_msg=" & sSuppMsg & ">link text</a>

and on somepage.asp:

Response.Write Request.QueryString("supp_msg")

if you have any special characters to worry about, you would use the Server.HTMLEncode function
0
 
LVL 53

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 167 total points
ID: 40462332
Like this?

sSuppMsg =  "This is a test supplemental message."

url = "http://www.somesite.com/somepage.asp?supp_msg=" & sSuppMsg

response.redirect url

Open in new window

0
 

Author Comment

by:Bob Schneider
ID: 40462548
Here is what I have now.  I am sending the page as html:

    Dim sSuppMsg
    sSuppMsg = Request.Form.Item("supp_msg_sample")
    sPageToSend = "http://www.ewebsite.com/misc/page.asp?event_id=" & lEventID & "&race_id=" & lRaceID & "&part_id=1&supp_msg=" & sSuppMsg

I have found that sending a page by html is kind of finicky and it works now so I don't really want to change it.  Does anything jump out with what I have here?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Assisted Solution

by:Big Monty
Big Monty earned 333 total points
ID: 40462554
everything looks good to me. the only thing you can change is

sSuppMsg = Request.Form.Item("supp_msg_sample")

to

sSuppMsg = Request.Form("supp_msg_sample")

other than that, what you have is correct.
0
 

Author Comment

by:Bob Schneider
ID: 40462614
Thanks folks.  User error...the "open this page in browser" link did not have the supplemental message query string.
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 40462622
>I have found that sending a page by html

Are you talking about sending a link via cdo mail where you are building your html on the fly?  That  can be tricky.   The key is to keep the html tight.   Render your html when you test it.  Make sure there are no white spaces as that will break your html.  

The 2 examples will probably break when sending as html email.  Notice the space between some> Some on the first line and the space after the quote on the 2nd somepage" > I have run into this myself
blah blah blah <a href="http://mysite.com/somepage"> Some page</a> blah blah
blah blah blah <a href="http://mysite.com/somepage" >Some page</a> blah blah

Open in new window

Should be
blah blah blah <a href="http://mysite.com/somepage">Some page</a> blah blah

Open in new window

0
 

Author Comment

by:Bob Schneider
ID: 40462946
Thanks a ton!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FileUp - Classic ASP 5 27
Index on a Table 6 35
edit .asp files 5 60
href return to normal window 5 43
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question