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
Solved

Send text as query string

Posted on 2014-11-24
7
110 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
  • 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 52

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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 52

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

856 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