session - Page returns blank when running the following PHP code(503) -
i running code that's supposed pull questionnaire database evaluation user valid session.
however, page returns blank incomplete page while running php code.
am missing here?
<?php session_start(); try { if(!isset($_session['logged-in'])) { header("location: ../index.php"); } } catch(exception $e) { } // php classes require_once("../classes/database.php"); require_once("../classes/questionnaire.php"); require_once("../classes/competency.php"); require_once("../classes/candidate.php"); require_once("../classes/participant.php"); require_once("../classes/progress.php"); require_once("../classes/user.php"); require_once("../classes/page.php"); // candidate details if($_session['usertype'] == 'candidate') // if user doing self evaluation { $candidatename = user::getname($_session['id']); $candidateusername = $_session['username']; // questionnaire object $q = new questionnaire(questionnaire::getquestionnairename($_session['id'])); } else if($_session['usertype'] == 'participant') // if user evaluating candidate { $candidatename = user::getname(participant::getcandidateid(null, $_session['id'])); $candidateusername = participant::getcandidate($_session['id']); // questionnaire object $q = new questionnaire(questionnaire::getquestionnairename(participant::getcandidateid(null, $_session['id']))); } $candidateid = user::getuid($candidateusername); // objects $page = new page('evaluation'); $user = new user($_session['username']); // page height $pagename = $page->name; $page->setheight(0, true, $q->numcompetencies()); ?>
this html has output
<!-- css --> <link rel="stylesheet" type="text/css" href="../css/screen.css" media="screen" /> <link rel="stylesheet" type="text/css" href="../css/ie.css" /> <link rel="stylesheet" type="text/css" href="../css/custom.css" /> <link rel="stylesheet" type="text/css" href="../css/evaluation.css" /> <link rel="stylesheet" type="text/css" href="../css/progress-bar.css" /> <link rel="stylesheet" type="text/css" href="../css/error.css" /> <!-- javascript --> <script type="text/javascript" language="javascript" src="../js/slide/help.js"></script> <script type="text/javascript" language="javascript" src="../js/jquery-1.7.1.min.js"></script> <script type="text/javascript" language="javascript" src="../js/slide/evaluation.js"></script> <script type="text/javascript" language="javascript" src="../js/slide/questionnaire.js"></script> <script type="text/javascript" language="javascript" src="../js/validation/validateevaluation.js"></script> <script type="text/javascript" language="javascript" src="../js/instructions.js"></script> </head> <body onload="viewcompetency('#st1')"> <!-- website --> <!-- banner --> <div class="banner"> <div class="container"> <!-- logo div --> <div class="span-5 logo"></div> <!-- menu div --> <!-- main menu --> </div> </div> <div class="topseparator"></div> <!-- page content --> <div class="container indexdesktop"> <?php include("../common/minidashboard.php"); ?> <!-- desktop content --> <div class="span-24" style="height: <?php print $page->height.'px'; ?>"> <!-- content modulebox --> <div class="modulebox-classy"> <div class="pageheading"><h3><span class="blue">redma 360 </span><span class="grey">evaluation</span></h3></div> <div class="contentwide"> <div class="iconswide" id="addcand"></div> <p>kindly give candid feedback person name appears below (candidate)</p> <!-- instructions --> <p> </p> <div class="instructions" id="instructionswidth-evaluation"> <div class="instructions-heading" onclick="showinstructions()"><div class="instructions-icon"></div>instructions</div> <div class="instructions-content" id="instructions-content"> <p>click <span class="italic">accordian menu</span> show competency want evaluate. give rating on drop-down select box according <span class="italic">scoring key</span> below. when have completed scoring <span class="italic">all</span> competencies in <span class="italic">questionnaire</span>, <span class="strong italic">done</span> button show. click <span class="strong italic">done</span> complete evaluation.</p> <p><h5 class="strong white">scoring key:</h5><ol><li>demonstrates <span class="strong italic">almost none</span> of behaviour</li><li>demonstrates <span class="strong italic">some</span> of behaviour</li><li>demonstrates <span class="strong italic">about half</span> of behaviour</li><li>demonstrates <span class="strong italic">majority</span> of behaviour</li><li>demonstrates behaviour <span class="strong italic">fully</span></li></ol></p> </div> </div> </div> <div class="contentwide" id="evaluationwidth"> <!-- display questionnaire --> <h3>welcome redma360 evaluation</h3> <h4 class="grey"><span class="blue">questionnaire:</span> <?php print questionnaire::getquestionnairename($user->username);?><br /> <?php print '<span class="blue">candidate:</span> '.strtoupper($candidatename); if($user->usertype == 'participant') // if user evaluating candidate { print '<br /><span class="blue">participant ('.participant::getparttype($user->username).'):</span> '.strtoupper($user->name); } ?> </h4> <!-- evaluation accordian --> <div class="evaluation-container"> <form action="evaluationaction.php" name="saveform" id="saveform" method="post" > <?php $competenciesevaluatedarr = questionnaire::displayevaluationcompetencies($q->getname(), user::getuid($candidateusername), $user->id); ?> <input type="hidden" name="savebutton" id="savebutton" /> </form> </div> <?php if($user->competenciesdone == $q->numcompetencies()) { ?> <div class="evaluationthankyou" id="evaluationthankyou">thank you!</div> <div class="evaluationsubmitbutton" id="evaluationsubmitbutton"> <form action="evaluationdone.php" name="doneform" method="post" > <input type="image" name="donebutton" src="../images/button-done-large.png" /> </form> </div> <?php } ?> </div> <!-- progress bar --> <div class="sidebar-progress" id="sideprogress-evaluation"> <div class="content" id="progress"> <!-- sidebar heading --> <div class="sidebar-subheading-color-blue" id="evaluation-sidebar-heading">see progress , number of competencies answered far below. </div> <!-- progress bar --> <div class="content"> <?php progress::getprogressbar(user::getnumgraded(user::getuid($_session['username'])), questionnaire::getnumcompetencies($q->getid())); ?> <p> </p> </div> <div class="modulebox-display"> <h4>competencies answered far</h4> <table class="competenciesevaluated"> <thead> <tr> <th>competency</th> </tr> </thead> <tbody> <?php foreach($competenciesevaluatedarr $arr) { print '<tr> <td>'.$arr.'</td> </tr>'; } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> <!-- footer --> <?php include("../common/footer.php"); ?> </body>
add exit(0), after header(....), may solve problem.
try { if(!isset($_session['logged-in'])) { header("location: ../index.php"); exit(0);//add line } } catch(exception $e) { }
Comments
Post a Comment