Parms In FP2002

J

Jim Buyens

Paste this script into the receiving page:

<script>
function qsobj (){
var qvbl;
var qstring = "" + document.location.search.substring(1);
if (qstring != ""){
var qpairs = qstring.split("&");
for (i=0; i < qpairs.length; i++) {
qvbl = qpairs.split("=");
this["" + qvbl[0]] = unescape(qvbl[1].replace
("+"," "));
}
}
}
function getqsvar(qsvar){
if (qstr[qsvar] == null){
return "";
}else{
return qstr[qsvar];
}
}
var qstr = new qsobj();
</script>

then, if you link to receivingpage.htm?
source=www.oursite.com/pagenameleavingfrom.html&site=www.th
eirsite.com/pagegoingto.html

<script>document.write('<a href="' +
getqsvar("sorurce") +
'">Stay here</a>');</script>

and

<script>document.write('<a href="' +
getqsvar("site") +
'">Go there</a>');</script>

should create the sites you want.

This is *much* cleaner in ASP or ASP.NET, BTW.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
G

Guest

Jim :
Thanks, ASP looks to be the cleanest way to accomplish
this. I'll go that route, but save your code for any
future work.
Thanks,
Jay
-----Original Message-----
Paste this script into the receiving page:

<script>
function qsobj (){
var qvbl;
var qstring = "" + document.location.search.substring(1);
if (qstring != ""){
var qpairs = qstring.split("&");
for (i=0; i < qpairs.length; i++) {
qvbl = qpairs.split("=");
this["" + qvbl[0]] = unescape(qvbl[1].replace
("+"," "));
}
}
}
function getqsvar(qsvar){
if (qstr[qsvar] == null){
return "";
}else{
return qstr[qsvar];
}
}
var qstr = new qsobj();
</script>

then, if you link to receivingpage.htm?
source=www.oursite.com/pagenameleavingfrom.html&site=www.t h
eirsite.com/pagegoingto.html

<script>document.write('<a href="' +
getqsvar("sorurce") +
'">Stay here</a>');</script>

and

<script>document.write('<a href="' +
getqsvar("site") +
'">Go there</a>');</script>

should create the sites you want.

This is *much* cleaner in ASP or ASP.NET, BTW.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
-----Original Message-----
I have an exit page set up on our site to prompt users if
they want to continue off to a 3rd party site or if they
want to stay on our site. I'd like to add 2 parms :

1) source=www.oursite.com/pagenameleavingfrom.html
2) site=www.theirsite.com/pagegoingto.html

I need to pass these values into the page. Is there a way
to do this ?

TIA
Jay
.
.
 
J

Jim Buyens

One nice thing about ASP is that you can get the URL of the referring page from:

Request.ServerVariables("HTTP_REFERER")

This saves you from having to code and send the "source" parameter.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------


Jim :
Thanks, ASP looks to be the cleanest way to accomplish
this. I'll go that route, but save your code for any
future work.
Thanks,
Jay
-----Original Message-----
Paste this script into the receiving page:

<script>
function qsobj (){
var qvbl;
var qstring = "" + document.location.search.substring(1);
if (qstring != ""){
var qpairs = qstring.split("&");
for (i=0; i < qpairs.length; i++) {
qvbl = qpairs.split("=");
this["" + qvbl[0]] = unescape(qvbl[1].replace
("+"," "));
}
}
}
function getqsvar(qsvar){
if (qstr[qsvar] == null){
return "";
}else{ return qstr[qsvar];
}
}
var qstr = new qsobj();
</script>

then, if you link to receivingpage.htm?
source=www.oursite.com/pagenameleavingfrom.html&site=www.t h
eirsite.com/pagegoingto.html

<script>document.write('<a href="' +
getqsvar("sorurce") +
'">Stay here</a>');</script>

and

<script>document.write('<a href="' +
getqsvar("site") +
'">Go there</a>');</script>

should create the sites you want.

This is *much* cleaner in ASP or ASP.NET, BTW.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
-----Original Message-----
I have an exit page set up on our site to prompt users if
they want to continue off to a 3rd party site or if they
want to stay on our site. I'd like to add 2 parms :

1) source=www.oursite.com/pagenameleavingfrom.html
2) site=www.theirsite.com/pagegoingto.html

I need to pass these values into the page. Is there a way
to do this ?

TIA
Jay
.
.
 
Top