Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 30th, 2007, 05:48 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default string being chopped off when passed through url

Hi,

code:

for iCounter = 0 to iRowNumber
prod=myArray(0,iCounter)
response.write "<tr><td bgcolor=#808080><a href=prod_drill_down.asp?prod='" & prod & "'&count=" & e(iCounter) & "&str_no=" & str_no & ">" & myArray(0,iCounter) & "</a></td><td bgcolor=#808080>" & e(iCounter) & "</td></tr>"

Next

The code passing three variables to another page to drill down on product details.

The problem occurs when the string in the 'prod' variable is more than one word. The second word is not displayed and nor is the other two variables.

I believe I have got the ' in the right place.

Anyone know why more than one worded strings are being cut off?

Thanks in advance.

 
Old October 30th, 2007, 07:45 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You need to URLEncode the string and google knows the answer to that:
http://www.google.com/search?hl=en&q=asp+-+url+encode

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old October 30th, 2007, 08:43 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by dparsons
 You need to URLEncode the string and google knows the answer to that:
http://www.google.com/search?hl=en&q=asp+-+url+encode

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Thanks for tip but do you mind showing me how my url should look when the string is URLEncoded?

I have tried to find the answer on google but I am getting nowhere fast

 
Old October 30th, 2007, 08:47 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by ronny
 
Quote:
quote:Originally posted by dparsons
Quote:
 You need to URLEncode the string and google knows the answer to that:
http://www.google.com/search?hl=en&q=asp+-+url+encode

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Thanks for tip but do you mind showing me how my url should look when the string is URLEncoded?

I have tried to find the answer on google but I am getting nowhere fast

I spoke too soon - I have found the answer:

response.write "<tr><td bgcolor=#808080><a href=prod_drill_down.asp?prod='" & Server.URLEncode(prod) & "'&count=" & e(iCounter) & "&str_no=" & str_no & ")>" & myArray(0,iCounter) & "</a></td><td bgcolor=#808080>" & e(iCounter) & "</td></tr>"

Thanks

 
Old October 30th, 2007, 08:50 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

...that link i sent you should be all you need, seriously. The first page listed on that SERP was a link to this page:

http://www.w3schools.com/asp/met_urlencode.asp

I am not being offensive or disrespectfuly here but you say that you are getting no where fast when I all but gave you the code to URL Encode your string! I don't mind helping people but come on you need to be a little proactive in solving your problem.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old October 30th, 2007, 09:52 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by dparsons
 ...that link i sent you should be all you need, seriously. The first page listed on that SERP was a link to this page:

http://www.w3schools.com/asp/met_urlencode.asp

I am not being offensive or disrespectfuly here but you say that you are getting no where fast when I all but gave you the code to URL Encode your string! I don't mind helping people but come on you need to be a little proactive in solving your problem.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Chill out dude I already replied advising that I had found the answer!

Thanks for your time though :)

 
Old October 30th, 2007, 09:53 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You posted your answer while I was typing mine and I did not see it. anyway glad you figured it out.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========




Similar Threads
Thread Thread Starter Forum Replies Last Post
Text chopped from bottom leo_vinay Crystal Reports 1 August 4th, 2006 12:08 AM
Calling vbscript function(passed value string) manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 0 May 7th, 2006 11:50 PM
How grap the passed value in URL ? method ASP.NET 1.0 and 1.1 Basics 1 June 17th, 2005 08:05 AM
Query String not passed on from form submission thomas_v_a PHP Databases 5 May 24th, 2004 12:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.