CodeAve.com CodeAve.com - ASP - Server Variables
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Framed Click Through
Many sites place a frame around an external link from their site. This enables a few things. Firstly, it allows you display a banner ad on a click from your site that you would not normally receive. Secondly, it allows for easy navigation back to your site if the site the person clicked to was not what the person was looking for. AskJeeves.com is an example (Click here) of a site that utilizes this method. The following example is comprised of three parts. 1. linkto.htm, which contains links to a few websites in the convention necessary for the framed click through to work. 2. frame-click.asp, which will track the page the link was clicked from (the referring page) and the requested and open a frameset and the link being requested. 3. frame-navigation.asp, which writes out a link for the referring page (or home page when none is detected) and a link to remove the frame to view the target link.
View the Output
Text View
Print View
Mail this Link
Download the Code

Frame-Click.asp
<% 
' Create a variable to note the referring page
previous_page=trim(request.servervariables("http_referer"))
' Create a variable for the url of the page the user is clicking to
url=trim(request.querystring("url"))
' If there is no referring page or no link to redirect to
' then send the user elsewhere. This can be another page stating
' that something was missing, here we'll just refer all bad requests to yahoo.com
if previous_page = "" or url ="" then 
response.redirect "http://www.yahoo.com"
end if
%>

<html>
<title>Link to <%= url %></title>

<frameset frameborder="0" framespacing="0" border="0" rows="90,*">


<!-- Navigation Frame with Banner and Logo 
Note that the referring url and the destination url are passed to the frame
page via querstring --> 
<frame 
src="frame-navigation.asp?url=<%= url %>&previous_page=<%= previous_page %>
name="navigation" 
marginwidth="0" 
marginheight="0" 
scrolling="no" 
noresize 
bordercolor="#ffffff">

<!-- Content Frame --> 
<frame 
src="<%= url %>
name="contentframe" 
bordercolor="#FFFFFF">

<!-- No Frames --> 
<noframes>
<body bgcolor="#ffffff">

Your browser does not support frames<br>
Please click <a href="<%= url %>">here</a> to continue to <br>
<%= url %>
</body>
</noframes>

</frameset>
</html>

Frame-Navigation.asp
<%
' Create a variable for the url being requested
url=request.querystring("url") 
' Create a varible for the page the user clicked from
previous_page=request.querystring("previous_page") 
%>

<html>
<body bgcolor="#e8e8e8">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF">
<td width="200" valign="top" align="center">
<img src="images/glogo.gif">
</td>
<td width="*" valign="top" align="left">
<img src="images/468x60.gif" width="468" height="60">
</td>
</tr>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="550" valign="top" align="left">
<font size="2">
<% 
' Check to see if there is a referring page value
' if non is available write a link to your homepage
if previous_page <> "" then %>

<a href="<% response.write previous_page ' write the link to go back %>" target="_top"><b>Go Back</b></a>
<% else ' place a link to your homepage in place of a referrer when not available %>
<a href="http://codeave.com" target="_top"><b>CodeAve.com</b></a>
<% end if %>
</font>
</td>
<td width="*" valign="top" align="left">
<font size="2">
<a href="<% response.write url ' write the link to remove the frame %>" target="_top"><b>Remove Frame</b>
</font>
</td>
</tr>
</table>
</body>
</html>

Linkto.htm
<html>
<title>Link To</title>
<body bgcolor="#FFFFFF">
Click on any link to open the site<br>
within a frame with a logo and banner<br><br>

<a href="frame-click.asp?url=http://www.yahoo.com">Yahoo</a>
<br>
<a href="frame-click.asp?url=http://www.sas.com">SAS</a>
<br>
<a href="frame-click.asp?url=http://www.aspin.com">ASPin</a>
<br>
<a href="frame-click.asp?url=http://www.excite.com">Excite</a>
<br>
<a href="frame-click.asp?url=http://www.lycos.com">Lycos</a>
<br>
<a href="frame-click.asp?url=http://www.google.com">Google</a>
<br>
<a href="frame-click.asp?url=http://www.ballparks.com">Ballparks.com</a>
</body>
</html>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3