Menu
Hi, I am trying to make a page with terms of my site. If you click yes you agree you have been granted access, if you click No it will do nothing. You will stay right on that page and nothing will happen.
How would I code this?
[code=php]<?php
if(!isset($_COOKIE['terms'])){
header('Location: http://'.$_SERVER['HTTP_HOST'].'/terms.php');
}
?>[/code]
[code=php]<?php
if(isset($_POST['submit']) or isset($_COOKIE['terms'])){
setcookie('terms', 'agree', time()+10000000, '/', '', 0);
header('Location: http://'.$_SERVER['HTTP_HOST'].'/');
}else{
echo <<<END
<form action="http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}" method="post">
Click to accept terms:
<input type="submit" name="submit" value="I accept them">
</form
END;
}
?>[/code]
[code=html]
<HTML>
<HEAD>
<TITLE>Terms of Use</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {font-family: Geneva, Arial, Helvetica, sans-serif}
.style2 {font-size: 14px}
-->
</style>
</HEAD>
<BODY BGCOLOR=#454C54 LEFTMARGIN=0 TOPMARGIN=0 rightmargin="0" bottommargin="0" MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('images/m1r.jpg','images/m2r.jpg','images/m3r.jpg','images/m4r.jpg','images/m5r.jpg','images/m6r.jpg')" style="overflow-x:hidden">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="27" background="images/back-up.jpg"><img src="images/spacer.gif" width="1" height="27"></td>
</tr>
<tr>
<td width="100%" height="100%" valign="top" align="center" background="images/back-right-up.jpg" style="background-repeat:repeat-x;background-position:top">
<table width="800" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47" height="100%" valign="top" background="images/back-left.jpg"><img src="images/left-up.jpg" width="47" height="8"></td>
<td WIDTH=706 height="100%" valign="top">
<table width="706" height="100%" bgcolor="#AEB5BF" border="0" cellspacing="0" cellpadding="0">
<tr>
<td WIDTH=706 height="194">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="706" height="194">
<param name="movie" value="flash/flashmenu.swf">
<param name="quality" value="high">
<embed src="flash/flashmenu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="706" height="194"></embed>
</object>
</td>
</tr>
<tr><td width="706" height="12"><img src="images/line-2.jpg" width="706" height="12"></td></tr>
<tr>
<td width="706" height="100" valign="top" align="center">
<table width="693" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="100%" valign="top">
<table width="257" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="10" valign="top" background="images/back-but-6.jpg" style="background-position:center;background-repeat:repeat-y">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-1.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-2.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-10.jpg" width="12" height="12"></td></tr></table></td></tr>
<tr>
<td width="100%" height="100%" valign="top">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="100%" background="images/k-3.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
<td width="100%" height="100%" valign="top" style="background-repeat:no-repeat;background-position:bottom">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><img src="images/terms.jpg" width="679" height="25"></td>
</tr>
<tr>
<td height="100%" style="padding:6px;padding-left:11px;padding-right:11px;padding-bottom:15px" valign="top">
<div align="center"><font face="arial" style="font-size:10px;color:#333333;line-height:16px"> <span class="style1">By agreeing to these terms, you understand Spektron Entertainment Group will not be held liable for problems related to the downloads. All songs and photos are rated for use of all ages. All files are tested and virus scaned before they are loaded to the servers.</span><br>
<br>
<strong><span class="style2">USE AT YOUR OWN RISK<br>
<br><?php
if(isset($_POST['submit']) or isset($_COOKIE['terms'])){
setcookie('terms', 'agree', time()+10000000, '/', '', 0);
header('Location: http://'.$_SERVER['HTTP_HOST'].'/');
}else{
echo <<<END
<form action="http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}" method="post">
Click to accept terms:
<input type="submit" name="submit" value="I accept them">
</form>
END;
}
?>
</span></strong> <br>
</font>
</div></td>
</tr>
</table>
</td>
<td width="12" height="100%" background="images/k-5.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-11.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-6.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-4.jpg" width="12" height="12"></td></tr></table></td></tr>
</table>
</td>
</tr>
</table>
</td>
<td width="1" height="100%"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="706" height="100%" align="center" bgcolor="#454C54" background="images/end.jpg" style="padding-top:23px;background-repeat:no-repeat;background-position:top" valign="top">
<?php include('footer.php'); ?></td>
</tr>
</table>
</td>
<td width="47" height="100%" valign="top" background="images/back-right.jpg"><img src="images/right-up.jpg" width="47" height="8"></td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>[/code]
[code=html]
<HTML>
<HEAD>
<TITLE>Terms of Use</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {font-family: Geneva, Arial, Helvetica, sans-serif}
.style2 {font-size: 14px}
-->
</style>
</HEAD>
<BODY BGCOLOR=#454C54 LEFTMARGIN=0 TOPMARGIN=0 rightmargin="0" bottommargin="0" MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('images/m1r.jpg','images/m2r.jpg','images/m3r.jpg','images/m4r.jpg','images/m5r.jpg','images/m6r.jpg')" style="overflow-x:hidden">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="27" background="images/back-up.jpg"><img src="images/spacer.gif" width="1" height="27"></td>
</tr>
<tr>
<td width="100%" height="100%" valign="top" align="center" background="images/back-right-up.jpg" style="background-repeat:repeat-x;background-position:top">
<table width="800" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47" height="100%" valign="top" background="images/back-left.jpg"><img src="images/left-up.jpg" width="47" height="8"></td>
<td WIDTH=706 height="100%" valign="top">
<table width="706" height="100%" bgcolor="#AEB5BF" border="0" cellspacing="0" cellpadding="0">
<tr>
<td WIDTH=706 height="194">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="706" height="194">
<param name="movie" value="flash/flashmenu.swf">
<param name="quality" value="high">
<embed src="flash/flashmenu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="706" height="194"></embed>
</object>
</td>
</tr>
<tr><td width="706" height="12"><img src="images/line-2.jpg" width="706" height="12"></td></tr>
<tr>
<td width="706" height="100" valign="top" align="center">
<table width="693" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="100%" valign="top">
<table width="257" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="10" valign="top" background="images/back-but-6.jpg" style="background-position:center;background-repeat:repeat-y">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-1.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-2.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-10.jpg" width="12" height="12"></td></tr></table></td></tr>
<tr>
<td width="100%" height="100%" valign="top">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="100%" background="images/k-3.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
<td width="100%" height="100%" valign="top" style="background-repeat:no-repeat;background-position:bottom">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><img src="images/terms.jpg" width="679" height="25"></td>
</tr>
<tr>
<td height="100%" style="padding:6px;padding-left:11px;padding-right:11px;padding-bottom:15px" valign="top">
<div align="center"><font face="arial" style="font-size:10px;color:#333333;line-height:16px"> <span class="style1">By agreeing to these terms, you understand Spektron Entertainment Group will not be held liable for problems related to the downloads. All songs and photos are rated for use of all ages. All files are tested and virus scaned before they are loaded to the servers.</span><br>
<br>
<strong><span class="style2">USE AT YOUR OWN RISK<br>
<br>
<?php
if(isset($_POST['submit']) or isset($_COOKIE['terms'])){
setcookie('terms', 'agree', time()+10000000, '/', '', 0);
header('Location: http://'.$_SERVER['HTTP_HOST'].'/');
}else{
echo <<<END
<form action="http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}" method="post">
Click to accept terms:
<input type="submit" name="submit" value="I accept them">
</form>
END;
}
?>
</span></strong> <br>
</font>
</div></td>
</tr>
</table>
</td>
<td width="12" height="100%" background="images/k-5.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-11.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-6.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-4.jpg" width="12" height="12"></td></tr></table></td></tr>
</table>
</td>
</tr>
</table>
</td>
<td width="1" height="100%"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="706" height="100%" align="center" bgcolor="#454C54" background="images/end.jpg" style="padding-top:23px;background-repeat:no-repeat;background-position:top" valign="top">
<?php include('footer.php'); ?></td>
</tr>
</table>
</td>
<td width="47" height="100%" valign="top" background="images/back-right.jpg"><img src="images/right-up.jpg" width="47" height="8"></td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>[/code]
[code=html]
<?php
if(!isset($_COOKIE['terms'])){
header('Location: http://'.$_SERVER['HTTP_HOST'].'/terms.php');
}
?>
<HTML>
<HEAD>
<TITLE>DJSM Downloads</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</HEAD>
<BODY BGCOLOR=#454C54 LEFTMARGIN=0 TOPMARGIN=0 rightmargin="0" bottommargin="0" MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('images/m1r.jpg','images/m2r.jpg','images/m3r.jpg','images/m4r.jpg','images/m5r.jpg','images/m6r.jpg')" style="overflow-x:hidden">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="27" background="images/back-up.jpg"><img src="images/spacer.gif" width="1" height="27"></td>
</tr>
<tr>
<td width="100%" height="100%" valign="top" align="center" background="images/back-right-up.jpg" style="background-repeat:repeat-x;background-position:top">
<table width="800" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47" height="100%" valign="top" background="images/back-left.jpg"><img src="images/left-up.jpg" width="47" height="8"></td>
<td WIDTH=706 height="100%" valign="top">
<table width="706" height="100%" bgcolor="#AEB5BF" border="0" cellspacing="0" cellpadding="0">
<tr>
<td WIDTH=706 height="194">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="706" height="194">
<param name="movie" value="flash/flashmenu.swf">
<param name="quality" value="high">
<embed src="flash/flashmenu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="706" height="194"></embed>
</object>
</td>
</tr>
<tr><td width="706" height="12"><img src="images/line-2.jpg" width="706" height="12"></td></tr>
<tr>
<td width="706" height="100" valign="top" align="center">
<table width="693" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="100%" valign="top">
<table width="257" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="10" valign="top" background="images/back-but-6.jpg" style="background-position:center;background-repeat:repeat-y">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-1.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-2.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-10.jpg" width="12" height="12"></td></tr></table></td></tr>
<tr>
<td width="100%" height="100%" valign="top">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="100%" background="images/k-3.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
<td width="100%" height="100%" valign="top" style="background-repeat:no-repeat;background-position:bottom">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><img src="images/4-but-6.jpg" width="679" height="25"></td>
</tr>
<tr>
<td height="100%" style="padding:6px;padding-left:11px;padding-right:11px;padding-bottom:15px" valign="top">
<font face="arial" style="font-size:10px;color:#333333;line-height:16px"> On this page you will be able to download some of Shawn's mixes. <br>
</font>
</td>
</tr>
</table>
</td>
<td width="12" height="100%" background="images/k-5.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-11.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-6.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-4.jpg" width="12" height="12"></td></tr></table></td></tr>
</table>
</td>
</tr>
</table>
</td>
<td width="1" height="100%"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="706" height="100%" align="center" bgcolor="#454C54" background="images/end.jpg" style="padding-top:23px;background-repeat:no-repeat;background-position:top" valign="top">
<?php include('footer.php'); ?></td>
</tr>
</table>
</td>
<td width="47" height="100%" valign="top" background="images/back-right.jpg"><img src="images/right-up.jpg" width="47" height="8"></td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>[/code]
[code=php]<?php ob_start(); ?>
<HTML>
<HEAD>
<TITLE>Terms of Use</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {font-family: Geneva, Arial, Helvetica, sans-serif}
.style2 {font-size: 14px}
-->
</style>
</HEAD>
<BODY BGCOLOR=#454C54 LEFTMARGIN=0 TOPMARGIN=0 rightmargin="0" bottommargin="0" MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('images/m1r.jpg','images/m2r.jpg','images/m3r.jpg','images/m4r.jpg','images/m5r.jpg','images/m6r.jpg')" style="overflow-x:hidden">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="27" background="images/back-up.jpg"><img src="images/spacer.gif" width="1" height="27"></td>
</tr>
<tr>
<td width="100%" height="100%" valign="top" align="center" background="images/back-right-up.jpg" style="background-repeat:repeat-x;background-position:top">
<table width="800" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47" height="100%" valign="top" background="images/back-left.jpg"><img src="images/left-up.jpg" width="47" height="8"></td>
<td WIDTH=706 height="100%" valign="top">
<table width="706" height="100%" bgcolor="#AEB5BF" border="0" cellspacing="0" cellpadding="0">
<tr>
<td WIDTH=706 height="194">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="706" height="194">
<param name="movie" value="flash/flashmenu.swf">
<param name="quality" value="high">
<embed src="flash/flashmenu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="706" height="194"></embed>
</object>
</td>
</tr>
<tr><td width="706" height="12"><img src="images/line-2.jpg" width="706" height="12"></td></tr>
<tr>
<td width="706" height="100" valign="top" align="center">
<table width="693" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="100%" valign="top">
<table width="257" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="10" valign="top" background="images/back-but-6.jpg" style="background-position:center;background-repeat:repeat-y">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-1.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-2.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-10.jpg" width="12" height="12"></td></tr></table></td></tr>
<tr>
<td width="100%" height="100%" valign="top">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="100%" background="images/k-3.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
<td width="100%" height="100%" valign="top" style="background-repeat:no-repeat;background-position:bottom">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><img src="images/terms.jpg" width="679" height="25"></td>
</tr>
<tr>
<td height="100%" style="padding:6px;padding-left:11px;padding-right:11px;padding-bottom:15px" valign="top">
<div align="center"><font face="arial" style="font-size:10px;color:#333333;line-height:16px"> <span class="style1">By agreeing to these terms, you understand Spektron Entertainment Group will not be held liable for problems related to the downloads. All songs and photos are rated for use of all ages. All files are tested and virus scaned before they are loaded to the servers.</span><br>
<br>
<strong><span class="style2">USE AT YOUR OWN RISK<br>
<br>
<?php
if(isset($_POST['submit']) or isset($_COOKIE['terms'])){
setcookie('terms', 'agree', time()+10000000, '/', '', 0);
header('Location: http://'.$_SERVER['HTTP_HOST'].'/');
}else{
echo <<<END
<form action="http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}" method="post">
Click to accept terms:
<input type="submit" name="submit" value="I accept them">
</form>
END;
}
?>
</span></strong> <br>
</font>
</div></td>
</tr>
</table>
</td>
<td width="12" height="100%" background="images/k-5.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-11.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-6.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-4.jpg" width="12" height="12"></td></tr></table></td></tr>
</table>
</td>
</tr>
</table>
</td>
<td width="1" height="100%"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="706" height="100%" align="center" bgcolor="#454C54" background="images/end.jpg" style="padding-top:23px;background-repeat:no-repeat;background-position:top" valign="top">
<?php include('footer.php'); ?></td>
</tr>
</table>
</td>
<td width="47" height="100%" valign="top" background="images/back-right.jpg"><img src="images/right-up.jpg" width="47" height="8"></td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>[/code]
[code=html]
<font face="tahoma" style="font-size:10px;color:#000000">
<a href="index.php" style="color:#000000;text-decoration:none">Home</a> :
<a href="biography.php" style="color:#000000;text-decoration:none">Biography</a> :
<a href="downloads.php" style="color:#000000;text-decoration:none">Downloads</a> :
<a href="gallary.php" style="color:#000000;text-decoration:none">Gallary</a> :
<a href="resume.php" style="color:#000000;text-decoration:none">Resume</a> :
<a href="booking.php" style="color:#000000;text-decoration:none">Booking Info</a> :
<a href="/forum" target="_blank" style="color:#000000;text-decoration:none">DJSM Forum</a> :
<a href="contact.php" style="color:#000000;text-decoration:none">Contact</a>
<div style=" color:#FFFFFF;padding-top:15px">© 2005 Spektron Entertainment Group</div> </font>[/code]
[code=php]
<?php
if(isset($_POST['submit']) or isset($_COOKIE['terms'])){
setcookie('terms', 'agree', time()+10000000, '/', '', 0);
header('Location: http://'.$_SERVER['HTTP_HOST'].'/');
}else{
echo <<<END
<form action="http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}" method="post">
Click to accept terms:
<input type="submit" name="submit" value="I accept them">
</form>
END;
}
?>
[/code]
[code=php]<?php ob_start();
if(isset($_POST['submit']) or isset($_COOKIE['terms'])){
setcookie('terms', 'agree', time()+10000000, '/', '', 0);
header('Location: downloads.php');
}
?>
<HTML>
<HEAD>
<TITLE>Terms of Use</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {font-family: Geneva, Arial, Helvetica, sans-serif}
.style2 {font-size: 14px}
-->
</style>
</HEAD>
<BODY BGCOLOR=#454C54 LEFTMARGIN=0 TOPMARGIN=0 rightmargin="0" bottommargin="0" MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('images/m1r.jpg','images/m2r.jpg','images/m3r.jpg','images/m4r.jpg','images/m5r.jpg','images/m6r.jpg')" style="overflow-x:hidden">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="27" background="images/back-up.jpg"><img src="images/spacer.gif" width="1" height="27"></td>
</tr>
<tr>
<td width="100%" height="100%" valign="top" align="center" background="images/back-right-up.jpg" style="background-repeat:repeat-x;background-position:top">
<table width="800" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47" height="100%" valign="top" background="images/back-left.jpg"><img src="images/left-up.jpg" width="47" height="8"></td>
<td WIDTH=706 height="100%" valign="top">
<table width="706" height="100%" bgcolor="#AEB5BF" border="0" cellspacing="0" cellpadding="0">
<tr>
<td WIDTH=706 height="194">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="706" height="194">
<param name="movie" value="flash/flashmenu.swf">
<param name="quality" value="high">
<embed src="flash/flashmenu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="706" height="194"></embed>
</object>
</td>
</tr>
<tr><td width="706" height="12"><img src="images/line-2.jpg" width="706" height="12"></td></tr>
<tr>
<td width="706" height="100" valign="top" align="center">
<table width="693" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="100%" valign="top">
<table width="257" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="10" valign="top" background="images/back-but-6.jpg" style="background-position:center;background-repeat:repeat-y">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-1.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-2.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-10.jpg" width="12" height="12"></td></tr></table></td></tr>
<tr>
<td width="100%" height="100%" valign="top">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="100%" background="images/k-3.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
<td width="100%" height="100%" valign="top" style="background-repeat:no-repeat;background-position:bottom">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><img src="images/terms.jpg" width="679" height="25"></td>
</tr>
<tr>
<td height="100%" style="padding:6px;padding-left:11px;padding-right:11px;padding-bottom:15px" valign="top">
<div align="center"><font face="arial" style="font-size:10px;color:#333333;line-height:16px"> <span class="style1">By agreeing to these terms, you understand Spektron Entertainment Group will not be held liable for problems related to the downloads. All songs and photos are rated for use of all ages. All files are tested and virus scaned before they are loaded to the servers.</span><br>
<br>
<strong><span class="style2">USE AT YOUR OWN RISK<br>
<br>
<?
echo <<<END
<form action="http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}" method="post">
Click to accept terms:
<input type="submit" name="submit" value="I accept them">
</form>
END;
?>
</span></strong> <br>
</font>
</div></td>
</tr>
</table>
</td>
<td width="12" height="100%" background="images/k-5.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-11.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-6.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-4.jpg" width="12" height="12"></td></tr></table></td></tr>
</table>
</td>
</tr>
</table>
</td>
<td width="1" height="100%"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="706" height="100%" align="center" bgcolor="#454C54" background="images/end.jpg" style="padding-top:23px;background-repeat:no-repeat;background-position:top" valign="top">
<?php include('footer.php'); ?></td>
</tr>
</table>
</td>
<td width="47" height="100%" valign="top" background="images/back-right.jpg"><img src="images/right-up.jpg" width="47" height="8"></td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>[/code]
::Edit:: To Bokeh's credit it's not his fault it is the way that the forum thing shows the code because I would have had the same problem posting that snippet if I hadn't preread it.[/QUOTE]
[code=php]
<?php ob_start();
if(isset($_POST['submit']) or isset($_COOKIE['terms'])){
setcookie('terms', 'agree', time()+10000000, '/', '', 0);
header('Location: downloads.php');
}
?>[/code]
[code=php]
<?
echo <<<END
<form action="http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}" method="post">
Click to accept terms:
<input type="submit" name="submit" value="I accept them">
</form>
END;
?> [/code]
Also, what I was referring to in a way is:At the beginning you said you wanted to protect your 'site' and that is what my script did. Then someone told you to modify the script so it forwarded people to downloads. I think what you really wanted was to protect individual pages.
If I go to the downloads.php page after I agree, I will be forwarded to the downloads.php page, ...[/QUOTE]
Again you have white space after the 'D'. With the heredoc syntax it is important this should not be the case.
I get Parse error: parse error, unexpected T_SL, expecting ',' or ';' in /home/djshawnm/public_html/terms.php on line 97
Line 97 contains: echo <<<END
Thanks guys[/QUOTE]
[code=php]<?php
ob_start();
$self = $_SERVER['PHP_SELF'];
if(!isset($_COOKIE[$self])){
require($_SERVER['DOCUMENT_ROOT'].'/terms.php');
terms();
}
?>[/code]
[code=php]<?php
function terms()
{
$self = $_SERVER['PHP_SELF'];
if(isset($_POST['agree_terms']) or isset($_COOKIE[$self])){
setcookie($self, 'I agree to the terms.', time()+10000000, '/', '', 0);
}else{
echo <<<_HTML_
<HTML>
<HEAD>
<TITLE>Terms of Use</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {font-family: Geneva, Arial, Helvetica, sans-serif}
.style2 {font-size: 14px}
-->
</style>
</HEAD>
<BODY BGCOLOR=#454C54 LEFTMARGIN=0 TOPMARGIN=0 rightmargin="0" bottommargin="0" MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('images/m1r.jpg','images/m2r.jpg','images/m3r.jpg','images/m4r.jpg','images/m5r.jpg','images/m6r.jpg')" style="overflow-x:hidden">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="27" background="images/back-up.jpg"><img src="images/spacer.gif" width="1" height="27"></td>
</tr>
<tr>
<td width="100%" height="100%" valign="top" align="center" background="images/back-right-up.jpg" style="background-repeat:repeat-x;background-position:top">
<table width="800" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47" height="100%" valign="top" background="images/back-left.jpg"><img src="images/left-up.jpg" width="47" height="8"></td>
<td WIDTH=706 height="100%" valign="top">
<table width="706" height="100%" bgcolor="#AEB5BF" border="0" cellspacing="0" cellpadding="0">
<tr>
<td WIDTH=706 height="194">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="706" height="194">
<param name="movie" value="flash/flashmenu.swf">
<param name="quality" value="high">
<embed src="flash/flashmenu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="706" height="194"></embed>
</object>
</td>
</tr>
<tr><td width="706" height="12"><img src="images/line-2.jpg" width="706" height="12"></td></tr>
<tr>
<td width="706" height="100" valign="top" align="center">
<table width="693" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="100%" valign="top">
<table width="257" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="257" height="10" valign="top" background="images/back-but-6.jpg" style="background-position:center;background-repeat:repeat-y">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-1.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-2.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-10.jpg" width="12" height="12"></td></tr></table></td></tr>
<tr>
<td width="100%" height="100%" valign="top">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="100%" background="images/k-3.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
<td width="100%" height="100%" valign="top" style="background-repeat:no-repeat;background-position:bottom">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><img src="images/terms.jpg" width="679" height="25"></td>
</tr>
<tr>
<td height="100%" style="padding:6px;padding-left:11px;padding-right:11px;padding-bottom:15px" valign="top">
<div align="center"><font face="arial" style="font-size:10px;color:#333333;line-height:16px"> <span class="style1">By agreeing to these terms, you understand Spektron Entertainment Group will not be held liable for problems related to the downloads. All songs and photos are rated for use of all ages. All files are tested and virus scaned before they are loaded to the servers.</span><br>
<br>
<strong><span class="style2">USE AT YOUR OWN RISK<br>
<br>
<form action="http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}" method="post">
Click to accept terms:
<input type="submit" name="agree_terms" value="I accept them">
</form>
</span></strong> <br>
</font>
</div></td>
</tr>
</table>
</td>
<td width="12" height="100%" background="images/k-5.jpg"><img src="images/spacer.gif" width="12" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr><td width="100%" height="12"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="12" height="12"><img src="images/k-11.jpg" width="12" height="12"></td><td width="100%" height="12" background="images/k-6.jpg"><img src="images/spacer.gif" width="1" height="1"></td><td width="12" height="12"><img src="images/k-4.jpg" width="12" height="12"></td></tr></table></td></tr>
</table>
</td>
</tr>
</table>
</td>
<td width="1" height="100%"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="706" height="100%" align="center" bgcolor="#454C54" background="images/end.jpg" style="padding-top:23px;background-repeat:no-repeat;background-position:top" valign="top">
<?php include('footer.php'); ?></td>
</tr>
</table>
</td>
<td width="47" height="100%" valign="top" background="images/back-right.jpg"><img src="images/right-up.jpg" width="47" height="8"></td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>
_HTML_;
exit();
}
}
?>[/code]
[code=php]$var = <<<EOD
text in here is normal i can do <a href="balh">balch</a> w/o backslasing
EOD;
//where as outside heredoc i'd have to do this
$var = "text in here is differant i have to backslash before a quote <a href="balh">balch</a>";[/code]
You can view more info 0.1.9 — BETA 5.19