Hey guy's, im kind of a very big beginner.. haha.. I followed this post here and i got everything working and running up to speed, What im wanting to know how, is HOW do i actually "include" the Php into my Protected area im wanting, I have a HTML Page, completly done i would just like to get it "protected" by this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script language="javascript">
var popupWindow = null;
function centeredPopup(url,winName,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
popupWindow = window.open(url,winName,settings)
}
</script>
<script language=JavaScript>
<!--
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// --> 
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.Profiles {
	font-size: 24px;
	color: #00F;
	background-color: #000;
	text-align: center;
}
#apDiv1 {
	position:absolute;
	width:101px;
	height:96px;
	z-index:1;
	left: 10px;
	top: 128px;
}
#apDiv2 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:2;
	left: 115px;
	top: 128px;
}
#apDiv3 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:3;
	left: 220px;
	top: 128px;
}
#apDiv4 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:4;
	left: 325px;
	top: 128px;
}
#apDiv5 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:5;
	left: 430px;
	top: 128px;
}
#apDiv6 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:6;
	left: 535px;
	top: 128px;
}
#apDiv7 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:7;
	left: 10px;
	top: 260px;
}
#apDiv8 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 640px;
	top: 128px;
}
#apDiv9 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:9;
	left: 115px;
	top: 260px;
}
#apDiv10 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:10;
	left: 220px;
	top: 260px;
}
#apDiv11 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:11;
	left: 325px;
	top: 260px;
}
#apDiv12 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:12;
	left: 430px;
	top: 260px;
}
#apDiv13 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 10px;
	top: 235px;
	font-size: 12px;
}
#apDiv14 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 115px;
	top: 235px;
	font-size: 12px;
}
#apDiv15 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 220px;
	top: 235px;
	font-size: 12px;
}
#apDiv16 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 325px;
	top: 235px;
	font-size: 12px;
}
#apDiv17 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 430px;
	top: 235px;
	font-size: 12px;
}
#apDiv18 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 535px;
	top: 235px;
	font-size: 12px;
}
#apDiv19 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 640px;
	top: 235px;
	font-size: 12px;
}
#apDiv20 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 745px;
	top: 235px;
	font-size: 12px;
}
#apDiv21 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 745px;
	top: 128px;
}
#apDiv22 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 10px;
	top: 365px;
	font-size: 12px;
}
#apDiv23 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 115px;
	top: 365px;
	font-size: 12px;
}
#apDiv24 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 220px;
	top: 365px;
	font-size: 12px;
}
#apDiv25 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 325px;
	top: 365px;
	font-size: 12px;
}
#apDiv26 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 430px;
	top: 365px;
	font-size: 12px;
}
#apDiv27 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:12;
	left: 535px;
	top: 260px;
}
#apDiv28 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 535px;
	top: 365px;
	font-size: 12px;
}
#apDiv29 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:12;
	left: 640px;
	top: 260px;
}
#apDiv30 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 640px;
	top: 365px;
	font-size: 12px;
}
#apDiv31 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 850px;
	top: 128px;
}
#apDiv32 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 955px;
	top: 128px;
}
#apDiv33 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 850px;
	top: 235px;
	font-size: 12px;
}
#apDiv34 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:13;
	left: 955px;
	top: 235px;
	font-size: 12px;
}
#apDiv35 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 745px;
	top: 260px;
}
#apDiv36 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 850px;
	top: 260px;
}
#apDiv37 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 955px;
	top: 260px;
}
#apDiv38 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 745px;
	top: 365px;
	font-size: 12px;
}
#apDiv39 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 850px;
	top: 365px;
	font-size: 12px;
}
#apDiv40 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 955px;
	top: 365px;
	font-size: 12px;
}
#apDiv41 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 10px;
	top: 390px;
}
#apDiv42 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 10px;
	top: 495px;
	font-size: 12px;
}
#apDiv43 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 115px;
	top: 390px;
}
#apDiv44 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 220px;
	top: 390px;
}
#apDiv45 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 325px;
	top: 390px;
}
#apDiv46 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 430px;
	top: 390px;
}
#apDiv47 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 535px;
	top: 390px;
}
#apDiv48 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 640px;
	top: 390px;
}
#apDiv49 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 745px;
	top: 390px;
}
#apDiv50 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 850px;
	top: 390px;
}
#apDiv51 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 955px;
	top: 390px;
}
#apDiv52 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 115px;
	top: 495px;
	font-size: 12px;
}
#apDiv53 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 220px;
	top: 495px;
	font-size: 12px;
}
#apDiv54 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 325px;
	top: 495px;
	font-size: 12px;
}
#apDiv55 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 430px;
	top: 495px;
	font-size: 12px;
}
#apDiv56 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 535px;
	top: 495px;
	font-size: 12px;
}
#apDiv57 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 640px;
	top: 495px;
	font-size: 12px;
}
#apDiv58 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 745px;
	top: 495px;
	font-size: 12px;
}
#apDiv59 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 850px;
	top: 495px;
	font-size: 12px;
}
#apDiv60 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 955px;
	top: 495px;
	font-size: 12px;
}
#apDiv61 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 10px;
	top: 520px;
}
#apDiv62 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 115px;
	top: 520px;
}
#apDiv63 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 220px;
	top: 520px;
}
#apDiv64 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 325px;
	top: 520px;
}
#apDiv65 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 430px;
	top: 520px;
}
#apDiv66 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 535px;
	top: 520px;
}
#apDiv67 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 640px;
	top: 520px;
}
#apDiv68 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 745px;
	top: 520px;
}
#apDiv69 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 850px;
	top: 520px;
}
#apDiv70 {
	position:absolute;
	width:100px;
	height:100px;
	z-index:8;
	left: 955px;
	top: 520px;
}
#apDiv71 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 10px;
	top: 625px;
	font-size: 12px;
}
#apDiv72 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 115px;
	top: 625px;
	font-size: 12px;
}
#apDiv73 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 220px;
	top: 625px;
	font-size: 12px;
}
#apDiv74 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 325px;
	top: 625px;
	font-size: 12px;
}
#apDiv75 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 430px;
	top: 625px;
	font-size: 12px;
}
#apDiv76 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 535px;
	top: 625px;
	font-size: 12px;
}
#apDiv77 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 640px;
	top: 625px;
	font-size: 12px;
}
#apDiv78 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 745px;
	top: 625px;
	font-size: 12px;
}
#apDiv79 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 850px;
	top: 625px;
	font-size: 12px;
}
#apDiv80 {
	position:absolute;
	width:100px;
	height:20px;
	z-index:14;
	left: 955px;
	top: 625px;
	font-size: 12px;
}
-->
</style>
</head>

