Jump to content

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'>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.