Pass a query string to an asp page from .html

C

c676228

Hi all,

we have a html page www.ourdomain.com/salesprogram/visitsales.html

Whenever an sales agent links to our program, we ask him/her to attach his/her
agent code to this program, say if his agent code is 32577. He can put the
link
on his site:www.ourdomain.com/salesprogram/visitsales.html?32577
The 32577 is our sales agent code, it defines where the credit goes to.

When our program is upgraded, our program becomes

www.ourdomain.com/salesprogram/visit.asp

so I redirect this program
www.ourdomain.com/salesprogram/visitsales.html?32577
to www.ourdomain.com/salesprogram/visit.asp using javascript.
But I want to know how to attach the 32577 to the new link directly, so the
agent will still get the credit if he/she forgot to update the sale link.
Otherwise we could be in trouble.

Thanks,

Betty
 
T

Thomas Sun [MSFT]

Hi Betty,

From your description, my understanding is that you have an html website
and the sale agent can directly access it by adding the agent code follow
URL and using "?" as delimiter. Now, you want to upgrade this html website
to Classic ASP website, and you want the new website can be access using
new URL and the old URL. If I have misunderstood you, please feel free to
let me know.

It is better that the sale agent can access this new website using old link.

For the sale agent that forgets to update the sale link, we can add an html
page as adapter to redirect him to new ASP page in the new website. We
also can add some information in this page to inform them the website is
upgraded.

For a simple example, we add an html page named "visitsales.htm", and use
JavaScript to retrieve agent code and redirect the sale agent to new page:
====================================
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>

<script type="text/javascript">
var time = null
var url = window.location.href;
var saleCode = url.split('?');
var newURL = null;
function move()
{
window.location = newURL;
}

function displayNotice()
{

if(saleCode[1])
{
newURL =
'www.ourdomain.com/salesprogram/visit.asp?'+saleCode[1];

}
else
{
newURL ='www.ourdomain.com/salesprogram/visit.asp';
}

var obj = document.getElementById('newURL');
obj.href = newURL;
obj.innerText = newURL;
}


</script>

</head>
<body onload="timer=setTimeout('move()',5000);displayNotice();">
<form >
The System has been upgraded, you'll automatically be redirected in 5
seconds or you can click the link below.
<br />
<a id="newURL"> </a>
</form>
</body>
</html>
=======================================

In the new ASP page "visit.asp", we can get the query string:
======================================
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>
<form>
Query string is: <%=Request.QueryString%>
</form>
</body>
</html>
====================================

I look forward to receiving your test results.


Best Regards,
Thomas Sun

Microsoft Online Partner Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

Thomas Sun [MSFT]

Hi Evertjan,

Thanks for your input. It is also good method to redirect sale agent to new
ASP page using HTTP 404 Not Found ASP page. In this case, the agent code
can be saved into Session directly.



Best Regards,
Thomas Sun

Microsoft Online Partner Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

Evertjan.

Dear Thomas,

Thomas Sun [MSFT] wrote on 01 apr 2009 in
microsoft.public.inetserver.asp.general:
Thanks for your input. It is also good method to redirect sale agent
to new ASP page using HTTP 404 Not Found ASP page. In this case, the
agent code can be saved into Session directly.

Thanks for your response.

I also use this method to restrict access to certain .jpg and .pdf files,
where the redirect only is executed if a session variable is set by a login
previously, but in this case streaming the .jpg or .pdf is even more secure

btw, as this is usenet and not email,
could you please always quote the relevant part you are responding to?
And use the required --spacereturn to delimit your signature?
 
T

Thomas Sun [MSFT]

Hi Evertjan,

--------------------
Newsgroups: microsoft.public.inetserver.asp.general
Subject: Re: Pass a query string to an asp page from .html
From: "Evertjan." <[email protected]>

I also use this method to restrict access to certain .jpg and .pdf files,
where the redirect only is executed if a session variable is set by a login
previously, but in this case streaming the .jpg or .pdf is even more secure

btw, as this is usenet and not email,
could you please always quote the relevant part you are responding to?
And use the required --spacereturn to delimit your signature?

Thanks for your comment.

Quoting relevant part is helpful for user to understand response.

Best Regards,
Thomas Sun

Microsoft Online Partner Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

Evertjan.

Thomas Sun [MSFT] wrote on 02 apr 2009 in
microsoft.public.inetserver.asp.general:
Thanks for your comment.

Quoting relevant part is helpful for user to understand response.

I am sorry, Thomas, usenet groups are news GROUPS,
so you respond to the group, not only to the OP.

If you respond to a single user, please use email.

Usenet, being as it is, does not garantee threaded discussion,
as some postings could arrive in haphazard order,
or even not at all, at some news servers,
or the older posting could be deleted early by specific newsserver timeout.

That is why Usenet Netiquette prescribes quoting,
so that especially OTHER readers understand your posting.

This is also important, as all good newsreaders automagically strip the
signature in responses.
 
C

c676228

Thomas,

Thanks so much. I tested and it works fine in both IE and firefox.
Sorry for the late reply.

Sincerely
--
Betty


Thomas Sun said:
Hi Betty,

From your description, my understanding is that you have an html website
and the sale agent can directly access it by adding the agent code follow
URL and using "?" as delimiter. Now, you want to upgrade this html website
to Classic ASP website, and you want the new website can be access using
new URL and the old URL. If I have misunderstood you, please feel free to
let me know.