<body class="Profiles">
<p>Temporary Profile Page</p>
<p>Click a Model's Picture for there BIO And More!</p>
<div id="apDiv1"><a href="Profiles/001.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/001/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv2"><a href="Profiles/002.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/002/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv3"><a href="Profiles/003.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/003/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv4"><a href="Profiles/004.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/004/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv5"><a href="Profiles/005.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/005/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv6"><a href="Profiles/007.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/007/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv7"><a href="Profiles/008.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/008/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv8"><a href="Profiles/006.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/006/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv9"><a href="Profiles/009.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/009/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv10"><a href="Profiles/010.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/010/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv11"><a href="Profiles/011.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/011/prothumb.jpg" width="100" height="100" /></a></div>
<div id="apDiv12"><a href="Profiles/012.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/012/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv21"><a href="Profile.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/000/prothumb1.jpg" width="100" height="100" /></a></div>
<div id="apDiv13">Southern Bell</div>
<div id="apDiv14">Mommy N Waiting</div>
<div id="apDiv15">School Days</div>
<div id="apDiv16">Sweet Sissy</div>
<div id="apDiv17">Hot Mama</div>
<div id="apDiv22">Country Boi</div>
<div id="apDiv18">Celestial</div>
<div id="apDiv19">Lil Dynamite</div>
<div id="apDiv20">Coming Soon</div>
<div id="apDiv23">Long N Lean</div>
<div id="apDiv24">Smooth Chocolate</div>
<div id="apDiv25">Hot Boi J</div>
<div id="apDiv26">Sunshine</div>
<div id="apDiv28">Lil' Bigg</div>
<div id="apDiv27"><a href="Profiles/013.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/013/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv29"><a href="Profiles/015.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/015/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv30">Black Majic</div>
<div id="apDiv31"><a href="Profile.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/000/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv32"><a href="Profile.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/000/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv33">Coming Soon</div>
<div id="apDiv34">Coming Soon</div>
<div id="apDiv35"><a href="Profiles/019.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/019/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv36"><a href="Profiles/018.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/018/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv37"><a href="Profiles/014.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/014/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv38">Shy Shadow</div>
<div id="apDiv39">Boi Luv</div>
<div id="apDiv40">Big Daddy</div>
<div id="apDiv41"><a href="Profiles/031.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/031/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv42">Bulldozer</div>
<div id="apDiv43"><a href="Profiles/030.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/030/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv44"><a href="Profiles/033.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/033/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv45"><a href="Profiles/026.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/026/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv46"><a href="Profiles/027.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/027/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv47"><a href="Profiles/032.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/032/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv48"><a href="Profiles/020.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/020/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv49"><a href="Profiles/021.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/021/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv50"><a href="Profiles/017.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/017/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv51"><a href="Profiles/028.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/028/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv52">Eastern Mystery</div>
<div id="apDiv53">Thick Luv</div>
<div id="apDiv54">Redneck Boi</div>
<div id="apDiv55">Rusty Nail</div>
<div id="apDiv56">Sweet Dew</div>
<div id="apDiv57">Honest Love</div>
<div id="apDiv58">Jazel</div>
<div id="apDiv59">Boi Toi</div>
<div id="apDiv60">Small Wonder</div>
<div id="apDiv61"><a href="Profiles/023.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/023/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv62"><a href="Profiles/025.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/025/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv63"><a href="Profiles/022.html"onclick="centeredPopup(this.href,'Sweet Temptation','1000','800','yes');return false"><img src="images/Models/022/prothumb1.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv64"><a href="Profile.html"><img src="images/Models/000/prothumb.jpg" width="100" height="100" /></a></div>
<div id="apDiv65"><a href="Profile.html"><img src="images/Models/000/prothumb.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv66"><a href="Profile.html"><img src="images/Models/000/prothumb.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv67"><a href="Profile.html"><img src="images/Models/000/prothumb.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv68"><a href="Profile.html"><img src="images/Models/000/prothumb.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv69"><a href="Profile.html"><img src="images/Models/000/prothumb.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv70"><a href="Profile.html"><img src="images/Models/000/prothumb.jpg" alt="" width="100" height="100" /></a></div>
<div id="apDiv71">Long Luv</div>
<div id="apDiv72">Marcello</div>
<div id="apDiv73">Long - N - Sleek</div>
<div id="apDiv74"></div>
<div id="apDiv75"></div>
<div id="apDiv76"></div>
<div id="apDiv77"></div>
<div id="apDiv78"></div>
<div id="apDiv79"></div>
<div id="apDiv80"></div>
</body>
</html>

