Solved

Send text as query string

Posted on 2014-11-24
7
103 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 32

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 32

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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/…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now