It is better that the sale agent can access this new website using old link.

For the sale agent that forgets to update the sale link, we can add an html
page as adapter to redirect him to new ASP page in the new website. We
also can add some information in this page to inform them the website is
upgraded.

For a simple example, we add an html page named "visitsales.htm", and use
JavaScript to retrieve agent code and redirect the sale agent to new page:
====================================
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>

<script type="text/javascript">
var time = null
var url = window.location.href;
var saleCode = url.split('?');
var newURL = null;
function move()
{
window.location = newURL;
}

function displayNotice()
{

if(saleCode[1])
{
newURL =
'www.ourdomain.com/salesprogram/visit.asp?'+saleCode[1];

}
else
{
newURL ='www.ourdomain.com/salesprogram/visit.asp';
}

var obj = document.getElementById('newURL');
obj.href = newURL;
obj.innerText = newURL;
}


</script>

</head>
<body onload="timer=setTimeout('move()',5000);displayNotice();">
<form >
The System has been upgraded, you'll automatically be redirected in 5
seconds or you can click the link below.
<br />
<a id="newURL"> </a>
</form>
</body>
</html>
=======================================

In the new ASP page "visit.asp", we can get the query string:
======================================
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>
<form>
Query string is: <%=Request.QueryString%>
</form>
</body>
</html>
====================================

I look forward to receiving your test results.


Best Regards,
Thomas Sun

Microsoft Online Partner Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

c676228

Evertjan,

Thanks for the suggested solution. I remember you helped my redirectiion
before.
This definitely is one of the solutions. I didn't even think about using
session variable to solve this problem.

Thanks,
--
Betty


Evertjan. said:
=?Utf-8?B?YzY3NjIyOA==?= wrote on 31 mrt 2009 in
microsoft.public.inetserver.asp.general:
we have a html page www.ourdomain.com/salesprogram/visitsales.html

Whenever an sales agent links to our program, we ask him/her to attach
his/her agent code to this program, say if his agent code is 32577. He
can put the link
on his site:www.ourdomain.com/salesprogram/visitsales.html?32577
The 32577 is our sales agent code, it defines where the credit goes
to.

When our program is upgraded, our program becomes

www.ourdomain.com/salesprogram/visit.asp

so I redirect this program
www.ourdomain.com/salesprogram/visitsales.html?32577
to www.ourdomain.com/salesprogram/visit.asp using javascript.
But I want to know how to attach the 32577 to the new link directly,
so the agent will still get the credit if he/she forgot to update the
sale link. Otherwise we could be in trouble.

First delete visitsales.html
Then I would make a 404.asp page [using vbs] having something like:

============================
qstr = lcase(Request.ServerVariables("QUERY_STRING"))
what="404;http://www.ourdomain.com/salesprogram/visitsales.html?"

if instr(lcase(qstr),what) = 1 then
session("agent") = mid(qstr,len(what))
server.transfer "/salesprogram/visit.asp"
end if

This is the 404 page, etc. ....
==========================

and in visit.asp:

===============================
agent = session("agent")
[do your stuff]
===============================

or:

you could activate asp for html extentions in IIS
 
T

Thomas Sun [MSFT]

Hi Betty,

Thanks for your response and I am glad that my reply can help you.

If you have any farther question, please feel free to post it here.

--
Best Regards,
Thomas Sun

Microsoft Online Partner Support


--------------------
Thomas,

Thanks so much. I tested and it works fine in both IE and firefox.
Sorry for the late reply.

Sincerely
--
Betty


Thomas Sun said:
Hi Betty,

From your description, my understanding is that you have an html website
and the sale agent can directly access it by adding the agent code follow
URL and using "?" as delimiter. Now, you want to upgrade this html website
to Classic ASP website, and you want the new website can be access using
new URL and the old URL. If I have misunderstood you, please feel free to
let me know.

It is better that the sale agent can access this new website using old link.

For the sale agent that forgets to update the sale link, we can add an html
page as adapter to redirect him to new ASP page in the new website. We
also can add some information in this page to inform them the website is
upgraded.

For a simple example, we add an html page named "visitsales.htm", and use
JavaScript to retrieve agent code and redirect the sale agent to new page:
====================================
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>

<script type="text/javascript">
var time = null
var url = window.location.href;
var saleCode = url.split('?');
var newURL = null;
function move()
{
window.location = newURL;
}

function displayNotice()
{

if(saleCode[1])
{
newURL =
'www.ourdomain.com/salesprogram/visit.asp?'+saleCode[1];

}
else
{
newURL ='www.ourdomain.com/salesprogram/visit.asp';
}

var obj = document.getElementById('newURL');
obj.href = newURL;
obj.innerText = newURL;
}


</script>

</head>
<body onload="timer=setTimeout('move()',5000);displayNotice();">
<form >
The System has been upgraded, you'll automatically be redirected in 5
seconds or you can click the link below.
<br />
<a id="newURL"> </a>
</form>
</body>
</html>
=======================================

In the new ASP page "visit.asp", we can get the query string:
======================================
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>
<form>
Query string is: <%=Request.QueryString%>
</form>
</body>
</html>
====================================

I look forward to receiving your test results.


Best Regards,
Thomas Sun

Microsoft Online Partner Support
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top