Understanding view - layout relationship - php

I would like to kindly ask you to help me understand how does the view part "see" the layout part in the zend framework.
In my way of thinking(and I'm thinking like a noob) there should be a root that directs the view (index.phtml) to the layout (designer.phtml) right?
Below is not my code, I'm just trying to make sense of it.
This is the view part of the code, the root of the file is /applications/xampp/xamppfiles/htdocs/mts/applications/modules/designer/views/scripts/index/ index.phtml
<div style="width:100%; margin-bottom:20px; margin-top:5px;">
<span style="padding-left:10px; font-size:18px;">Designer <img alt="(?)" src="/style/images/help-8.png"/></span>
</div>
<?= $this->leftmenu; ?>
<div id="picFrame" style="text-align: center"></div>
<div id="middle_admin_content">
<fieldset>
<legend id="bookTitleLegend">Please select a book first</legend>
<div id="fileBox"><div id="innerBox"></div></div>
<div id="uploadSuccess" class="statusBox" style="display: none; background-color: #D9F5CB"><span>File Uploaded Successfully</span></div>
<div id="uploadFailed" class="statusBox" style="display: none; background-color: #EBB9B9"><span>File Upload Failed</span></div>
<div id="aboutTheBook" style="display: none">
<form id="aboutTheBookForm" action="" method="post">
<textarea name="about_the_book" id="about_the_book" cols="60" rows="10"></textarea>
<input type="submit" value="Save Text" name="saveCoverText"/>
<input type="hidden" value="" name="bookid" id="bookidField"/>
</form>
</div>
</fieldset>
</div>
This is the layout part of the code, the root of the file is
/applications/xampp/xamppfiles/htdocs/mts/applications/layouts/scripts/designer.phtml
<?php echo $this->doctype() ?>
<html>
<head>
<title>InTech - Design</title>
<?php
echo $this->headTitle() . "\n";
echo $this->headMeta() . "\n";
?>
<?
echo $this->headStyle() . "\n";
echo $this->headLink() . "\n";
echo $this->headScript(). "\n";
?>
<?
/*
$jsContainer = $this->Minify_Container();
$jsContainer->appendFile('/js/jquery-1.4.2.min.js');
$jsContainer->appendFile('/js/jquery-ui-1.8.2.custom.min.js');
$jsContainer->appendFile('/js/jquery.autocomplete.js');
$jsContainer->appendFile('/js/jquery.bgiframe.min.js');
$jsContainer->appendFile('/js/jquery.idTabs.min.js');
$jsContainer->appendFile('/js/jquery/jquery.form.js');
$jsContainer->appendFile('/js/uploadify/jquery.uploadify.v2.1.4.min.js');
$jsContainer->appendFile('/js/designer/designer.js');
$jsContainer->appendFile('/js/scrollpane/jquery.jscrollpane.min.js');
$jsContainer->appendFile('/js/scrollpane/jquery.mousewheel.js');
echo $this->Minify($jsContainer, 'js');
$cssContainer = $this->Minify_Container();
$cssContainer->appendStylesheet('style/ui.all.css');
$cssContainer->appendStylesheet('js/jquery-ui-1.8.2.custom.css');
$cssContainer->appendStylesheet('style/site_css/designer_style.css');
$cssContainer->appendStylesheet('js/scrollpane/jquery.jscrollpane.css');
echo $this->Minify($this->headLink(), 'css');
echo $this->Minify($cssContainer, 'css');
*
*/
?>
<!-- MINIFIED ABOVE ------------------------->
<link rel="shortcut icon" href="/style/site_images/favicon.ico" type="image/x-icon" />
<link type="text/css" href="/style/ui.all.css" rel="stylesheet" />
<link type="text/css" href="/js/jquery-ui-1.8.2.custom.css" rel="stylesheet" />
<link type="text/css" href="/style/site_css/designer_style.css" rel="stylesheet" />
<link type="text/css" href="/js/scrollpane/jquery.jscrollpane.css" rel="stylesheet" />
<!--<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>-->
<script type="text/javascript" src="/assets/modules/manager/basic/js/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="/assets/modules/manager/basic/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.2.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="/js/jquery.bgiframe.min.js"></script>
<script type="text/javascript" src="/js/jquery.idTabs.min.js"></script>
<!--<script type="text/javascript" src="/js/jquery/jquery.form.js"></script>-->
<script type="text/javascript" src="/js/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript" src="/js/designer/designer.js"></script>
<script type="text/javascript" src="/js/scrollpane/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" src="/js/scrollpane/jquery.mousewheel.js"></script>
<!-- -->
</head>
<body>
<div id="dialog" style="display:none; font-size:12px; background-color:#ffffff;">
<div id="dialog_left" style="float:left; width:150px">
</div>
<div id="dialog_right">
</div>
</div>
<div id="dialogDelete" style="display: none">Delete Item?</div>
<!-- HEADER SITE AREA :: START -->
<div id="header">
<?php
$front = Zend_Controller_Front::getInstance();
$module = $front->getRequest()->getModuleName();
echo $this->render('header-designer.phtml', array(
'authenticated' => $this->authenticated
));
?>
</div>
<!-- HEADER SITE AREA :: END -->
<!-- CONTENT :: START -->
<div id="contentAdmin">
<div id="helpDialog" style="display: none"></div>
<?php echo $this->layout()->content ?>
</div>
<!-- CONTENT :: END -->
<!-- FOOTER SITE AREA :: START -->
<div id="footer">
<?php echo $this->render('footer.phtml', array(
'authenticated' => $this->authenticated
)) ?>
</div>
<!-- FOOTER SITE AREA :: START -->
</body>
</html>

The specific mechanics of how all this implemented involves bootstrapping application resources and registering late-running front-controller plugins.
But the short answer is the "system" knows how to find/render the view-script associated to the requested action and how to find/render your layout script with the view-script content injected.
Remember, at some point, you bootstrapped a Layout resource, probably in configs/application.ini.
You also bootstrapped a View resource - either explicitly or implicitly - which knows how to render your headTitle(), headMeta(), headScript(), etc (all rendered using view-helpers), as well as the layout.
So, there's really no mystery that the "system" is aware of all this stuff.

Related

CSS not reflecting for php page even though after linking between Head Tags

My CSS is not getting reflected on a PHP page. I am using Xampp server. The display.css file is in my htdocs folder only. Let me know where I am doing wrong.
<?php
Php Code
?>
<html>
</head>
<link rel="stylesheet" type="text/css" src="display.css" />
<title>E-Library Display Section</title>
</head>
<center><h1>Books Available for Free Download</h1></center>
<body>
<div class="wrapper">
<div class="table">
<div class="row header">
<div class="cell"><Book Name</div>
<div class="cell">Book Description</div>
<div class="cell">Book Author</div>
<div class="cell">Book Language</div>
<div class="cell">Download Link</div>
<div class="cell">Uploader Name</div>
<div class="cell">Uploader Email</div>
</div>
<tr>
<?php
while($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>".$row['bookname']."</td>";
echo "<td>".$row['bookdesc']."</td>";
echo "<td>".$row['bookauthor']."</td>";
?>
</body>
</html>
In your stylesheet link, change src to href.
<link rel="stylesheet" type="text/css" href="display.css" />
Also, you have two closed </head> tags and no open ones but that's not causing your problem.

how to load code using codemirror

I have a PHP file that involved with codemirror which works great, but I want each text area to load the code from other file using PHP like index.php, main.css, main.js, and show preview from all of those files to combines.
My question is that how can write that code inside of each text area to link another page! I have tried to put <?php include('css/main.css'); ?> statement inside of one of text area for css and is not working.
Please see see full codes..
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.19.0/codemirror.css"> <link rel="stylesheet" href="css/style.css">
<div id="wrap">
<!-- Code Editors --> <section id="code_editors">
<div id="html" class="code_box">
<h3>HTML</h3>
<textarea name="html"></textarea>
</div>
<div id="css" class="code_box">
<h3>CSS</h3>
<textarea name="css"></textarea>
</div>
<div id="js" class="code_box">
<h3>JavaScript</h3>
<textarea name="js"></textarea>
</div>
</section>
<!-- Sandboxing --> <section id="output">
<iframe></iframe> </section> </div>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.19.0/codemirror.js"></script>
<!-- For HTML/XML --> <script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.19.0/mode/xml/xml.js">/script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.19.0/mode/htmlmixed/htmlmixed.js"></script>
<!-- For CSS --> <script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.16.0/mode/css/css.js"></script>
<!-- For JS --> <script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.19.0/mode/javascript/javascript.js"></script> <script src="js/js.js"></script>
Many thanks.
What you are doing is trying to include the css file contents without link tag. Replace <link rel="stylesheet" type="text/css" href="css/main.css"> instead of <?php include('css/main.css'); ?>.

including a header with subfolder

I have some big problems including my header in subfolder. I have a folder structure like this:
[![Folder structure][1]][1]
I would like to include my header in the innovatian-project.php. As I see it, I have to go back three folders to get to the root:
AU -> Courses -> Document Root
I have tried with the following:
<?php include '../../../resources/includes/header.php'?>
<?php include(__DIR__.'/resources/includes/header.php'); ?>
<?php include($_SERVER['DOCUMENT_ROOT'].'/header.php'); ?>
<?php include($_SERVER['DOCUMENT_ROOT'].'/resources/includes/header.php'); ?>
<?php include('../../resources/includes/header.php'); ?>
But none of this is working. I have tried so many things, that I cannot even remember anymore. Does anybody have an idea on what I can do? The path to the innovation-project is here:
<?php include 'resources/includes/header.php' ?>
<body id="services">
<?php include 'resources/includes/navbar.php' ?>
<!-- start intro section -->
<section class="intro">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<div class="intro-content">
<h1>Mine kompetencer <strong>strongest </strong></h1>
<h2>areas, where I can add the most value to a company </h2>
Mine kompetencer er baseret på
</div>
</div>
</div>
</div>
</section>
<!-- end intro section -->
UPDATE
When I use the following code, the header, nav and footer is called. But the CSS is not called:
<?php include $_SERVER['DOCUMENT_ROOT'] . '/Portfolio_da/resources/includes/header.php' ?>
<body id="services">
<?php include $_SERVER['DOCUMENT_ROOT'] . '/Portfolio_da/resources/includes/navbar.php' ?>
<!-- start intro section -->
<section class="intro">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<div class="intro-content">
<h1>Mine kompetencer <strong>strongest </strong></h1>
<h2>areas, where I can add the most value to a company </h2>
Mine kompetencer er baseret på
</div>
</div>
</div>
</div>
</section>
<!-- end intro section -->
<?php include $_SERVER['DOCUMENT_ROOT'] . '/Portfolio_da/resources/includes/footer.php' ?>
UPDATE 2 WHERE I CALL THE CSS IN header.php
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Favicon -->
<link rel="shortcut icon" href="images/favicon.ico">
<!-- Stylesheets -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/owl.theme.css">
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="css/supersized.css">
<link rel="stylesheet" href="css/nivo-theme.css">
<link rel="stylesheet" href="css/nivo-lightbox.css">
<!-- Main Stylsheets -->
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/responsive.css">
<!-- Theme Color Stylesheet -->
<link rel="stylesheet" href="css/theme_color.css">
<!-- Google Font -->
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700' rel='stylesheet' type='text/css'>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<?php include_once("analyticstracking.php") ?>
</head>
<?php include($_SERVER['DOCUMENT_ROOT'].'/resources/includes/header.php'); ?>
See your php.ini about
allow_url_include
What is in your router file?
You have to go up 2 folders.
<?php include('../../resources/includes/header.php'); ?>
UPDATE
Change these lines in header.php: <link rel="stylesheet" href="css/bootstrap.min.css">
like <link rel="stylesheet" href="http://<?php echo $_SERVER['HTTP_HOST'] ?>/Portfolio_da/css/bootstrap.min.css">

Page returns blank when running the following PHP code(503)

I am running a code that's supposed to pull a questionnaire from a database for evaluation by a user with a valid session.
However, the page returns a blank incomplete page while running this php code.
Am I missing something 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 is doing a 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 is evaluating their 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 is the HTML has to be 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 very candid feedback to the person whose 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 the <span class="italic">Accordian Menu</span> to show the competency you want to evaluate. Give a rating on the drop-down select box according to the <span class="italic">Scoring Key</span> below. When you have completed scoring <span class="italic">ALL</span> competencies in the <span class="italic">Questionnaire</span>, a <span class="strong italic">Done</span> button will show. Click <span class="strong italic">Done</span> to complete your evaluation.</p>
<p><h5 class="strong white">SCORING KEY:</h5><ol><li>Demonstrates <span class="strong italic">almost none</span> of the behaviour</li><li>Demonstrates <span class="strong italic">some</span> of the behaviour</li><li>Demonstrates <span class="strong italic">about half</span> of the behaviour</li><li>Demonstrates <span class="strong italic">majority</span> of the behaviour</li><li>Demonstrates the behaviour <span class="strong italic">fully</span></li></ol></p> </div>
</div>
</div>
<div class="contentwide" id="evaluationwidth">
<!-- Display Questionnaire -->
<h3>Welcome to 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 is evaluating their 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 the progress and number of competencies answered so 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 So Far</h4>
<table class="competenciesevaluated">
<thead>
<tr>
<th>Competency</th>
</tr>
</thead>
<tbody>
<?php
foreach($competenciesEvaluatedArr as $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 the header(....), it may solve your problem.
try
{
if(!isset($_SESSION['logged-in']))
{
header("Location: ../index.php");
exit(0);//Add this line
}
}
catch(Exception $e)
{
}
Turns out that I was missing a class in the included questionnaire.php file.
Putting error reporting to to my PHP file was very helpful.
Thanks

Unexecpected H T_STRING [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 years ago.
Improve this question
What is this unexpected T_STRING "h" on line 39?
I Don't see any problem in the code, why is the string "h"?
I Think Its due to the java script option for orientation in the code
which i set to "h" or horizontal
<?php
include "system.php";
$usersystem = $_SESSION['username'];
$passw = $_SESSION['password'];
$query= "SELECT * FROM users WHERE username = '$usersystem' AND password = '$passw'";
$autoexec= $mysqli->query($query);
$earnings = $autoexec['earnings'];
$completed = $autoexec['completed'];
if ($_SESSION['loggedin'] !=1){
header ('Location: index.php);
}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Highest Paying GPT Site in the Industry!</title>
<meta name="keywords" content="GPT, Surveys, free money, free cash, free stuff" />
<meta name="description" content="A New Innovative GPT Site" />
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/ddsmoothmenu.js">
/***********************************************
* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script type="text/javascript">
ddsmoothmenu.init({
mainmenuid: "templatemo_menu", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
//customtheme: ["#1c5a80", "#18374a"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script>
<link rel="stylesheet" type="text/css" media="all" href="css/jquery.dualSlider.0.2.css" />
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="js/jquery.timers-1.2.js" type="text/javascript"></script>
<script src="js/jquery.dualSlider.0.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#carousel").dualSlider({
auto:true,
autoDelay: 6000,
easingCarousel: "swing",
easingDetails: "easeOutBack",
durationCarousel: 1000,
durationDetails: 600
});
});
</script>
</head>
<body>
<div id="templatemo_header_wrapper">
<div id="templatemo_header">
<div id="site_title">Great GPT Site</div>
<div id="templatemo_menu" class="ddsmoothmenu">
<ul>
<li>Home</li>
<li>How?
</li>
<li>Register
</li>
<li>Login</li>
<li>Contact Us</li>
</ul>
<br style="clear: left" />
</div> <!-- end of templatemo_menu -->
</div> <!-- END of templatemo_header -->
</div> <!-- END of templatemo_header_wrapper -->
<div id="templatemo_slider_wrapper">
<div id="templatemo_slider">
<div id="carousel">
<div class="panel"><!-- /details_wrapper -->
<p></p>
<h6></h6>
<p></p>
<h2>Welcome To Your Account! <?php echo "$username" ?></h2>
<h6><em> Statistics</h6>
<br />
<h6><em>Earnings: <?php echo "$earnings" ?><em></h6>
<br />
<h6><em>Completed Offers: <?php echo "$completed" ?></h6>
<p> </p>
<h6><em>Next Payment: End of next Month </h6>
<h6><em><a href=offers.php>Offers List</a></em></h6>
<p> </p>
<h5></h5>
<p> </p>
<p> </p>
<p> </p>
<h6></h6>
<p> </p>
<br />
<h6><em></h6>
<p> l</p>
<p> </p>
</div>
<!-- /panel -->
<h6> Welcome to <?php echo $title?> </h6>
<div id="slider-image-frame">
<div class="backgrounds">
<div class="item item_1">
<img src="images/slider/02.jpg" alt="Image 01" />
</div><!-- /item -->
<div class="item item_2">
<img src="images/slider/03.jpg" alt="Image 02" />
</div><!-- /item -->
<div class="item item_3">
<img src="images/slider/01.jpg" alt="Image 03" />
</div><!-- /item -->
</div><!-- /backgrounds -->
</div>
</div>
</div> <!-- END of templatemo_slider -->
</div> <!-- END of templatemo_slider_wrapper -->
<div id="templatemo_main">
<div class="homepage_post col half float_l">
<h2>Latest News Bulletin</h2>
<div class="post_meta">By Mark | Feburary 2, 2014</div>
<h6><img src="images/templatemo_image_02.jpg" class="image_fl imgage-with-frame" alt="Image 02"/> </h6>
<h6><em>New Offer Wall Added</em></h6>
<h6>New Offer Wall By BLVD Media has been released, check it out!</h6>
<h6>Offer Wall</h6>
</div>
<div class="col half float_r">
<h2>Note From the admin</h2>
<p>I've Recently Noticed alot of people have been requesting to know what the payment schedule is NOTE PAYMENTS ARE DETERMINED BY OUR ADVERTISERS Our Schedule is NET-30. This can change at any time</p>
<ul class="templatemo_list">
<li class="flow">Paypal is Preffered Method</li>
<li class="flow">Amazon is also Supported</li>
</ul>
</div>
<p> </p>
<div class="cleaner h40"></div>
<div class="cleaner"></div>
</div>
<!-- END of templatemo_main -->
<div id="templatemo_footer_wrapper">
<div id="templatemo_footer">
Copyright © 2014 <?php echo $title ?></div> <!-- END of templatemo_footer -->
</div> <!-- END of templatemo_footer_wrapper -->
<script type='text/javascript' src='js/logging.js'></script>
</body>
</html>
You are missing an ' in this line:
header ('Location: index.php);
It should be:
header ('Location: index.php');
you missed a quote ' in header ('Location: index.php). It should be :
<?php
include "system.php";
$usersystem = $_SESSION['username'];
$passw = $_SESSION['password'];
$query= "SELECT * FROM users WHERE username = '$usersystem' AND password = '$passw'";
$autoexec= $mysqli->query($query);
$earnings = $autoexec['earnings'];
$completed = $autoexec['completed'];
if($_SESSION['loggedin']!=1){
header ('Location: index.php');
// --^
}
?>

Categories