Reply
ASP Parameters
Old 05-07-2007, 08:28 PM ASP Parameters
Novice Talker

Posts: 12
Hi all.

I have a simple redirect page that I am using to redirect users. The problem is, this redirect adds a parameter (?from=Somewhere) to the url of the page the user is being redirected to. Now the problem occours when the page they are being redirected to already has a parameter in which case the end result looks something like this (?NewsID=44?from=WhereTheUserCameFrom). Is there any way to check and see if there is already a perameter in the redirect url and if so change the (?from=Somewhere to &from=Somewhere)?

Thanks.
MIDNIGHTBANDIT9 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-08-2007, 01:38 AM Re: ASP Parameters
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Code:
If InStr (Redirect_URL, "?") > 0 then
     Redirect_URL = Redirect_URL & "&from=WhereTheUserCameFrom"
else
     Redirect_URL = Redirect_URL & "?from=WhereTheUserCameFrom"
end if
Replace Redirect_URL as appropriate.

Last edited by ADAM Web Design : 05-08-2007 at 01:40 AM.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-08-2007, 06:24 PM Re: ASP Parameters
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
You could take a different approach and stick the URL in a session variable. That would solve this problem, and I'm not sure if you're concerned about search engines, but if you are, cleaner URLs are a good idea. Finally, session variables are stored on the server, which has a cost, but a trade-off is that they're much harder to manipulate. I don't know if this is a benefit in your situation or not, but it's worth considering...
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 05-14-2007, 02:23 PM Re: ASP Parameters
Experienced Talker

Posts: 42
hmmmmm :O
Vairo is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to ASP Parameters
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12766 seconds with 12 queries