<?php session_name('StudentsRecords'); session_start(); //assign some session vars $url = $HTTP_HOST; $_SESSION['domain_name'] = $url; $_SESSION['student_id'] = 0; $_SESSION['user_id'] = 0; $_SESSION['user_name'] = 'unknown'; $_SESSION['user_category'] = 'unknown'; //get domain_id from domains table require_once ("mysql_connect.php"); $query = " select * from domains where domain_name = \"$url\" "; $result = @mysql_query($query); if ($result){ while ($row = mysql_fetch_array($result,MYSQL_ASSOC)){ $_SESSION['domain_id'] = $row['domain_id']; } //present the page, in this case a frameset which calls pages with SID echo ' <html> <frameset cols="*,1000,*"> <frame name="left" src="left.html"> <frameset rows="110,*"> //call logo page with SessionID. SID needs to be outside echo. <frame name="logo" src="logo.php?'.SID.'"> <frameset cols="240,*"> <frame name="menu" src="menu.php?'.SID.'"> <frame name="content" src="home.php?'.SID.'"> </frameset> </frameset> <frame name="right" src="right.html"> </frameset> </html> '; } else{ echo' <html> <body> <div >Alert: problem with permissions for: '.$domain_name.'</div> </body> </html> '; } mysql_close(); ?>