Thanks.
Code: Select all
<?php
session_start();
// tell us which page this us, defined by the array just below
$pagenum = $_GET['refpage'];
// set your page title here
$pagetitle[1] = 'Page 1';
$pagetitle[2] = 'Page 2';
$pagetitle[3] = 'Page 3';
$pagetitle[4] = 'Page 4';
$pagetitle[5] = 'Page 5';
// defined the page urls to refer
$referurl[1] = 'page1.html';
$referurl[2] = 'page2.html';
$referurl[3] = 'page3.html';
$referurl[4] = 'page4.html';
$referurl[5] = 'page5.html';
$thisurl = 'http://'.$_SERVER['HTTP_HOST'].ltrim($_SERVER['PHP_SELF'], '/');
$refurl = 'http://'.$_SERVER['HTTP_HOST'].'/'.$referurl[$pagenum];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<style type="text/css">
<!--
.fieldlabel {
width: 150px;
vertical-align: top;
}
.fieldinput {
width: 200px;
text-align: right;
vertical-align: top;
}
h1 {
font-size: 3em;
color: #FFCC00;
}
#container {
width: 50%;
margin: 0 auto;
text-align: left;
}
.footer {
background-color: #000;
padding: 0.5em;
}
.leightbox {
color: #333;
display: none;
position: absolute;
top: 25%;
left: 25%;
width: 50%;
height: 50%;
padding: 1em;
border: 1em solid #B8B8B8;
background-color: white;
text-align: left;
z-index:1001;
overflow: auto;
}
#overlay{
display:none;
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:1000;
background-color:#333;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}
.lightbox[id]{ /* IE6 and below Can't See This */ position:fixed; }#overlay[id]{ /* IE6 and below Can't See This */ position:fixed; }
-->
</style>
<script type="text/javascript" src="scripts/prototype.js"></script>
<script type="text/javascript" src="scripts/lightbox.js"></script>
</head>
<body>
<!-- BEGING CODE FOR REFER -->
<a href="#" rel="lightbox1" title="Refer <?=$pagetitle[1]?> to a friend!" class="lbOn">Refer <?=$pagetitle[1]?> to a friend!</a><br />
<a href="#" rel="lightbox2" title="Refer <?=$pagetitle[2]?> to a friend!" class="lbOn">Refer <?=$pagetitle[2]?> to a friend!</a><br />
<a href="#" rel="lightbox3" title="Refer <?=$pagetitle[3]?> to a friend!" class="lbOn">Refer <?=$pagetitle[3]?> to a friend!</a><br />
<a href="#" rel="lightbox4" title="Refer <?=$pagetitle[4]?> to a friend!" class="lbOn">Refer <?=$pagetitle[4]?> to a friend!</a><br />
<a href="#" rel="lightbox5" title="Refer <?=$pagetitle[5]?> to a friend!" class="lbOn">Refer <?=$pagetitle[5]?> to a friend!</a><br />
<?php
for($i=1;$i<=5;$i++)
{
?>
<div id="lightbox<?=$i?>" class="leightbox">
<form name="refer" id="refer" action="referproc.php" method="post" onsubmit="return validateOnSubmit()">
<fieldset id="refertofriend" style="width: auto;">
<legend>Refer <?=$pagetitle[$i]?> to a friend!</legend>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fieldlabel">Friend's name</td>
<td class="fieldinput"><input name="friendsname" type="text" value="" />
<br /><div id="errorfname"> </div></td>
</tr>
<tr>
<td class="fieldlabel">Friend's email</td>
<td class="fieldinput"><input name="friendsemail" type="text" value="" />
<br /><div id="errorfemail"> </div></td>
</tr>
<tr>
<td class="fieldlabel">Your name</td>
<td class="fieldinput"><input name="yourname" type="text" value="" />
<br /><div id="erroryname"> </div></td>
</tr>
<tr>
<td class="fieldlabel">Your email</td>
<td class="fieldinput"><input name="youremail" type="text" value="" />
<br /><div id="erroryemail"> </div></td>
</tr>
<tr>
<td class="fieldlabel">Message</td>
<td class="fieldinput"><textarea name="message" cols="30" rows="6" ></textarea>
<br /><div id="errormsg"> </div><br /></td>
</tr>
<tr>
<td class="fieldlabel">Copy to self?</td>
<td class="fieldinput"><input name="copy" type="checkbox" value="1" />
<br /><div id="erroryemail"> </div></td>
</tr>
<tr>
<td colspan="2" align="center"><br /><input type="submit" name="submit" value="submit" /></td>
</tr>
</table>
</fieldset>
<input type="hidden" name="pagename" value="<?=$pagetitle[$i]?>" />
<input type="hidden" name="refurl" value="<?php echo 'http://',$_SERVER['HTTP_HOST'],'/',$referurl[$i]; ?>" />
</form>
<p class="footer">
<a href="#" class="lbAction" rel="deactivate">Close</a>
</p>
</div>
<!-- END ERREFER CODE -->
<?php
} // end for statment
?></body>
</html>