Office of Public Affairs UCSB
Department Links
Home
The Three Tiers
Graphic Identity
Browsers
Code Validation
Character Encoding
Screen Resolution
Title and Meta Tags
Using Email Aliases
Persistent Links To Global Resources
Third Level Domain Names
Policy Compliance
Web Accessibility
Web Standards Checklist (PDF)
About the Web Standards Group
Site Map
UCSB Home
Contact Us
gray ver 569
 
Add Privacy Notification to Your Web Site
 

UCSB Web sites that collect personal information from visitors must contain a formal privacy notification statement, and Web sites that collect general information are also encouraged to do so. For details of the guidelines governing privacy notification, including a definition of "personal information," see the UCSB Advisory on Privacy Notification.

The WSG recommends that all UCSB Web sites that collect information from visitors link to the Privacy Notification Statement developed and maintained by the Office of the Vice Chancellor, Administrative Services.

  1. Sites collecting personal information must display a statement (or a link to a statement) prominently on the page on which the information is requested, and it should be accessible to the individual to read prior to volunteering information about him/herself. The icon or link should contain the word "privacy."
  2. Sites collecting only general information may display the link on the footer of the site home page. The link should contain the word "privacy."


1. Link directly to the Privacy Notification Statement

To link directly to the official Privacy Notification Statement, add the following anchor tag to your HTML source code.
<a href="http://www.policy.ucsb.edu/privacy-notification/">Privacy</a>


2. Add the source document to your Web page using PHP,
    Perl, ASP, and .NET

Since the content is separate from the design, "including" the source document's content in your Web page allows you to customize its look and feel. The following examples show how to "include" the source document using PHP, Perl, ASP, and .NET.

2a. Sample use of PHP code to "include" a document in your Web site.

You can use the following code sample using PHP to include the source document into your Web page.
<?php readfile("http://www.policy.ucsb.edu/privacy-notification/content.html"); ?>



2b. Sample use of Perl code to "include" document into your Web site.

You can use the following code sample using Perl to "include" the source document into your Web page.
  1. Set the Library for WWW in Perl (LWP) to use the 'Simple' module.
  2. Store the data you want to scrape in a scalar variable which holds both strings and numbers interchangeably.
  3. Call the get or getprint function to display the URL document.
  4. Use an "include" with the perl script and paste it into the body portion of your HTML. This is one of several methods of displaying the document with Perl.

#!/usr/bin/perl

use LWP::Simple;

## store remote page in scalar variable

print "Content-type:text/html\n\n";

## or just get and print

getprint("http://www.policy.ucsb.edu/privacy-notification/content.html");

EXAMPLE:
<html>
<body>

<!--#include virtual="/cgi-restricted/privacy-notification.pl" -->

</body>
</html>




2c. Sample use of Classic ASP code to "include" document into your Web site.

Classic ASP on IIS 4.0 and 5.0 does not allow you to do includes from a remote Web server in the same way PHP does. To do a "screen scrape" with classic ASP, you need to use a third-party component that does the necessary HTTP spoofing, like SoftWing's free AspTear.

Once you download and install AspTear, you include code in your ASP page to do the following:
  1. Set AspTear constants and create the AspTear object.
  2. Call the Retrieve method, passing in the URL whose data you want to scrape, the action, and optional parameters.
  3. Write out the string that the method returns.
The sample code below is adapted from the 4 Guys From Rolla.com Web site.

<%
'AspTear constants
Const Request_POST = 1
Const Request_GET = 2

Set objTear = CreateObject("SOFTWING.ASPtear")
Response.ContentType = "text/html"

On Error Resume Next

Dim strRetval
' Parameters: URL, action, payload, username, password
strRetval = objTear.Retrieve("http://www.policy.ucsb.edu/privacy-notification/content.html", Request_GET, "", "", "")

' Error checking
If Err.Number <> 0 Then
    Response.Write "<b>"
     If Err.Number >= 400 Then
            Response.Write "Server returned error: " & Err.Number
     Else
            Response.Write "Component/WinInet error: " & Err.Description
     End If
     Response.Write "</b>"
     Response.End
End If

Response.Write strRetval
%>



2d. Sample use of ASP.Net code to "include" document into your Web site.

With ASP.Net, unlike classic ASP, you do not need to use a separate component to perform a screen scrape. Instead you can use the System.Net namespace's WebClient class to do the following:

  1. Create an instance of the WebClient class.
  2. Call the DownloadData method, passing in the URL whose data you want to scrape. A Byte array will be returned.
  3. Convert the Byte array to a string.

*Note: If your Web server is behind a proxy, the WebClient class won't work; instead, you will need to use the HttpWebRequest class.

The sample code below is adapted from the 4 Guys From Rolla.com Web site.

<%@ Import Namespace="System.Net" %>
<script language="VB" runat="server">
     Sub Page_Load(sender as Object, e as EventArgs)

             'Create a WebClient instance
             Dim objWebClient as New WebClient()

             'Set string constant to URL you want to scrape
             Const strURL as String = "http://www.policy.ucsb.edu/privacy-notification/content.html"

             'Create a UTF8Encoding instance for byte to string conversion
             Dim objUTF8 as New UTF8Encoding()

             'Call the DownloadData method and convert byte array to string
         lblHTMLOutput.Text = objUTF8.GetString(objWebClient.DownloadData(strURL))
    End Sub
</script>

<html>
<body>
     <h3>Screen Scrape of http://www.policy.ucsb.edu/privacy-notification/content.html
     </h3>
     <p>
     <asp:label id="lblHTMLOutput" runat="server" />
</body>
</html>


3. Customized Privacy Notification Statement

If your organization needs to modify the Privacy Notification Statement for a specific purpose, you should submit the modified version for approval to policy@ucsb.edu. If the Coordinator approves the modified content, the updated version can be used and a copy will be retained by Administrative Services.

UCSB RESOURCES
 
OFF-CAMPUS
RESOURCES
Web Accessibility
Resources