Jump to content

help page not displaying


ecabrera

Recommended Posts

i need help will this when i reload a page nothing appears help

 

 

<?php

ini_set( 'display_errors', 1 );
error_reporting( -1 );

date_default_timezone_set('America/Los_Angeles');

session_start();
$username = $_SESSION['username'];
$userid = $_SESSION['userid'];
?>
<!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><?php echo "$title";?></title>
<link href='styles/main.css' rel='stylesheet' type='text/css'></link>
<script language="javascript" src="scripts/javascript.js"></script>
<?php require("scripts/functions.php"); ?>
<style type='text/css'>
<!--
body{
background-color: Purple;
}
-->
</style>
</head> 
<body>

<div id='wrapper'>
<div id='header'>
<div id='status'><?php require('scripts/status.php'); ?></div>
<a href='<?php echo $site?>'><img src='images/logo.png'></img></a>
</div>
<?php if ($username)
//login in user see this
   <div id='nav'>
        <a href='<?php echo $site;?>/videos'>Videos</a>
    <a href='<?php echo $site;?>/videos'>Videos</a>
        <a href='<?php echo $site;?>/movies'>Movies</a>
</div>
} else {
//not login memebr see this
<div id='nav'>
    <a href='<?php echo $site;?>/videos'>Videos</a>
        <a href='<?php echo $site;?>/movies'>Movies</a>
</div>
}
?>

<div id='content'>

Link to comment
https://forums.phpfreaks.com/topic/244125-help-page-not-displaying/
Share on other sites

try this, you have alot of syntax errors in your codes.

 

<?php

ini_set( 'display_errors', 1 );
error_reporting( -1 );

date_default_timezone_set('America/Los_Angeles');

session_start();
$username = $_SESSION['username'];
$userid = $_SESSION['userid'];
?>
<!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><?php echo $title;?></title>
<link href='styles/main.css' rel='stylesheet' type='text/css'></link>
<script language="javascript" src="scripts/javascript.js"></script>
<?php require("scripts/functions.php"); ?>
<style type='text/css'>
<!--
body{
background-color: Purple;
}
-->
</style>
</head> 
<body>

<div id='wrapper'>
<div id='header'>
<div id='status'><?php require('scripts/status.php'); ?></div>
<a href='<?php echo $site; ?>'><img src='images/logo.png'></img></a>
</div>
<?php if ($username) { ?>
//login in user see this
   <div id='nav'>
        <a href='<?php echo $site;?>/videos'>Videos</a>
    <a href='<?php echo $site;?>/videos'>Videos</a>
        <a href='<?php echo $site;?>/movies'>Movies</a>
</div>
<?php
} else { ?>
//not login memebr see this
<div id='nav'>
    <a href='<?php echo $site;?>/videos'>Videos</a>
        <a href='<?php echo $site;?>/movies'>Movies</a>
</div><?php
}
?>

<div id='content'>

i have correct all of them. see if they work.

err, i fixed some syntax errors and add correct php tags.

 

<title><?php echo "$title";?></title>

if you are echoing a variable, you wouldn't need to have the "" for the echo.

 

<a href='<?php echo $site?>'><img src='images/logo.png'></img></a>

you echo $site without close the echo with ;

 

<?php if ($username)
// need to add { and close php ?>
   <div id='nav'>
        <a href='<?php echo $site;?>/videos'>Videos</a>
    <a href='<?php echo $site;?>/videos'>Videos</a>
        <a href='<?php echo $site;?>/movies'>Movies</a>
</div>
//open php again with <?php
} else {
//close it here ?>
<div id='nav'>
    <a href='<?php echo $site;?>/videos'>Videos</a>
        <a href='<?php echo $site;?>/movies'>Movies</a>
</div>
//open php again with <?php
}
?>

<div id='content'>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.