I'm sort of at a standstill here as to where inside my code to place the

<?php include("members.php"); ?>

to make that page Protected.

Dani AI

Generated

A compact, practical checklist that fills the gaps in the thread and the reply from .

PHP must actually run for the page the visitor opens. Rename static files so the server parses them (for example, change .html profile pages to .php or configure the server to parse .html as PHP). Create one small authentication file that starts the session and enforces a login flag; include that file before any output is sent. Moving JavaScript/CSS into the head or external files (as suggested) both cleans the page and makes it easier to ensure the auth check runs first.

Example of the minimal auth check to include at the top of every protected script (gallery page and every popup/profile page):

<?php
// auth.php - include this at the very top of protected pages
session_start();

if (empty($_SESSION['user_id'])) {
    header('Location: /login.php');
    exit;
}
?>

Protecting image files and popups: a JavaScript popup is a fresh HTTP request, so the profile page it opens must run the same auth check. Static images referenced directly in HTML are not protected by the page-level PHP; to prevent direct access either (a) move images outside the web root and serve them through a PHP script that checks auth, (b) deny direct access via web server rules and serve via a secured script, or (c) use directory-level auth (.htaccess) if appropriate.

Troubleshooting notes: avoid any whitespace or BOM before PHP opening tags (causes "headers already sent"), confirm include paths (use absolute paths or DIR), verify session cookie domain/path if popups open on another subdomain, and test by accessing protected URLs while logged out to confirm redirects.

All you javascript and css should be between the <head> tags (well actually they should be in external files that you link to but that is another issue). The place your php include right at the top of the page before any of the HTML.

<?php include("members.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.