I haven't coded for a long time and my skills are basic.
I got a php file. It's a section file from a wordpress theme i am customizing.
My problem is. Made the code to link to an external css file to customize the social media icons, but it's not loading the CSS!
Here's the code:
<!DOCTYPE html>
<html lang = "en-US">
<head>
<meta charset = "UTF-8">
<link rel="stylesheet" type="text/css" href="D:\xampp\htdocs\alfasteel.pt\wp-content\themes\onetone\css\socialmedia.css" />
</head>
<body>
<div class="footer-social-icons">
<h4 class="_14">Follow us on</h4>
<ul class="social-icons">
<li> <i class="fa fa-facebook"></i></li>
<li> <i class="fa fa-twitter"></i></li>
<li> <i class="fa fa-rss"></i></li>
<li> <i class="fa fa-youtube"></i></li>
<li> <i class="fa fa-linkedin"></i></li>
<li> <i class="fa fa-google-plus"></i></li>
</ul>
</div>
Here's the whole file code in case you need it:
<!DOCTYPE html>
<html lang = "en-US">
<head>
<meta charset = "UTF-8">
<link rel="stylesheet" type="text/css" href="D:\xampp\htdocs\alfasteel.pt\wp-content\themes\onetone\css\socialmedia.css" />
</head>
<body>
<?php
global $onetone_animated, $onetone_section_id, $allowedposttags;
$i = $onetone_section_id ;
$section_title = onetone_option( 'section_title_'.$i );
$section_menu = onetone_option( 'menu_title_'.$i );
$section_content = onetone_option( 'section_content_'.$i );
$content_model = onetone_option( 'section_content_model_'.$i);
$section_subtitle = onetone_option( 'section_subtitle_'.$i );
$left_content = onetone_option( 'section_left_content_'.$i );
$right_content = onetone_option( 'section_right_content_'.$i );
if( !isset($section_content) || $section_content=="" )
$section_content = onetone_option( 'sction_content_'.$i );
if( $content_model == '0' || $content_model == '' ):
?>
<?php if( $section_title != '' || (function_exists('is_customize_preview') && is_customize_preview()) ):?>
<?php
$section_title_class = '';
if( $section_subtitle == '' && !(function_exists('is_customize_preview') && is_customize_preview()))
$section_title_class = 'no-subtitle';
?>
<h2 class="section-title <?php echo esc_attr($section_title_class); ?> <?php echo 'section_title_'.$i;?>"><?php echo wp_kses($section_title, $allowedposttags);?></h2>
<?php endif;?>
<?php if( $section_subtitle != '' || (function_exists('is_customize_preview') && is_customize_preview()) ):?>
<div class="section-subtitle <?php echo 'section_subtitle_'.$i;?>"><?php echo do_shortcode(wp_kses($section_subtitle, $allowedposttags));?></div>
<?php endif;?>
<div class="home-section-content">
<div class="footer-social-icons">
<h4 class="_14">Follow us on</h4>
<ul class="social-icons">
<li> <i class="fa fa-facebook"></i></li>
<li> <i class="fa fa-twitter"></i></li>
<li> <i class="fa fa-rss"></i></li>
<li> <i class="fa fa-youtube"></i></li>
<li> <i class="fa fa-linkedin"></i></li>
<li> <i class="fa fa-google-plus"></i></li>
</ul>
</div>
<div class="row">
<div class="col-md-8"><div class="<?php echo $onetone_animated;?> <?php echo 'section_left_content_'.$i;?>" data-animationduration="0.9" data-animationtype="fadeInLeft" data-imageanimation="no"><?php echo do_shortcode($left_content);?></div></div>
<div class="col-md-4"><div class="<?php echo $onetone_animated;?> <?php echo 'section_right_content_'.$i;?>" data-animationduration="0.9" data-animationtype="fadeInRight" data-imageanimation="no"><?php echo do_shortcode($right_content);?></div></div>
</div>
</div>
<?php
else:
?>
<?php if( $section_title != '' || (function_exists('is_customize_preview') && is_customize_preview()) ):?>
<div class="section-title <?php echo 'section_title_'.$i;?>"><?php echo esc_attr($section_title);?></div>
<?php endif;?>
<div class="home-section-content <?php echo 'section_content_'.$i;?>">
<?php
if(function_exists('Form_maker_fornt_end_main'))
{
$section_content = Form_maker_fornt_end_main($section_content);
}
echo do_shortcode(wp_kses($section_content, $allowedposttags));
?>
</div>
<?php
endif;
?>
</body>
</html>
Your files sit under the web server htdocs folder. You can access them over HTTP by specifying their URI.
change href="D:\xampp\htdocs\alfasteel.pt\wp-content\themes\onetone\css\socialmedia.php"
to
href="http://localhost/alfasteel.pt/wp-content/themes/onetone/css/socialmedia.php"
As #Itay Moav -Malimovka suggested
It was the path that wasn't the right way!
This works!
<link rel="stylesheet" type="text/css" href="http://localhost/alfasteel.pt/wp-content/themes/onetone/css/socialmedia.css" />
Thanks a lot for your help guys!
Related
I need help trying to figure out how to get a button removed if a user is on the profile page, or if they are on the page, the button could display as a current menu item only it is not clickable.
Here is my code:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header class="site-header">
<div class="container">
<h1 class="school-logo-text float-left"><strong>Direct</strong> Connection</h1>
<?php if(is_user_logged_in()) {
?>
<i class="fa fa-search" aria-hidden="true"></i>
<i class="site-header__menu-trigger fa fa-bars" aria-hidden="true"></i>
<div class="site-header__menu group">
<nav class="main-navigation">
<ul>
<li <?php if (get_post_type() == 'event' OR is_page('past-events')) echo 'class="current-menu-item"';
?>>Events</li>
<li <?php if (get_post_type() == 'post') echo "class='current-menu-item'"
?>>Blogs</li>
</ul>
</nav>
<?php } ?>
<div class="site-header__util">
<?php if(is_user_logged_in()) { ?>
<a href="<?php if (is_page() == 'profile') //Needs a function here ?>" class="btn
btn--small btn--dark-orange float-left push-right">View Profile</a>
<a href="<?php echo wp_logout_url(); ?>" class="btn
btn--small btn--orange float-left push-right btn--with-photo">
<span class="site-header__avatar"><?php
echo get_avatar(get_current_user_id(), 60); ?></span>
<span class="btn__text">Log Out</span>
</a>
<?php } else{ ?>
Login
<?php }?>
<?php if(is_user_logged_in()) {
?>
<span href="<?php echo esc_url(site_url('/search')); ?>" class="search-trigger js-search-trigger"><i class="fa fa-search" aria-hidden="true"></i></span>
<?php } ?>
</div>
</div>
</div>
</header>
To hide the button when on a specific page you can add the following code to your functions.php file.
function hide_button_on_page_4() {
if ( is_page ( 4 ) ) {
echo '<style>
.btn.btn--small.btn--dark-orange.float-left.push-right {
display: none;
}
</style>';
}
}
add_action( 'wp_head', 'hide_button_on_page_4' );
In the code above I hide the button when on the page that has 4 as its ID. You can modify is_page(4) with your corresponding page ID.
You can find the page ID in the URL of the page when you are in the editor. For example, if the URL of the page is http://website.com/wp-admin/post.php?post=123&action=edit, the page ID is 123.
The code works well in xamp on my localhost but when I upload it to the cloud server, it is unsuccessful and does not give any error. I checked if the issue was in creating arrays but since there are other scripts in the website creating arrays in a similar manner, I ruled it out. Any help will be highly appreciated.
<?php
require_once 'core/core.php';
//Get Site Settings Data
$query = DB::getInstance()->get("settings", "*", ["id" => 1]);
if ($query->count()) {
foreach($query->results() as $row) {
$title = $row->title;
$use_icon = $row->use_icon;
$site_icon = $row->site_icon;
$tagline = $row->tagline;
$description = $row->description;
$keywords = $row->keywords;
$author = $row->author;
$bgimage = $row->bgimage;
}
}
//Get Payments Settings Data
$q1 = DB::getInstance()->get("payments_settings", "*", ["id" => 1]);
if ($q1->count()) {
foreach($q1->results() as $r1) {
$currency = $r1->currency;
$membershipid = $r1->membershipid;
}
}
//Getting Payement Id from Database
$query = DB::getInstance()->get("membership_freelancer", "*", ["membershipid" => $membershipid]);
if ($query->count() === 1) {
$q1 = DB::getInstance()->get("membership_freelancer", "*", ["membershipid" => $membershipid]);
} else {
$q1 = DB::getInstance()->get("membership_agency", "*", ["membershipid" => $membershipid]);
}
if ($q1->count() === 1) {
foreach($q1->results() as $r1) {
$bids = $r1->bids;
}
}
//Register Function
if (Input::exists()) {
if(Token::check(Input::get('token'))){
$errorHandler = new ErrorHandler;
$validator = new Validator($errorHandler);
$validation = $validator->check($_POST, [
'name' => [
'required' => true,
'minlength' => 2,
'maxlength' => 50
],
'email' => [
'required' => true,
'email' => true,
'maxlength' => 100,
'minlength' => 2,
'unique' => 'freelancer',
'unique' => 'client'
],
'username' => [
'required' => true,
'maxlength' => 20,
'minlength' => 3,
'unique' => 'freelancer',
'unique' => 'client'
],
'password' => [
'required' => true,
'minlength' => 6
],
'confirmPassword' => [
'match' => 'password'
]
]);
if (!$validation->fails()) {
if (Input::get('user_type') === 'on') {
$client = new Client();
$remember = (Input::get('remember') === 'on') ? true : false;
$salt = Hash::salt(32);
$imagelocation = 'uploads/default.png';
$clientid = uniqueid();
try{
$client->create(array(
'clientid' => $clientid,
'username' => Input::get('username'),
'password' => Hash::make(Input::get('password'), $salt),
'salt' => $salt,
'name' => Input::get('name'),
'email' => Input::get('email'),
'imagelocation' => $imagelocation,
'joined' => date('Y-m-d H:i:s'),
'active' => 1,
'user_type' => 1
));
if ($client) {
$login = $client->login(Input::get('email'), Input::get('password'), $remember);
Redirect::to('Client/');
}else {
$hasError = true;
}
}catch(Exception $e){
die($e->getMessage());
}
} else {
if($membershipid != ''){
$freelancer = new Freelancer();
$remember = (Input::get('remember') === 'on') ? true : false;
$salt = Hash::salt(32);
$imagelocation = 'uploads/default.png';
$bgimage = 'uploads/bg/default.jpg';
$freelancerid = uniqueid();
try{
$freelancer->create(array(
'freelancerid' => $freelancerid,
'username' => Input::get('username'),
'password' => Hash::make(Input::get('password'), $salt),
'salt' => $salt,
'name' => Input::get('name'),
'email' => Input::get('email'),
'imagelocation' => $imagelocation,
'bgimage' => $bgimage,
'membershipid' => $membershipid,
'membership_bids' => $bids,
'membership_date' => date('Y-m-d H:i:s'),
'joined' => date('Y-m-d H:i:s'),
'active' => 1,
'user_type' => 1
));
if ($freelancer) {
$login = $freelancer->login(Input::get('email'), Input::get('password'), $remember);
Redirect::to('Freelancer/');
}else {
$hasError = true;
}
}catch(Exception $e){
die($e->getMessage());
}
} else {
$memError = true;
}
}
} else {
$error = '';
foreach ($validation->errors()->all() as $err) {
$str = implode(" ",$err);
$error .= '
<div class="alert alert-danger fade in">
×
<strong>Error!</strong> '.$str.'<br/>
</div>
';
}
}
}
}
?>
<!DOCTYPE html>
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
<!-- ==============================================
Title and Meta Tags
=============================================== -->
<meta charset="utf-8">
<title><?php echo escape($title) .' - '. escape($tagline) ; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="<?php echo escape($description); ?>">
<meta name="keywords" content="<?php echo escape($keywords); ?>">
<meta name="author" content="<?php echo escape($author); ?>">
<!-- ==============================================
Favicons
=============================================== -->
<link rel="shortcut icon" href="img/favicons/favicon.ico">
<link rel="apple-touch-icon" href="img/favicons/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/favicons/apple-touch-icon-114x114.png">
<!-- ==============================================
CSS
=============================================== -->
<!-- Style-->
<link href="assets/css/login.css" rel="stylesheet" type="text/css" />
<!-- ==============================================
Feauture Detection
=============================================== -->
<script src="assets/js/modernizr-custom.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"> </script>
<![endif]-->
</head>
<body>
<!-- Paste this code after body tag -->
<div class="loader">
<div class="se-pre-con"></div>
</div>
<?
$basename = basename($_SERVER["REQUEST_URI"], ".php");
$editname = basename($_SERVER["REQUEST_URI"]);
$test = $_SERVER["REQUEST_URI"];
?>
<!-- ==============================================
Navigation Section
=============================================== -->
<header id="header" headroom="" role="banner" tolerance="5" offset="700" class="navbar navbar-fixed-top navbar--white ng-isolate-scope headroom headroom--top">
<nav role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle header-nav__button" data-toggle="collapse" data-target=".navbar-main">
<span class="icon-bar header-nav__button-line"></span>
<span class="icon-bar header-nav__button-line"></span>
<span class="icon-bar header-nav__button-line"></span>
</button>
<div class="header-nav__logo">
<a class="header-nav__logo-link navbar-brand" href="index.php">
<?php if($use_icon === '1'): ?>
<i class="fa <?php echo $site_icon; ?>"></i>
<?php endif; ?> <?php echo escape($title); ?></a>
</div>
</div>
<div class="collapse navbar-collapse navbar-main navbar-right">
<ul class="nav navbar-nav header-nav__navigation">
<li class="header-nav__navigation-item
<?php echo $active = ($_SERVER['HTTP_HOST'] && $test === '') ? ' active' : ''; echo $active = ($basename == 'index') ? ' active' : ''; ?>">
<a href="index.php" class="header-nav__navigation-link">
<?php echo $lang['home']; ?>
</a>
</li>
<li class="header-nav__navigation-item <?php echo $active = ($basename == 'jobs') ? ' active' : ''; echo $active = ($editname == 'jobpost.php?title='. Input::get('title').'') ? ' active' : '';?>">
<a href="jobs.php" class="header-nav__navigation-link ">
<?php echo $lang['jobs']; ?>
</a>
</li>
<li class="header-nav__navigation-item <?php echo $active = ($basename == 'services') ? ' active' : ''; echo $active = ($editname == 'freelancer.php?a='. Input::get('a').'&id='. Input::get('id').'') ? ' active' : ''; ?>">
<a href="services.php" class="header-nav__navigation-link ">
<?php echo $lang['services']; ?>
</a>
</li>
<li class="header-nav__navigation-item <?php echo $active = ($basename == 'about') ? ' active' : ''; ?>">
<a href="about.php" class="header-nav__navigation-link ">
<?php echo $lang['about']; ?>
</a>
</li>
<li class="header-nav__navigation-item <?php echo $active = ($basename == 'how') ? ' active' : ''; ?>">
<a href="how.php" class="header-nav__navigation-link ">
<?php echo $lang['how']; ?> <?php echo $lang['it']; ?> <?php echo $lang['works']; ?>
</a>
</li>
<li class="header-nav__navigation-item <?php echo $active = ($basename == 'faq') ? ' active' : ''; ?>">
<a href="faq.php" class="header-nav__navigation-link ">
<?php echo $lang['faq']; ?>
</a>
</li>
<li class="header-nav__navigation-item <?php echo $active = ($basename == 'contact') ? ' active' : ''; ?>">
<a href="contact.php" class="header-nav__navigation-link ">
<?php echo $lang['contact']; ?>
</a>
</li>
<?php
//Start new Admin object
$admin = new Admin();
//Start new Client object
$client = new Client();
//Start new Freelancer object
$freelancer = new Freelancer();
if ($admin->isLoggedIn()) { ?>
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- The user image in the navbar-->
<?php // echo $profileimg; ?>
<img src="Admin/<?php echo escape($admin->data()->imagelocation); ?>" class="user-image" alt="User Image"/>
<!-- hidden-xs hides the username on small devices so only the image appears. -->
<span class="hidden-xs">
<?php echo escape($admin->data()->name); ?>
</span>
</a>
<ul class="dropdown-menu">
<li class="m_2"><i class="fa fa-dashboard"></i><?php echo $lang['dashboard']; ?></li>
<li class="m_2"><i class="fa fa-user"></i><?php echo $lang['view']; ?> <?php echo $lang['profile']; ?></li>
<li class="m_2"><i class="fa fa-lock"></i> <?php echo $lang['logout']; ?></li>
</ul>
</li>
<?php } elseif($client->isLoggedIn()) { ?>
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- The user image in the navbar-->
<?php // echo $profileimg; ?>
<img src="Client/<?php echo escape($client->data()->imagelocation); ?>" class="user-image" alt="User Image"/>
<!-- hidden-xs hides the username on small devices so only the image appears. -->
<span class="hidden-xs">
<?php echo escape($client->data()->name); ?>
</span>
</a>
<ul class="dropdown-menu">
<li class="m_2"><i class="fa fa-dashboard"></i><?php echo $lang['dashboard']; ?></li>
<li class="m_2"><i class="fa fa-user"></i><?php echo $lang['view']; ?> <?php echo $lang['profile']; ?></li>
<li class="m_2"><i class="fa fa-lock"></i> <?php echo $lang['logout']; ?></li>
</ul>
</li>
<?php } elseif($freelancer->isLoggedIn()) { ?>
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- The user image in the navbar-->
<?php // echo $profileimg; ?>
<img src="Freelancer/<?php echo escape($freelancer->data()->imagelocation); ?>" class="user-image" alt="User Image"/>
<!-- hidden-xs hides the username on small devices so only the image appears. -->
<span class="hidden-xs">
<?php echo escape($freelancer->data()->name); ?>
</span>
</a>
<ul class="dropdown-menu">
<li class="m_2"><i class="fa fa-dashboard"></i><?php echo $lang['dashboard']; ?></li>
<li class="m_2"><i class="fa fa-user"></i><?php echo $lang['view']; ?> <?php echo $lang['profile']; ?></li>
<li class="m_2"><i class="fa fa-lock"></i> <?php echo $lang['logout']; ?></li>
</ul>
</li>
<?php } else { ?>
<li class="header-nav__navigation-item <?php echo $active = ($basename == 'login') ? ' active' : ''; echo $active = ($basename == 'forgot') ? ' active' : ''; echo $active = ($basename == 'reset') ? ' active' : ''; ?>">
<a class="header-nav__navigation-link" href="login.php"><?php echo $lang['login']; ?></a>
</li>
<li class="header-nav__navigation-item <?php echo $active = ($basename == 'register') ? ' active' : ''; ?>">
<a class="header-nav__navigation-link header-nav__navigation-link--outline" href="register.php"><?php echo $lang['signup']; ?> <?php echo $lang['for']; ?> <?php echo $lang['free']; ?></a>
</li>
<?php } ?>
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<?php echo $lang['languages']; ?>
</a>
<ul class="dropdown-menu">
<li class="m_2">English</li>
<li class="m_2">French</li>
<li class="m_2">German</li>
<li class="m_2">Portuguese</li>
<li class="m_2">Spanish</li>
<li class="m_2">Russian</li>
<li class="m_2">Chinese</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<!-- ==============================================
Header
=============================================== -->
<header class="header-login" style="
background: linear-gradient(
rgba(34,34,34,0.7),
rgba(34,34,34,0.7)
), url('<?php echo $bgimage; ?>') no-repeat center center fixed;
background-size: cover;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
color: #fff;
height: 55vh;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center; ">
<div class="container">
<div class="content">
<div class="row">
<h1 class="revealOnScroll" data-animation="fadeInDown">
<?php if($use_icon === '1'): ?>
<i class="fa <?php echo $site_icon; ?>"></i>
<?php endif; ?> <?php echo escape($title); ?></h1>
<div id="typed-strings">
<span><?php echo escape($tagline); ?></span>
</div>
<p id="typed"></p>
</div><!-- /.row -->
</div><!-- /.content -->
</div><!-- /.container -->
</header><!-- /header -->
<!-- ==============================================
Banner Login Section
=============================================== -->
<section class="banner-login">
<div class="container">
<div class="row">
<main class="main main-signup col-lg-12">
<div class="col-lg-6 col-lg-offset-3 text-center">
<?php if(isset($memError)) { //If errors are found ?>
<div class="alert alert-danger fade in">
×
<strong><?php echo $lang['hasError']; ?></strong> <?php echo $lang['mem_error']; ?>
</div>
<?php } ?>
<?php if(isset($hasError)) { //If errors are found ?>
<div class="alert alert-danger fade in">
×
<strong><?php echo $lang['hasError']; ?></strong> <?php echo $lang['login_error']; ?>
</div>
<?php } ?>
<?php if (isset($error)) {
echo $error;
} ?>
<div class="form-sign">
<form method="post">
<div class="form-head">
<h3><?php echo $lang['register']; ?></h3>
</div><!-- /.form-head -->
<div class="form-body">
<!-- List group -->
<ul class="list-group">
<li class="list-group-item">
<div class="material-switch pull-center">
<span class="pull-left"><?php echo $lang['freelancer'];
?> </span>
<input id="someSwitchOptionDefault" name="user_type" type="checkbox"/>
<label for="someSwitchOptionDefault" class="label-success"> </label>
<span class="pull-right"><?php echo $lang['client']; ?></span>
</div>
</li>
</ul>
<div class="form-row">
<div class="form-controls">
<input type="text" name="name" class="field" value="<?php echo escape(Input::get('name')); ?>" placeholder="<?php echo $lang['full_name']; ?>">
</div><!-- /.form-controls -->
</div><!-- /.form-row -->
<div class="form-row">
<div class="form-controls">
<input type="text" name="email" class="field" value="<?php echo escape(Input::get('email')); ?>" placeholder="<?php echo $lang['email']; ?>">
</div><!-- /.form-controls -->
</div><!-- /.form-row -->
<div class="form-row">
<div class="form-controls">
<input type="text" name="username" class="field" value="<?php echo escape(Input::get('username')); ?>" placeholder="<?php echo $lang['username']; ?>">
</div><!-- /.form-controls -->
</div><!-- /.form-row -->
<div class="form-row">
<div class="form-controls">
<input type="password" name="password" class="field" placeholder="<?php echo $lang['password']; ?>">
</div><!-- /.form-controls -->
</div><!-- /.form-row -->
<div class="form-row">
<div class="form-controls">
<input type="password" name="confirmPassword" class="field" placeholder="<?php echo $lang['confirm_password']; ?>">
</div><!-- /.form-controls -->
</div><!-- /.form-row -->
</div><!-- /.form-body -->
<div class="form-foot">
<div class="form-actions">
<input type="hidden" name="token" value="<?php echo Token::generate(); ?>" />
<input value="<?php echo $lang['register']; ?>" class="form-btn" type="submit">
</div><!-- /.form-actions -->
</div><!-- /.form-foot -->
</form>
</div><!-- /.form-sign -->
</div><!-- /.col-lg-6 -->
</main>
</div><!-- /.row -->
</div><!-- /.container -->
</section><!-- /section -->
<!-- ==============================================
Scripts
=============================================== -->
<!-- jQuery 2.1.4 -->
<script src="assets/js/jQuery-2.1.4.min.js" type="text/javascript"></script>
<!-- Bootstrap 3.3.6 JS -->
<script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
<!-- Typed JS -->
<script src="assets/js/typed.min.js" type="text/javascript"></script>
<!-- Kafe JS -->
<script src="assets/js/kafe.js" type="text/javascript"></script>
There seems to be issue with path of the file you are including;
require_once __DIR__.'core/core.php';
I'm having a problem I've been trying to solve for 3 weeks, and have gotten almost nowhere.
My web app was working perfectly fine, until one day it stopped working entirely because my header.php file is royally messed up.
Basically, the problem is:
My header.php file is displaying NOTHING (View Source displays nothing) and the page is completely white. I have turned on all error reporting, and tried echoing things at the top of the page, but NOTHING works until I comment out a few variables in an if statement (see below)
The following are the first few lines of code of my header.php file.
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo("TEST");
session_start();
if(isset($_SESSION['username'])){ //VARIABLES WITHIN THIS STATEMENT CAUSE ERROR
$username = $_SESSION['username'];
$email = $_SESSION['email'];
$title = $_SESSION['title'];
$id = $_SESSION['id'];
$role = $_SESSION['role'];
$fullname = $_SESSION['fullname'];
$labname = $_SESSION['labname'];
$date_official = $_SESSION['date'];
$permission = $_SESSION['permission'];
$avatar = $_SESSION['avatar'];
$usr_ip = $_SERVER['REMOTE_ADDR'];
$isLogged = true;
}
else
{
$isLogged = false;
echo("Unlogged.");
}
if($isLogged)
{
if($permission == 7 || $permission == 1 || $permission == 2){
echo <<<_END
<!DOCTYPE html>
<html lang="en">
<head>
...file truncated for simplicity.
If I comment out $permission and $role, the echo "TEST" runs, but the rest of the page doesn't. I'm kind of a PHP noob, but honestly I've used PHP for almost 5 years now and have never encountered anything like this.
I greatly appreciate ANY help. Thank you so much.
Cheers
EDIT** I have been asked to paste my entire code:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
session_start();
echo("TEST");
if(isset($_SESSION['username'])){
$username = $_SESSION['username'];
$email = $_SESSION['email'];
$title = $_SESSION['title'];
$id = $_SESSION['id'];
$role = $_SESSION['role'];
$fullname = $_SESSION['fullname'];
$labname = $_SESSION['labname'];
$date_official = $_SESSION['date'];
$permission = $_SESSION['permission'];
$avatar = $_SESSION['avatar'];
$usr_ip = $_SERVER['REMOTE_ADDR'];
$isLogged = true;
}
else
{
$isLogged = true;
echo("Unlogged.");
}
if($isLogged)
{
if($permission == 7 || $permission == 1 || $permission == 2){
echo <<<_END
<!DOCTYPE html>
<html lang="en">
<head>
<!--CHARSET-->
<meta charset="UTF-8">
<!--FAVICON-->
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
<!--INTERNAL STYLING-->
<link href="css/style.css" rel="stylesheet">
<link href="css/core_styles.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/core_styles.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" href="css/calendar.css" />
<link rel="stylesheet" type="text/css" href="css/font-awesome.css">
<link rel="stylesheet" href="css/dropzone.css">
<!--JQUERY AND JQUERY UI-->
<script src="js/jquery-2.2.3.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/smoothness/jquery-ui.css" />
<!--INTERNAL SCRIPTS-->
<script src="js/functions.js"></script>
<script src="js/account.js"></script>
<script src="js/storage.js"></script>
<script src="js/notebook.js"></script>
<script src="js/protocol.js"></script>
<script src="js/calendar.js"></script>
<script src="js/members.js"></script>
<script src="js/administration.js"></script>
<script src="js/dash.js"></script>
<!--CHARTS-->
<script src="js/Chart.min.js"></script>
<!--DROPZONE-->
<script src="js/dropzone.js"></script>
<!--BOOTSTRAP-->
<link type="text/css" href="css/bootstrap.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
<!--SUMMERNOTE-->
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.css" rel="stylesheet">
<!--TOOLTIPS-->
<link rel="stylesheet" type="text/css" href="css/tooltipster.css" />
<script type="text/javascript" src="js/jquery.tooltipster.min.js"></script>
<title>FMAX ($labname)</title>
</head>
<body>
<div id="appWrapper">
<div id="point_prompt"></div>
<div id="appPanelLeft">
<!--LOGO CONTAINER-->
<div id="appLogo" class="subPanel">
<span class="logoF logoFont textDeny">F </span><span class="logoMax logoFont textDeny">M A X</span>
</div>
<!--PROFILE PICTURE CONTAINER-->
<div id="subPanel_0" class="subPanel">
<div class="profilePicture" style="background-image: url($avatar)"></div>
<div class="ta_center">
<span id="pnl_username" class="regTextPanelB">$fullname</span>
<br/>
<span id="pnl_permis" class="hintTextA">$role</span>
<br/>
<span id="pnl_degree" class="hintTextA">$title</span>
<br/>
</div>
</div>
<!--MAIN NAV CONTAINER-->
<div id="subPanel_1" class="subPanel">
<table id="navTable">
<tr>
<td>
<div data-value="0" class="pnlNavBtn">
<span class="fa fa-home fa-3x fa-fw myBlue"></span><br/>
<span class="regTextPanelA">Dashboard</span>
</div>
</td>
<td>
<div data-value="1" class="pnlNavBtn">
<span class="fa fa-book fa-3x fa-fw myPurple"></span>
<span class="regTextPanelA">Notebook</span>
</div></td>
</tr>
<tr>
<td>
<div data-value="2" class="pnlNavBtn">
<span class="fa fa-shopping-cart fa-3x fa-fw myYellow"></span>
<span class="regTextPanelA">Orders</span>
</div>
</td>
<td>
<div data-value="3" class="pnlNavBtn">
<span class="fa fa-list fa-3x fa-fw myOrange"></span>
<span class="regTextPanelA">Protocols</span>
</div>
</td>
</tr>
<tr>
<td>
<div data-value="4" class="pnlNavBtn">
<span class="fa fa-database fa-3x fa-fw myGreen"></span>
<span class="regTextPanelA">Storage</span>
</div>
</td>
<td>
<div data-value="5" class="pnlNavBtn">
<span class="fa fa-users fa-3x fa-fw myDarkBlue"></span>
<span class="regTextPanelA">Members</span>
</div>
</td>
</tr>
<tr>
<td>
<div data-value="6" class="pnlNavBtn">
<span class="fa fa-calendar fa-3x fa-fw myYellow"></span>
<span class="regTextPanelA">Calendar</span>
</div>
</td>
<td>
<div data-value="8" class="pnlNavBtn">
<span class="fa fa-lock fa-3x fa-fw myRose"></span>
<span class="regTextPanelA">Administration</span>
</div>
</td>
</tr>
</table>
</div>
<!--USER NAV CONTAINER-->
<div id="subPanel_2" class="subPanel">
<span class="hintTextA">User</span>
<br/>
<br/>
<div data-value="9" class="pnlNavBtn list">
<span class="fa fa-user fa-fw myBlue"></span>
<span class="regTextPanelA">Account</span>
</div>
<a href="logout.php"><div class="pnlNavBtn list">
<span class="fa fa-sign-out fa-fw myBlue"></span>
<span class="regTextPanelA">Logout</span>
</div>
</a>
</div>
<!--LAB MODULES CONTAINER-->
<div id="subPanel_3" class="subPanel">
<span class="hintTextA">Public Lab Page</span>
<br/>
<br/>
<div data-value="10" class="pnlNavBtn list">
<span class="fa fa-edit fa-fw myBlue"></span>
<span class="regTextPanelA">Edit Modules</span>
</div>
</div>
</div>
<div id="appWindow">
<!--TOOLBAR -->
<div id="appToolbar" class="row">
<nav class="navToolbar">
<ul>
<li id="app_msgs_btn"><span class="fa fa-lg fa-envelope-o myDarkBlue"></span> <span class="notificationHint small" id="inboxHint">0</span></li>
<li id="app_notif_btn"><span class="fa fa-lg fa-exclamation-circle myRose"></span> <span class="notificationHint small" id="notifHint">0</span></li>
<ul>
</nav>
</div>
<div id="notificationPane">
<div class="notification">
<span class="fa fa-fw fa-exclamation myRed"></span> Lorem ipsum dolor sit amet.
</div>
<div class="notification">
<span class="fa fa-fw fa-exclamation myRed"></span> If you type for long enough, your text might just extend two lines.
</div>
<div class="notification">
<span class="fa fa-fw fa-exclamation myRed"></span> Some Content.
</div>
<div class="notification">
<span class="fa fa-fw fa-exclamation myRed"></span> Some Content.
</div>
<div class="notification read">
<span class="fa fa-fw fa-exclamation myRed"></span> Some Content.
</div>
</div>
_END;
}
}
else{
echo("Error.");
}
I am doing a school project but I am having some trouble with PHPBB because I cant get it to load files through public_html. I would appreciate some help with this thanks. If you have any questions I will happily answer them.
<?php include("/home/***/public_html/application/config/autoload.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<div class='title-box'>
<img src='http://www.berkley.school.nz/wp-content/themes/sparky/img/logo.min.png'>
</div>
<div class="header">
<div class="header_left_box">
<ul id="menu">
<li <?php if ($this->checkForActiveController($filename, "forum")) { echo ' class="active" '; } ?> >
Forum
</li>
<li <?php if ($this->checkForActiveController($filename, "helpcenter")) { echo ' class="active" '; } ?> >
Help Center
</li>
<?php if (Session::get('user_logged_in') == true):?>
<li <?php if ($this->checkForActiveController($filename, "dashboard")) { echo ' class="active" '; } ?> >
Dashboard
</li>
<?php endif; ?>
<?php if (Session::get('user_logged_in') == true):?>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
My Account
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Change account type
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Upload an avatar
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Edit my username
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Edit my email
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Edit my password
</li>
<li <?php if ($this->checkForActiveController($filename, "login")) { echo ' class="active" '; } ?> >
Logout
</li>
</ul>
</li>
<?php endif; ?>
<?php if (Session::get('user_type') == 1):?>
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
Student
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<?php endif; ?>
<?php if (Session::get('user_type') == 2):?>
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
Student
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<li <?php if ($this->checkForActiveController($filename, "teacher")) { echo ' class="active" '; } ?> >
Teacher
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "teacher")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<?php endif; ?>
<?php if (Session::get('user_type') == 3):?>
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
Student
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "student")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<li <?php if ($this->checkForActiveController($filename, "teacher")) { echo ' class="active" '; } ?> >
Teacher
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "teacher")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<li <?php if ($this->checkForActiveController($filename, "admin")) { echo ' class="active" '; } ?> >
Admin
<ul class="sub-menu">
<li <?php if ($this->checkForActiveController($filename, "admin")) { echo ' class="active" '; } ?> >
</li>
</ul>
</li>
<?php endif; ?>
</ul>
</div>
</div>
<div class="header">
<div class="header_right_box">
<ul id="menu">
<?php if (Session::get('user_logged_in') == false):?>
<li <?php if ($this->checkForActiveControllerAndAction($filename, "login/index")) { echo ' class="active" '; } ?> >
Login
</li>
</ul>
</li>
<?php endif; ?>
</ul>
</div>
<?php if (Session::get('user_logged_in') == true): ?>
<div class="header_right_box">
<div class="namebox">
Hello <?php echo Session::get('user_name'); ?>!
</div>
<div class="avatar">
<?php if (USE_GRAVATAR) { ?>
<img src='<?php echo Session::get('user_gravatar_image_url'); ?>'
style='width:<?php echo AVATAR_SIZE; ?>px; height:<?php echo AVATAR_SIZE; ?>px;' />
<?php } else { ?>
<img src='<?php echo Session::get('user_avatar_file'); ?>'
style='width:<?php echo AVATAR_SIZE; ?>px; height:<?php echo AVATAR_SIZE; ?>px;' />
<?php } ?>
</div>
</div>
<?php endif; ?>
<div class="clear-both"></div>
</div>
<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="keywords" content="" />
<meta name="description" content="" />
{META}
<title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- ENDIF -->{PAGE_TITLE}</title>
<!-- IF S_ENABLE_FEEDS -->
<!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
<!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
<!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
<!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
<!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" /><!-- ENDIF -->
<!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
<!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&t={S_TOPIC_ID}" /><!-- ENDIF -->
<!-- ENDIF -->
<!--
phpBB style name: prosilver
Based on style: prosilver (this is the default phpBB3 style)
Original author: Tom Beddard ( http://www.subBlue.com/ )
Modified by:
-->
<script type="text/javascript">
// <![CDATA[
var jump_page = '{LA_JUMP_PAGE}:';
var on_page = '{ON_PAGE}';
var per_page = '{PER_PAGE}';
var base_url = '{A_BASE_URL}';
var style_cookie = 'phpBBstyle';
var style_cookie_settings = '{A_COOKIE_SETTINGS}';
var onload_functions = new Array();
var onunload_functions = new Array();
<!-- IF S_USER_PM_POPUP and S_NEW_PM -->
var url = '{UA_POPUP_PM}';
window.open(url.replace(/&/g, '&'), '_phpbbprivmsg', 'height=225,resizable=yes,scrollbars=yes, width=400');
<!-- ENDIF -->
/**
* Find a member
*/
function find_username(url)
{
popup(url, 760, 570, '_usersearch');
return false;
}
/**
* New function for handling multiple calls to window.onload and window.unload by pentapenguin
*/
window.onload = function()
{
for (var i = 0; i < onload_functions.length; i++)
{
eval(onload_functions[i]);
}
};
window.onunload = function()
{
for (var i = 0; i < onunload_functions.length; i++)
{
eval(onunload_functions[i]);
}
};
// ]]>
</script>
<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/styleswitcher.js"></script>
<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/forum_fn.js"></script>
<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
<link href="{T_STYLESHEET_LINK}" rel="stylesheet" type="text/css" media="screen, projection" />
<link href="{T_THEME_PATH}/normal.css" rel="stylesheet" type="text/css" title="A" />
<link href="{T_THEME_PATH}/medium.css" rel="alternate stylesheet" type="text/css" title="A+" />
<link href="{T_THEME_PATH}/large.css" rel="alternate stylesheet" type="text/css" title="A++" />
<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
<link href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" />
<!-- ENDIF -->
</head>
<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">
<div id="wrap">
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
<div class="inner"><span class="corners-top"><span></span></span>
<div id="site-description">
{SITE_LOGO_IMG}
<h1>{SITENAME}</h1>
<p>{SITE_DESCRIPTION}</p>
<p class="skiplink">{L_SKIP}</p>
</div>
<!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH -->
<div id="search-box">
<form action="{U_SEARCH}" method="get" id="search">
<fieldset>
<input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" />
<input class="button2" value="{L_SEARCH}" type="submit" /><br />
{L_SEARCH_ADV} {S_SEARCH_HIDDEN_FIELDS}
</fieldset>
</form>
</div>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
</div>
<div class="navbar">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="linklist navlinks">
<li class="icon-home">{L_INDEX} <!-- BEGIN navlinks --> <strong>‹</strong> {navlinks.FORUM_NAME}<!-- END navlinks --></li>
<li class="rightside">{L_CHANGE_FONT_SIZE}</li>
<!-- IF U_EMAIL_TOPIC --><li class="rightside">{L_EMAIL_TOPIC}</li><!-- ENDIF -->
<!-- IF U_EMAIL_PM --><li class="rightside">{L_EMAIL_PM}</li><!-- ENDIF -->
<!-- IF U_PRINT_TOPIC --><li class="rightside">{L_PRINT_TOPIC}</li><!-- ENDIF -->
<!-- IF U_PRINT_PM --><li class="rightside">{L_PRINT_PM}</li><!-- ENDIF -->
</ul>
<!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
<ul class="linklist leftside">
<li class="icon-ucp">
{L_PROFILE}
<!-- IF S_DISPLAY_PM --> ({PRIVATE_MESSAGE_INFO})<!-- ENDIF -->
<!-- IF S_DISPLAY_SEARCH --> •
{L_SEARCH_SELF}
<!-- ENDIF -->
<!-- IF U_RESTORE_PERMISSIONS --> •
{L_RESTORE_PERMISSIONS}
<!-- ENDIF -->
</li>
</ul>
<!-- ENDIF -->
<ul class="linklist rightside">
<li class="icon-faq">{L_FAQ}</li>
<!-- IF not S_IS_BOT -->
<!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members">{L_MEMBERLIST}</li><!-- ENDIF -->
<!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="icon-register">{L_REGISTER}</li><!-- ENDIF -->
<li class="icon-logout">{L_LOGIN_LOGOUT}</li>
<!-- ENDIF -->
</ul>
<span class="corners-bottom"><span></span></span></div>
</div>
</div>
<a name="start_here"></a>
<div id="page-body">
<!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
<div id="information" class="rules">
<div class="inner"><span class="corners-top"><span></span></span>
<strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
You need to enclose the path in quotes:
<?php include('/home/***/public_html/application/config/autoload.php');?>
or
<?php include("/home/***/public_html/application/config/autoload.php");?>
There are a number of major issues with the code you've posted.
As identified by l'L'l, your include() syntax is incorrect.
You are attempting to mix PHP code with phpBB template syntax (e.g, {VARIABLE}, <!-- IF CONDITION -->). They are not compatible.
Your HTML is badly disordered; it has a bunch of content in <head>. This doesn't belong here.
It looks as though you may be trying to do too much, too fast here. Sit down and learn PHP properly before you continue.
This question already has answers here:
Reference - What does this error mean in PHP?
(38 answers)
Closed 8 years ago.
I get the following error when I open the index page:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\... on
line 161
Here is the code:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<title>
<?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home / front page.
$site_description = get_bloginfo( 'description', 'display' );
if( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'bootstrapwp' ), max( $paged, $page ) );
?>
</title>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
if( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="icon.jpg">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-57-precomposed.png">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php wp_head(); ?>
<?php include 'storeclass.php'; ?>
<style>
.navbar .nav li a
{
padding-right: 0px !important;
}
</style>
<?php
if( function_exists( 'teboAnalytic' ) ){
teboAnalytic();
}
?>
</head>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<style>
.container
{
max-width: 300px;
}
</style>
<body style="background-color: #E7EBF2;padding-top:65px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php
}
else
{
?>
<body style="background-color: #E7EBF2;padding-top:45px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php
} ?>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container" style="width:940px;">
<ul class="nav">
<li class="hidden-phone">
<img src="<?php echo BASE_URL.'weblogo.png'; ?>" style="width:270px;">
</li>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<li class="dropdown" style="margin-left:15px;">
<?php
}
else
{
?>
<li class="dropdown offset2">
<?php
} ?>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="padding:0;">
<img src="<?php echo BASE_URL; ?>callus.png" style="height:46px;width:203px">
</a>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
callUsBanner('mobile');
}
else
{
callUsBanner('desktop');
}
?>
</li><!-- Regular Menu Ends -->
<li class="divider-vertical">
</li>
</ul>
</div>
</div>
</div>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<link rel="stylesheet" href="mobile-custom.css" />
<style>
.hhd
{
display: inline-block;
height: 5px;
width: 100%;
}
</style>
<?php
} ?>
<div class="container hhd" style="height:41px;">
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<img src="weblogo.png" style="width:270px;">
<div class="row">
<div class="styled-select blue semi-square divsel span12">
<?php menu1(); ?>
</div>
</div>
<?
} ?>
<div class="subnavbar navbar navbar hidden-phone">
<div class="navbar-inner subnav">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
</button>
<ul class="nav" style="font-size:13px;">
<li class="hidden-phone">
<img src="badge.jpg" style="width:40px;">
</li>
<li class="hidden-phone">
<a href="" style="padding-right: 5px;">
<i class="icon-home">
</i>Home
</a>
</li>
<li class="hidden-phone">
<a href="">
<i class=" icon-th-large">
</i>Store
</a>
</li>
<li class="hidden-phone">
<a href="">
<i class=" icon-tag">
</i>Bursa
</a>
</li>
<li class="divider-vertical subnav">
</li>
<?php menuIjo('desktop','top'); ?>
</ul>
</div>
</div>
</div>
</div>
<script>
$('.renav').click(function(e)
{
//alert('ha');
$('section.dropdown-menu *').removeAttr('data-toggle');
});
</script>
<!-- End Header -->
<!-- Begin Template Content -->
could you help me to solve this problem?
thanks
replace
<? with <?php on line number 132 ( <? } ?> to <?php } ?>
the correct code will be
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<title><?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'bootstrapwp' ), max( $paged, $page ) );
?></title>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="icon.jpg">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-57-precomposed.png">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php wp_head(); ?>
<?php include 'storeclass.php'; ?>
<style>
.navbar .nav li a{
padding-right: 0px !important;
}
</style>
<?php
if ( function_exists( 'teboAnalytic' ) ) {
teboAnalytic();
}
?>
</head>
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<style>
.container{
max-width:300px;
}
</style>
<body style="background-color: #E7EBF2;padding-top:65px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php }else{?>
<body style="background-color: #E7EBF2;padding-top:45px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php } ?>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container" style="width:940px;">
<ul class="nav">
<li class="hidden-phone">
<img src="<?php echo BASE_URL.'weblogo.png'; ?>" style="width:270px;">
</li>
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<li class="dropdown" style="margin-left:15px;">
<?php }else{ ?>
<li class="dropdown offset2">
<?php } ?>
<img src="<?php echo BASE_URL; ?>callus.png" style="height:46px;width:203px">
<?php if ($detect->isMobile() AND !$detect->isTablet()) {
callUsBanner('mobile');
}else{
callUsBanner('desktop');
}
?>
</li><!-- Regular Menu Ends -->
<li class="divider-vertical"></li>
</ul>
</div>
</div>
</div>
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<link rel="stylesheet" href="mobile-custom.css" />
<style>
.hhd{
display:inline-block;
height:5px;
width:100%;
}
</style>
<?php } ?>
<div class="container hhd" style="height:41px;">
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<img src="weblogo.png" style="width:270px;">
<div class="row">
<div class="styled-select blue semi-square divsel span12">
<?php menu1(); ?>
</div>
</div>
<?php } ?>
<div class="subnavbar navbar navbar hidden-phone">
<div class="navbar-inner subnav">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<ul class="nav" style="font-size:13px;">
<li class="hidden-phone"><img src="badge.jpg" style="width:40px;"></li>
<li class="hidden-phone"><i class="icon-home"></i>Home</li>
<li class="hidden-phone"><i class=" icon-th-large"></i>Store</li>
<li class="hidden-phone"><i class=" icon-tag"></i>Bursa</li>
<li class="divider-vertical subnav"></li>
<?php menuIjo('desktop','top'); ?>
</ul>
</div>
</div>
</div>
</div>
<script>
$('.renav').click(function(e){
//alert('ha');
$('section.dropdown-menu *').removeAttr('data-toggle');
});
</script>
<!-- End Header -->
<!-- Begin Template Content -->