Struggling with checking if logged in - php

Hi there I'm just trying to figure out how to check if a user is logged in and if so allow them to enter a page but if not simply return to 'index.php'.
What I've basically done is create duplicate pages of such as 'index.php', 'index2.php', 'service.php' and 'service2.php' so on and so forth with minor adjustments such as no 'search bar'.
Is it still possible to do so? I'd like the 'Check to see if logged in' on pages with '2' in them. Such as 'service2.php' or 'about2.php'
I've tried it with this code
(Keep in mind this is just the code not my whole entire page)
if(check_login()) {
echo 'You are in!';
} else {
header('Location: login.php');
exit;
}
function check_login () {
if(isset($_SESSION['login'] && $_SESSION['login'] != '') {
return true;
} else {
false;
}
}
Only used this code on pages that I want it to be displayed
Thanks in advance ! :)
UPDATE EDIT:
<?php
include ('config.php');
include ('function.php');
$_SESSION['login']
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Honda | </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='http://fonts.googleapis.com/css?family=Julius+Sans+One' rel='stylesheet' type='text/css'>
<link href="../css/style.css" rel="stylesheet" type="text/css" media="all" />
<!--slider-->
<link href="../css/camera.css" rel="stylesheet" type="text/css" media="all" />
<script type='text/javascript' src='../js/jquery.min.js'></script>
<script type='text/javascript' src='../js/jquery.mobile.customized.min.js'></script>
<script type='text/javascript' src='../js/jquery.easing.1.3.js'></script>
<script type='text/javascript' src='../js/camera.min.js'></script>
<script>
jQuery(function(){
jQuery('#camera_wrap_1').camera({
thumbnails: true
});
jQuery('#camera_wrap_2').camera({
height: '400px',
loader: 'bar',
pagination: false,
thumbnails: true
});
});
</script>
</head>
<body>
<!--start header-->
<div class="h_bg">
<div class="wrap">
<div class="wrapper">
<div class="header">
<div class="logo">
<img src="../images/logo.png">
</div>
<div class="cssmenu">
<ul>
<li class="active"><span>Home</span></li>
<li><span>About</span></li>
<li class="has-sub"><span>Gallery</span>
</li>
<li class="last"><span>Contact</span></li>
<div class="clear"></div>
</ul>
<div class="search">
<h2>search</h2>
<form action="search.php" method="get">
<input type="text" name="search" value="" placeholder="Enter Your search...">
<input type="submit" name="submit" value="">
</form>
</div>
<div class="search1">
<h2>login/Register</h2>
<form action="" method="POST">
<label>Username:</label>
<input type="text" id="password" name="username" required />
<label>Password:</label>
<input type="password" id="password" name="password" required />
<input type="submit" value="Login" name="submit" class="submit" />
<br><br>
<center>
<h2><p>Register</p></h2>
</center>
</form>
</div>
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['username']) && !empty($_POST['password'])) {
$username=$_POST['username'];
$password=$_POST['password'];
$password = strip_tags($password);
$password = md5($password); // md5 is used to encrypt your password to make it more secure.
$con=mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('aha') or die("cannot select DB");
$query=mysql_query("SELECT * FROM login WHERE username='".$username."' AND password='".$password."'");
$numrows=mysql_num_rows($query);
if($numrows!=0)
{
while($row=mysql_fetch_assoc($query))
{
$dbusername=$row['username'];
$dbpassword=$row['password'];
}
if($username == $dbusername && $password == $dbpassword)
{
session_start();
$_SESSION['sess_user']=$username;
/* Redirect browser */
header("Location: member.php");
}
} else {
echo "<div class='results'>Invalid username or password</div>";
}
} else {
echo "All fields are required!";
}
}
?>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- start slider -->
<div class="slider_bg">
<div class="wrap">
<div class="wrapper">
<div class="slider">
<!-- #camera_wrap_1 -->
<div class="fluid_container">
<div class="camera_wrap camera_azure_skin" id="camera_wrap_1">
<div data-thumb="../images/thumbs/slider1.jpg" data-src="../images/slider/slider1.jpg">
</div>
<div data-thumb="../images/thumbs/slider2.jpg" data-src="../images/slider/slider2.jpg">
</div>
<div data-thumb="../images/thumbs/slider3.jpg" data-src="../images/slider/slider3.jpg">
</div>
<div data-thumb="../images/thumbs/slider4.jpg" data-src="../images/slider/slider4.jpg">
</div>
</div><!-- #camera_wrap_1 -->
<div class="clear"></div>
</div>
<!-- end #camera_wrap_1 -->
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- start content -->
<div class="content_bg">
<div class="wrap">
<div class="wrapper">
<div class="main">
<!-- start content_right -->
<div class="image group">
<div class="grids_of_2">
<div class="grid images_3_of_1">
<img src="../images/pic1.jpg">
</div>
<div class="grid span_2_of_3">
<h3>How it all started</h3>
<p class="para">Honda Motor Co., Ltd. (本田技研工業株式会社 Honda Giken Kōgyō KK?, IPA: [hoɴda] ( listen); /ˈhɒndə/) is a Japanese public multinational corporation primarily known as a manufacturer of automobiles, motorcycles and power equipment.
Honda has been the world's largest motorcycle manufacturer since 1959,[3][4] as well as the world's largest manufacturer of internal combustion engines measured by volume, producing more than 14 million internal combustion engines each year.[5] Honda became the second-largest Japanese automobile manufacturer in 2001.[6][7] Honda was the eighth largest automobile manufacturer in the world behind General Motors, Volkswagen Group, Toyota, Hyundai Motor Group, Ford, Nissan, and PSA in 2011.[8]
Honda was the first Japanese automobile manufacturer to release a dedicated luxury brand, Acura, in 1986. Aside from their core automobile and motorcycle businesses, Honda also manufactures garden equipment, marine engines, personal watercraft and power generators, amongst others. Since 1986, Honda has been involved with artificial intelligence/robotics research and released their ASIMO robot in 2000. They have also ventured into aerospace with the establishment of GE Honda Aero Engines in 2004 and the Honda HA-420 HondaJet, which began production in 2012. Honda has three joint-ventures in China (Honda China, Dongfeng Honda, and Guangqi Honda).
In 2013, Honda invested about 5.7% (US$ 6.8 billion) of its revenues in research and development.[9] Also in 2013, Honda became the first Japanese automaker to be a net exporter from the United States, exporting 108,705 Honda and Acura models while importing only 88,357</p>
</div>
<div class="clear"></div>
</div>
<div class="grids_of_2 top">
<div class="grid images_3_of_1">
<img src="../images/pic2.jpg">
</div>
<div class="grid span_2_of_3">
<h3>CEO of Honda</h3>
<p class="para">Kawamoto acted quickly to change Honda's corporate culture, rushing through market-driven product development that resulted in recreational vehicles such as the Odyssey[disambiguation needed] and the CR-V, and a refocusing away from some of the numerous sedans and coupes that were popular with Honda's engineers but not with the buying public. The most shocking change to Honda came when Kawamoto ended Honda's successful participation in Formula One after the 1992 season, citing costs in light of the takeover threat from Mitsubishi as well as the desire to create a more environmentally-friendly company image.[21]
Later, 1995 gave rise to the Honda Aircraft Company with the goal of producing jet aircraft under Honda's name</p>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</center>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="footer_bg">
<div class="wrap">
<div class="wrapper">
<div class="footer">
<div class="copy">
<p class="w3-link">© </p>
</div>
<div class="f_nav">
<ul>
<li>Skype</li>
<li>Linked in</li>
<li>Twitter</li>
<li>Facebook</li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</body>
</html>
</body>
</html>

You are missing a paranthesis in the isset in the check login function, also the function could be made simpler.
// I'd also put this function in some common file.
function check_login() {
return isset($_SESSION['login']) && $_SESSION['login'] != '';
}
// then in all other files you could include the common file, and do this
if (!check_login()) {
header('Location: login.php');
exit;
}

The best experience in this case will be to put check_login into smth like functions.php and insert this in files where you want to use it:
include "functions.php";
if(!check_login()) {
header('Location: login.php');
exit();
}
You can also try using Apache's native module mod_rewrite to handle large amount of such suffixed files.

Related

How to resolve end of file error in php code?

I am new to php. I have a sign up page that takes in few user details and makes an account. On running the code I get this error:
Parse error: syntax error, unexpected end of file on line 347
I have seen few other posts related to the same issue but I didnt find any of those helpful for my code. I have reviewed the code many times to see what I have done wrong but couldn't find my mistake. Please help with the statement or point where I have gone wrong. Thanks in advance.
My code is below:
sign-up.php
<!DOCTYPE html>
<html>
<head>
<title>My Trip Planner | Sign Up </title>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Xtreme Travel Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //for-mobile-apps -->
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/styles.css?v=1.6" rel="stylesheet">
<!-- js -->
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/scripts.js?v=1.7"></script>
<!-- //js -->
<!-- start-smoth-scrolling -->
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
});
});
</script>
<script type="text/javascript">
function formValidation()
{
var uid = document.registration.userid;
var passid = document.registration.passid;
var uemail = document.registration.email;
if(userid_validation(uid,5,12))
{
if(passid_validation(passid,7,12))
{
if(ValidateEmail(uemail))
{
}
}
}
return false;
}
function userid_validation(uid,mx,my)
{
var uid_len = uid.value.length;
if (uid_len == 0 || uid_len >= my || uid_len < mx)
{
alert("User Id should not be empty / length be between "+mx+" to "+my);
uid.focus();
return false;
}
return true;
}
function passid_validation(passid,mx,my)
{
var passid_len = passid.value.length;
if (passid_len == 0 ||passid_len >= my || passid_len < mx)
{
alert("Password should not be empty / length be between "+mx+" to "+my);
passid.focus();
return false;
}
return true;
}
function ValidateEmail(uemail)
{
var mailformat = /^\w+([\.-]?\w+)*#\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if(uemail.value.match(mailformat))
{
//alert("You have entered a valid email address!");
return true;
}
else
{
alert("You have entered an invalid email address!");
uemail.focus();
return false;
}
}
</script>
<!-- start-smoth-scrolling -->
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Comfortaa:400,300,700' rel='stylesheet' type='text/css'>
</head>
<?php
session_start();
if(!empty($_POST)) {
class MyDB extends SQLite3
{
function __construct()
{
$this->open('mytrip.db');
}
}
$db = new MyDB();
if(!$db){
echo $db->lastErrorMsg();
} else {
}
$id=null;
$pass=null;
$email=null;
$fname=null;
$lname=null;
$id_exists=false;
if (isset($_POST['uid'])) {
$id = $_POST['uid'];
}
if (isset($_POST['passid'])) {
$pass = $_POST['passid'];
}
if (isset($_POST['uemail'])) {
$email = $_POST['uemail'];
}
if (isset($_POST['first'])) {
$fname = $_POST['first'];
}
if (isset($_POST['last'])) {
$lname = $_POST['last'];
$result= "SELECT COUNT(*) FROM Users WHERE ID = '".$id. "';" ;
$count= $db->querySingle($result);
if ($count > 0)
{
$id_exists = true;
echo "This id is not available. Please enter a valid id. ";
}
else
{
$sql= " INSERT INTO Users (ID, PASSWORD, EMAIL, FNAME, LNAME)
VALUES ('$id','$pass','$email', '$fname', '$lname'); " ;
$ret = $db->query($sql);
$_SESSION['Id'] = $id;
header("location:index.php");
}
$db->close();
}
?>
<body>
<!-- banner -->
<div class="banner1">
<div class="navigation">
<div class="container-fluid">
<nav class="pull">
<ul class="nav">
<li> Home</li>
<li> About</li>
<li>Popular Places<span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span></li>
<ul class="nav-sub">
<li>Place 1</li>
<li>Place 2</li>
<li>Place 3</li>
</ul>
<script>
$( "li a.menu" ).click(function() {
$( "ul.nav-sub" ).slideToggle( 300, function() {
// Animation complete.
});
});
</script>
<li> Events</li>
<li> Mail us</li>
</ul>
</nav>
</div>
</div>
<div class="header-top">
<div class="container">
<div class="head-logo">
<span>M</span>y Trip Planner<i>Feeling Amazing Tour</i>
</div>
<div class="top-nav">
<div class="hero fa-navicon fa-2x nav_slide_button" id="hero">
<img src="images/menu.png" alt="">
</div>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
<!-- banner -->
<!-- sign-in -->
<div class="sign-in">
<div class="container">
<div class="in-form">
<h3>Register Here</h3>
<p class="use">Having hands on experience in creating innovative
designs,I do offer design solutions which harness.</p>
<div class="sign-in-form">
<div class="in-form Personal">
<h4>Personal Information</h4>
<form method="post" name='registration' onSubmit="return formValidation();">
<input type="text" placeholder="Firstname*" required=" " name="first">
<input type="text" placeholder="Lastname*" required=" " name="last">
<input type="text" placeholder="Emailaddress*" required=" " name="uemail">
<h4 class="kij">Login Information</h4>
<input type="text" placeholder="Id*" required=" " name="uid">
<input type="password" placeholder="Password*" required=" " name="passid">
<input type="password" placeholder="Confirm Password*" required=" ">
<input type="submit" value="submit">
</form>
</div>
</div>
</div>
</div>
</div>
<!-- //sign-in -->
<!-- footer-top -->
<div class="footer-top">
<div class="container">
<div class="col-md-3 footer-top-grid">
<h3>About <span> My Trip Planner</span></h3>
<p>Lets you plan the finest trips.</p>
</div>
<div class="col-md-3 footer-top-grid">
<h3>THE <span>TAGS</span></h3>
<div class="unorder">
<ul class="tag2">
<li>pool</li>
<li>gym</li>
<li>beach</li>
</ul>
<ul class="tag2">
<li>asian</li>
<li>thai</li>
<li>chinese</li>
<li>american</li>
</ul>
<ul class="tag2">
<li>theme park</li>
<li>wildlife</li>
<li>heritage</li>
</ul>
<ul class="tag2">
<li>shopping malls</li>
<li>local shops</li>
<li>boutiques</li>
</ul>
</div>
</div>
<div class="col-md-3 footer-top-grid">
<h3> User <span> Reviews</span></h3>
<ul class="twi">
<li>Location is close to empire state building and near bus stop. Staff was pleasant on check in.
<span></span></li>
<li>Outstanding food and service. Would return without hesitation.
<span></span></li>
<li>My wife and I love walking around and exploring cities. and New York is one of the few cities in USA you can enjoy doing that. SoHo has a great vibe about it, and we enjoyed walking around, grabbing a quick bite, and doing some shopping.
<span></span></li>
</ul>
</div>
<div class="col-md-3 footer-top-grid">
<h3> Popular <span> Destinations</span></h3>
<div class="flickr-grids">
<div class="flickr-grid">
<img src="images/minar.jpg" alt=" " class="img-responsive" />
</div>
<div class="flickr-grid">
<img src="images/bad.jpg" alt=" " class="img-responsive" />
</div>
<div class="flickr-grid">
<img src="images/kua1.jpg" alt=" " class="img-responsive" />
</div>
<div class="clearfix"> </div>
<div class="flickr-grid">
<img src="images/kua.jpg" alt=" " class="img-responsive" />
</div>
<div class="flickr-grid">
<img src="images/newyork.jpg" alt=" " class="img-responsive" />
</div>
<div class="flickr-grid">
<img src="images/can1.jpg" alt=" " class="img-responsive" />
</div>
<div class="clearfix"> </div>
</div>
</div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //footer-top -->
<!-- footer -->
<div class="footer">
<div class="container">
<div class="footer-left">
<ul>
<li><i>M</i>y Trip Planner<span> |</span></li>
<!-- <li><p>The awesome agency. <span>0800 (123) 4567 // Australia 746 PO</span></p></li> -->
</ul>
</div>
<div class="footer-right">
<p>© 2017 My Trip Planner. All rights reserved | </p>
</div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //footer -->
<!-- here stars scrolling icon -->
<script type="text/javascript">
$(document).ready(function() {
/*
var defaults = {
containerID: 'toTop', // fading element id
containerHoverID: 'toTopHover', // fading element hover id
scrollSpeed: 1200,
easingType: 'linear'
};
*/
$().UItoTop({ easingType: 'easeOutQuart' });
});
</script>
<!-- //here ends scrolling icon -->
</body>
</html>
you have this error because you miss "}" at line 141:
if (isset($_POST['last'])) {
$lname = $_POST['last'];
Add a closing bracket to line 141, so that the code is:
if (isset($_POST['last'])) {
$lname = $_POST['last'];
}
I tested your code locally and this is what fixed the syntax error.
What IDE or text editor do you use to write your code? I would suggest you something what points out such simple mistakes. For example netbeans for php or php storm, netbeans is free, php storm is not. Both of these editors will show to you your mistakes like this.

php get function not working in wordpress

Here i am trying to convert my html and css template in wordpress theme and i have four php files (1) index.php, (2) header.php, (3) feature.php and (4) footer.php.
In index.php files i am getting the other three files using function <?php get_header(); ?>, <?php get_feature (); ?>,<?php get_footer (); ?>.
Now on using function <?php get_header(); ?>,<?php get_footer (); ?> in index.php it shows the header and footer section but on including <?php get_feature (); ?> between header and footer it shows error indicating <?php get_feature (); ?>line saying "Fatal error: Call to undefined function get_feature() in C:\xampp\htdocs\Alvin Lemo\wordpress\wp-content\themes\alvinlimo\index.php on line 2" and does not show the feature section and footer section.
Below is what i have done
In index.php
<?php get_header (); ?>
<?php get_feature(); ?> <!--- Error Showing Line -->
<?php get_footer (); ?>
In header.php
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<!--- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>Alvin Lemo</title>
<meta name="description" content="">
<meta name="author" content="">
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Abel" rel="stylesheet">
<!-- Script
================================================== -->
<script src="js/modernizr.js"></script>
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="favicon.png" >
<?php wp_head (); ?>
</head>
<body>
<div id="myNav" class="overlay">
×
<div class="overlay-content">
<div class="container">
<h2 style="color:white">Please Login To Resere Your Fleet With Us</h2><br />
<form>
<div class="form-group">
<input class="form-control" id="email" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter email"><br /><br />
</div>
<div class="form-group">
<input class="form-control" id="pwd" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter password"><br /><br />
</div>
<div class="checkbox">
</div>
<button type="submit" class="btn btn-default">Rserve</button>
</form>
</div>
</div>
</div>
<div id="myNavv" class="overlay">
×
<div class="overlay-content">
<div class="container">
<h2 style="color:white">Please Register To Reserve Your Fleet </h2><br />
<form>
<div class="form-group">
<input class="form-control" id="email" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter FullName"><br /><br />
</div>
<div class="form-group">
<input class="form-control" id="email" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter email"><br /><br />
</div>
<div class="form-group">
<input class="form-control" id="pwd" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter password"><br /><br />
</div>
<button type="submit" class="btn btn-default">Register</button>
</form>
</div>
</div>
</div>
<!-- Header
================================================== -->
<header>
<div class="logo">
<a class="smoothscroll" href="#hero"><!--<img alt="" src="images/logo.png">-->
<h2>A.L.S</h2>
</a>
</div>
<nav id="nav-wrap">
<a class="mobile-btn" href="#nav-wrap" title="Show navigation">Show Menu</a>
<a class="mobile-btn" href="#" title="Hide navigation">Hide Menu</a>
<ul id="nav" class="nav">
<li><a class="smoothscroll" href="#features">EVENT TRANSPORTATION</a></li>
<li><a class="smoothscroll" href="#pricing">Services</a></li>
<li><a class="smoothscroll" href="#screenshots">OUR FLEET</a></li>
<li><a class="smoothscroll" href="#testimonials">Testimonials</a></li>
<li><a class="smoothscroll" href="#subscribe">CONTACT</a></li>
</ul> <!-- end #nav -->
</nav> <!-- end #nav-wrap -->
<ul class="header-social">
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-google-plus"></i></li>
</ul>
</header>
<!-- Header End -->
<!-- Homepage Hero
================================================== -->
<section id="hero">
<div class="row">
<div class="twelve columns">
<div class="hero-text">
<br /><br /><br />
<h1 class="responsive-headline">Welcome To Alvin's Limo</h1>
<p>
Little about alivin's limo services.
</p>
</div>
<br />
<div class="buttons">
<a class="button trial" onclick="openNav()">Reserve Fleet</a>
<a class="button learn-more smoothscroll" onclick="openNavv()">Register</a>
</div>
<br /><br /><br /><br /><br /><br /><br />
</div>
</div>
</section>
<!-- Homepage Hero end -->
In feature.php
<!-- Features Section
================================================== -->
<section id='features'>
<div class="row section-head">
<h1>EVENT TRANSPORTATION</h1>
<p>
We Fell Happy To Be Part Of Your Special Ocassion
</p>
</div>
<div class="row feature design">
<div class="six columns right">
<h3> Wedding Transporation</h3>
<p>LMake your "most memorable day" of your life more special by Alvin Wedding Limo Service.
Your weddings transportation will be most beautiful latest model limousine imaginable,
with all the special amenities you desire. Our chauffeurs are always on time, courteous,
and dressed in black suit. Let us take you to the church and from the church to the reception and
from the reception to the airport or any special place in Texas for your honeymoon. You don't need
to worry about coordinating transportation from each destination, we can help arrange your weddings
party pick-ups and drop-offs and everything in between. We do service all the hills country wedding
venues. Feel free to check our wedding reviews - WEDDINGWIRE-THE KNOTT.
</p>
</div>
<div class="six columns feature-media left">
<img src="images/fpt-112704-Wedding-Flowers.jpg" />
</div>
</div>
<div class="row feature responsive">
<div class="six columns left">
<h3>Wine Transportation.</h3>
<p>
Alvin Limousine Services share your passion for wine; that’s why we specialize in hills country
wine tours. We offer a diverse selection of vehicles ranging from sedans, stretch limousines to
transport you affordably in luxury, safety, and style! Leave the driving, directions, stress,
and traffic to us while our Chauffeur whisks you away to your perfect day!
Our impressive customer list is concrete evidence of our ability to outperform our competition,
consistently exceeding our customers’ expectations. We will make your tour the best tour you have
ever known. We have dedicated chauffeur that specialize in wine tours, Brewery and Vodka distillery.
</p>
</div>
<div class="six columns feature-media right">
<img src="images/wine-tours-preferrred-limo.jpg" />
</div>
</div>
<div class="row feature cross-browser">
<div class="six columns right">
<h3>Concert</h3>
<p>
Whether you want to see a Show, Concert, Opera, Symphony or any other fun thing you can think of,
Alvin Limos will provide you personal and reliable chauffeured Limousine.
Reserve luxury town car Sedan or our luxurious stretch limousine for hassle free ride
from navigation, traffic, and struggling the multitude of cars for parking. Roll up with
style to the front door of any events location you desire.
Let the professional Chauffeurs of Alvin Limousine Service take you to your next Concert,
Movie premier, Opera, Symphony or any night out events with comfort and style.
We get you there on time in safely and in style ; Alvin Limo will ensure you have the time of
your life. We are the Leader in providing a full Service Limousine Transportation.
</p>
</div>
<div class="six columns feature-media left">
<img src="images/thenextweb.jpg" />
<!--<img src="images/feature-image-3.png" alt="" />-->
</div>
</div>
<div class="row feature video">
<div class="six columns left">
<h3>ACL/SXSW/Austin 360</h3>
<p>
What you hear is true. With vibrant entertainment and culture, inspiring cuisine and stunning outdoor settings, Austin lets you create a soundtrack all your own. We're home to more than 250 music venues and a vibrant arts scene. So take a look around, and put Live Music Capital of the World® on your playlist. Whether you want to take ride thought Austin or plan a night out with friends and family we will do that in style. Alvin Limousine is a premier transportation when it comes to Austin Texas culture and events. Come one come all and let us drive though the ins and outs of this beautiful happening city.
Alvin Limousine staff are very discrete and confident with all our celebrities and movies stars that we have been transporting for years.
</p>
</div>
<div class="six columns feature-media right">
<img src="images/1ff7f709cd8ef280ec5f2b317f79ba14-2b32e6b5be7f48f4557299fc9db819c3.png" />
</div>
</div>
<div class="row feature cross-browser">
<div class="six columns right">
<h3>Convention Center</h3>
<p>
The Austin Convention Center, a premier facility located in the heart of the capital city’s downtown business district, has emerged as a leader in the convention and meeting industry.
Alvin’s Limousine Services is proud to be part of your success by providing you or your guests with a premier chauffeured services . We can accommodate small or large groups .
- Airport Transportations
- Shuttling your groups through out your meetings
- Advertising your business on our Cars. (Wrap the cars with your Logo or new Product.**Extra Fees apply)
</p>
</div>
<div class="six columns feature-media left">
<img src="images/ARATA_ISOZAKI_RHWL_QNCC_DOHA_QATAR_PAN_060313_0009.jpg" />
</div>
</div>
<div class="row feature responsive">
<div class="six columns left">
<h3>Circuits of America - Formula 1</h3>
<p>
Circuit Of The Americas is a multi-purpose facility that will host the most prestigious racing events in the world, including the Formula 1 United States Grand Prix. It is the first purpose-built Grand Prix facility in the U.S Austin Texas
Circuit of The Americas (COTA) in Austin, Texas, is the home of world championships and a world-class destination for premium sports and entertainment.
Alvin’s Limousine Services is proud to be the leading transportations in Austin Texas, we can provide you or your Guests with many VIP Packages that can suits your needs , from Town car service , SUV’s or Stretch Limousine ,we are your one stop solutions to your transportations for World-Class destination . For International reservations , Please use our 24/7 reservations systems for quick quote and complete reservation confirmed within one hour or you can
Skpe us at : Austinlimo
</p>
</div>
<div class="six columns feature-media right">
<img src="images/bQwIzE.jpg" />
</div>
</div>
<div class="row feature cross-browser">
<div class="six columns right">
<h3>Prom</h3>
<p>
Whether you want to see a Show, Concert, Opera, Symphony or any other fun thing you can think of, Alvin Limos will provide you personal and reliable chauffeured Limousine. Reserve luxury town car Sedan or our luxurious stretch limousine for hassle free ride from navigation, traffic, and struggling the multitude of cars for parking. Roll up with style to the front door of any events location you desire.
Let the professional Chauffeurs of Alvin Limousine Service take you to your next Concert, Movie premier, Opera, Symphony or any night out events with comfort and style.
We get you there on time in safely and in style ; Alvin Limo will ensure you have the time of your life. We are the Leader in providing a full Service Limousine Transportation.
</p>
</div>
<div class="six columns feature-media left">
<img src="images/prom-header.jpg" />
</div>
</div>
</section>
<!-- Features Section end -->
In footer.php
<!-- Footer
================================================== -->
<footer>
<div class="row">
<div class="six columns right-cols">
<div class="row">
<div class="columns">
<h2 class="address">Come Visit</h2>
<p>
7901 Cameron Rd Bldg3 Suite 312, Austin tx 78754<br>
</p>
</div>
<div class="columns last">
<h2 class="contact">Contact Us</h2>
<ul>
<li>512 300 1379</li>
<li>someone#woosite.com</li>
</ul>
</div>
</div>
</div>
<p class="copyright">© 2014 Alvin's Limousine Services | Design by <a>cts-Design Team</a></p>
<div id="go-top">
<a class="smoothscroll" title="Back to Top" href="#hero"><i class="icon-up-open"></i></a>
</div>
</div> <!-- Row End -->
</footer>
<!-- Footer End-->
<?php wp_footer (); ?>
<!-- Java Script
================================================== -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2 /jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.10.2.min.js"><\/script>')</script>
<script type="text/javascript" src="js/jquery-migrate-1.2.1.min.js">
</script>
<script src="js/jquery.flexslider.js"></script>
<script src="js/waypoints.js"></script>
<script src="js/jquery.fittext.js"></script>
<script src="js/jquery.fitvids.js"></script>
<script src="js/imagelightbox.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<script src="js/main.js">
</script>
</body>
</html>
Functions like get_header() and get_footer() are predefined WordPress functions. To get custom part of template we use
<?php get_template_part( string $slug, string $name = null ) ?>
As stated in documentation, patterns it uses to find files are:
{slug}.php
{slug}-{name}.php
If the theme contains no specified file then no template will be included.
The template is included using require, not require_once, so you may include the same template part multiple times.
Finally, this one should load your feature template:
<?php get_template_part( 'feature' ) ?>
Source: https://developer.wordpress.org/reference/functions/get_template_part/
You try to use an undefined function, that is maybe coming from a third party plugin. get_feature() is not a native WordPress function.
If you want to display the featured image, you can use get_the_post_thumbnail() (more details
Hope it helps

i have a simple HTML site and want to restrict its some pages via php login

The following is the HTML of the page that I want to restrict for regular users.
When someone tries to access this page then he/she must be logged in to view the details of the page. Please guide in this regards. How can I do that?
<head>
<title>Welcome to ULTRATEC</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<!-- Cufon -->
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/myradpro.font.js"></script>
<script type="text/javascript">
Cufon.replace('h1')('h2')('h3')('h4')('div.menu li');
</script>
<!-- flash script -->
<script type="text/javascript" src="js/flash_detect.v1.7.js"></script>
</head>
<body>
<div class="main">
<div class="header">
<div class="rss"><img src="images/logomain.png" width="218" border="0" /></div>
<div class="search">
<form id="form1" name="form1" method="post" action="">
<span>
<input name="q" type="text" class="keywords" id="textfield" maxlength="50" value="Search..." />
</span>
<input name="b" type="image" src="images/search.gif" class="button" />
</form>
</div>
<div class="clr"></div>
<div class="menu">
<div class="logo"><img src="images/logo.png" width="205" height="88" border="0" alt="logo" /></div>
<ul>
<li><span>Home</span></li>
<li><span>About Us</span></li>
<li><span>Inquiry form</span></li>
<li><span>Contact Us</span></li>
</ul>
<div class="clr"></div>
</div>
<div class="clr"></div>
</div>
<div id="slider">
<!-- start slideshow -->
<div class="flash_slider">
<script language="JavaScript" type="text/javascript">
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '100%',
'height', '400',
'src', 'piecemakerNoShadow',
'quality', 'high',
'pluginspage', 'http://www.adobe.com/go/getflashplayer_de',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'noscale',
'wmode', 'transparent',
'devicefont', 'false',
'id', 'piecemakerNoShadow',
'bgcolor', '#ffffff',
'name', 'piecemakerNoShadow',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'piecemakerNoShadow',
'salign', ''
); //end AC code
</script>
</div>
<div class="clr"></div>
<!-- end #slideshow -->
<div class="click_blog">
<div class="clr"></div></div>
</div>
<div class="clr"></div>
<div class="body">
<div class="body_resize">
<div class="right">
<h2>About Us<br /></h2>
<div class="left"><img src="images/online-order.png" border="0" /></div>
<p>The creation ultra tec dates back to 2001. The company has significantly and speedly grown to its current stature. We firmly and sincerely believe in quality. We reliably cater to various industrial sectors. Our major focus revolnes around the following: -</p>
<div>
<ul>
<li><strong>Strapping Solutions</strong></li>
<li><strong>Strapping Tools</strong></li>
<li><strong>Gluing Tachnology</strong></li>
</ul>
<ul>
<li><strong>Labelling & Packaging Glues</strong></li>
<li><strong>Case Palletising</strong></li>
<li><strong>Metal Marking Solutions</strong></li>
</ul>
<ul>
<li><strong>Screen Printing Mesh</strong></li>
<li><strong>Screen Printing Blades</strong></li>
</ul>
</div><div class="clr"></div>
<br /><br /><br /><br />
</div>
</div>
<div class="clr"></div>
</div>
<div class="footer">
</div>
</div>
</body>
</html>
Use Sessions
If the session is set, he's logged in. When he logs out, destroy the session.
Set the session when you login:
session_start();
$_SESSION['username'] = $_POST['username'];
Then on the restricted page do something like this:
session_start();
if (!isset($_SESSION['username'])) {
//redirect to where people who are not logged in should be.
} else {
//access to the page.
}
You need to have somthing like this:
Login page:
<?php
session_start() ;
(Here you check login data .If this login data is ok set username on session)
$_SESSION['username']= $username;
?>
On user page:
<?php
session_start();
if(isset($_SESSION['username'])){
echo "Hello ".$_SESSION['username'];
}
else
{
die("You don't have acces on this page");'
}
?>

How do I echo based on user level? (Other posts haven't helped much)

I'm having trouble with a user level system, I want to make different things appear based on if you are logged in or not and nothing I try has worked. I can echo a normal string just fine, but it I use an if statement to check user level I get nothing. I have a database with a sample user, and his user_level field is set to 1. The log in process is successful, here is what I have:
By the way, session_start(); is in the included base.php.
<!DOCTYPE html>
<html>
<?php
include "base.php";
?>
<head>
<title> Scenery Sample Site | Home</title>
<link href='http://fonts.googleapis.com/css?family=Lobster'
rel='stylesheet' type='text/css'>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
</head>
<div class="nav">
<div class="container">
<ul class="pull-left">
<li>Home</li>
<li>About Us</li>
<li>Pricing</li>
<li>Feedback</li>
</ul>
<ul class="pull-right">
<?php
if($_SESSION['user_level'] = 1) {
echo $username;
}
?>
</ul>
</div>
</div>
<div class="jumbotron">
<div class="container">
<h1>Scenery for your favourite<br> destinations!</h1>
<p>Learn more about our products by clicking the link below.</p>
<p>Visit our product page.</p>
</div>
</div>
<div class="we-offer">
<div class="container">
<div class="col-md-4">
<h3>Custom Building Models!</h3>
<p>All of our scenery models are custom made by our developers.</p>
<p><a>More Details Here!</a></p>
</div>
<div class= "col-md-4">
<h3>State of The Art Texturing!</h3>
<p>All of our scenery textures are custom, and of the highest quality. You will have to make sure you're not watching real life.</p>
<p><a>More Details Here!</a></p>
</div>
<div class="col-md-4">
<h3>Moving Jet-ways!</h3>
<p>A lot of competitors remove the functionality of moving jetways that fsx comes with. Well guess what, we don't!</p>
<p><a>More Details Here!</a></p>
</div>
</div>
<div class="container">
<div class="col-md-4">
<div class= "thumbnail">
<img src="http://goo.gl/ZRT5E6">
</div>
</div>
<div class= "col-md-4">
<div class= "thumbnail">
<img src="http://goo.gl/KsocGR">
</div>
</div>
<div class="col-md-4">
<div class= "thumbnail">
<img src="http://goo.gl/3UfG97">
</div>
</div>
</div>
</div>
</html>
You don't check the string, you try to assign it.
Remember: With a single = you assign to a variable, you don't check it.
Your have to do it like this:
if($_SESSION["user_level"] == 1) {
echo "fancy fancy";
}
I'll assume the rest of this, including setting that session value is correct, and say:
You're not using the correct operator. use a double "=".
if($_SESSION['user_level'] == 1) {
echo $username;
}
You are assigning instead of checking, this should help:
<?php
if($_SESSION['user_level'] == 1) {
echo $username;
}
?>

Trying to display something else if user is logged in?

first of all before I start excuse my mysql I know it's depreciated and I will update to PDO in the future. So here we go.
Basically I have duplicates of most of my pages, 'index.php', 'index2.php' so on and so forth. Basically right now all the pages without the number '2' are non registered users and once a user logs in they will be redirected to 'index2.php' and so all the number with '2' are registered users pages. So what I basically wanted to do is instead of having duplicate pages am I able to just have 'index.php' and other pages without duplicates? So user logs in will be redirected to 'index.php' but have the same features and 'index2.php'. If that makes any sense haha!
Registration page code:
<?php
session_start();
include ('../includes/config.php');
include ('../includes/header.php');
?>
<!doctype html>
<html>
<body>
<div class="search1">
<h2>Register</h2>
<form action="" method="POST">
<center>
<label>Username:</label>
<input type="text" name="username" required />
<label>Password:</label>
<input type="password" name="password" required />
<label>Email:</label>
<input type="email" name="email" required />
<input type="submit" value="Register" name="submit" class="submit" />
</center>
<br><br><br>
<h2><p>Back</p></h2>
</div>
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['username']) && !empty($_POST['password'])) {
$username=$_POST['username'];
$password=$_POST['password'];
$email=$_POST['email'];
$password = strip_tags($password);
$password = md5($password); // md5 is used to encrypt your password to make it more secure.
$con=mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('aha') or die("cannot select DB");
$query=mysql_query("SELECT * FROM login WHERE username='".$username."'");
$numrows=mysql_num_rows($query);
if($numrows==0)
{
$sql="INSERT INTO login(username,password,email) VALUES('$username','$password', '$email')";
$result=mysql_query($sql);
if($result){
echo "<div class='passed'>Account Successfully Created</div>";
} else {
echo "<div class='results'>Failure!</div>";
}
} else {
echo "<div class='results'>Username already exists!</div>";
}
} else {
echo "<div class='results'>All fields are required!</div>";
}
}
?>
</form>
<img src="../images/main.jpg">
</body>
</html>
INDEX1.PHP-CODE:
<?php
session_start();
include ('../includes/config.php');
include ('../includes/header.php');
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Honda |</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='http://fonts.googleapis.com/css?family=Julius+Sans+One' rel='stylesheet' type='text/css'>
<link href="../css/style.css" rel="stylesheet" type="text/css" media="all" />
<!--slider-->
<link href="../css/camera.css" rel="stylesheet" type="text/css" media="all" />
<script type='text/javascript' src='../js/jquery.min.js'></script>
<script type='text/javascript' src='../js/jquery.mobile.customized.min.js'></script>
<script type='text/javascript' src='../js/jquery.easing.1.3.js'></script>
<script type='text/javascript' src='../js/camera.min.js'></script>
<script>
jQuery(function(){
jQuery('#camera_wrap_1').camera({
thumbnails: true
});
jQuery('#camera_wrap_2').camera({
height: '400px',
loader: 'bar',
pagination: false,
thumbnails: true
});
});
</script>
</head>
<body>
<!--start header-->
<div class="h_bg">
<div class="wrap">
<div class="wrapper">
<div class="header">
<div class="logo">
<img src="../images/logo.png">
</div>
<div class="cssmenu">
<ul>
<li class="active"><span>Home</span></li>
<li><span>About</span></li>
<li class="has-sub"><span>Gallery</span>
</li>
<li class="last"><span>Contact</span></li>
<div class="clear"></div>
</ul>
<div class="search">
<h2>search</h2>
<form action="search.php" method="get">
<input type="text" name="search" value="" placeholder="Enter Your search...">
<input type="submit" name="submit" value="">
</form>
</div>
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['username']) && !empty($_POST['password'])) {
$username=$_POST['username'];
$password=$_POST['password'];
$password = strip_tags($password);
$password = md5($password); // md5 is used to encrypt your password to make it more secure.
$query=mysql_query("SELECT * FROM login WHERE username='".$username."' AND password='".$password."'");
$numrows=mysql_num_rows($query);
if($numrows!=0)
{
while($row=mysql_fetch_assoc($query))
{
$dbusername=$row['username'];
$dbpassword=$row['password'];
}
if($username == $dbusername && $password == $dbpassword)
{
session_start();
$_SESSION['sess_user']=$username;
/* Redirect browser */
header("Location: member.php");
}
} else {
echo "<div class='results'>Invalid username or password</div>";
}
} else {
echo "All fields are required!";
}
}
?>
<div class="search1">
<h2>login/Register</h2>
<form action="" method="POST">
<label>Username:</label>
<input type="text" id="password" name="username" required />
<label>Password:</label>
<input type="password" id="password" name="password" required />
<input type="submit" value="Login" name="submit" class="submit" />
<br><br>
<center>
<h2><p>Register</p></h2>
</center>
</form>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- start slider -->
<div class="slider_bg">
<div class="wrap">
<div class="wrapper">
<div class="slider">
<!-- #camera_wrap_1 -->
<div class="fluid_container">
<div class="camera_wrap camera_azure_skin" id="camera_wrap_1">
<div data-thumb="../images/thumbs/slider1.jpg" data-src="../images/slider/slider1.jpg">
</div>
<div data-thumb="../images/thumbs/slider2.jpg" data-src="../images/slider/slider2.jpg">
</div>
<div data-thumb="../images/thumbs/slider3.jpg" data-src="../images/slider/slider3.jpg">
</div>
<div data-thumb="../images/thumbs/slider4.jpg" data-src="../images/slider/slider4.jpg">
</div>
</div><!-- #camera_wrap_1 -->
<div class="clear"></div>
</div>
<!-- end #camera_wrap_1 -->
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- start content -->
<div class="content_bg">
<div class="wrap">
<div class="wrapper">
<div class="main">
<!-- start content_right -->
<div class="image group">
<div class="grids_of_2">
<div class="grid images_3_of_1">
<img src="../images/pic1.jpg">
</div>
<div class="grid span_2_of_3">
<h3>How it all started</h3>
<p class="para">Honda Motor Co., Ltd. (本田技研工業株式会社 Honda Giken Kōgyō KK?, IPA: [hoɴda] ( listen); /ˈhɒndə/) is a Japanese public multinational corporation primarily known as a manufacturer of automobiles, motorcycles and power equipment.
Honda has been the world's largest motorcycle manufacturer since 1959,[3][4] as well as the world's largest manufacturer of internal combustion engines measured by volume, producing more than 14 million internal combustion engines each year.[5] Honda became the second-largest Japanese automobile manufacturer in 2001.[6][7] Honda was the eighth largest automobile manufacturer in the world behind General Motors, Volkswagen Group, Toyota, Hyundai Motor Group, Ford, Nissan, and PSA in 2011.[8]
Honda was the first Japanese automobile manufacturer to release a dedicated luxury brand, Acura, in 1986. Aside from their core automobile and motorcycle businesses, Honda also manufactures garden equipment, marine engines, personal watercraft and power generators, amongst others. Since 1986, Honda has been involved with artificial intelligence/robotics research and released their ASIMO robot in 2000. They have also ventured into aerospace with the establishment of GE Honda Aero Engines in 2004 and the Honda HA-420 HondaJet, which began production in 2012. Honda has three joint-ventures in China (Honda China, Dongfeng Honda, and Guangqi Honda).
In 2013, Honda invested about 5.7% (US$ 6.8 billion) of its revenues in research and development.[9] Also in 2013, Honda became the first Japanese automaker to be a net exporter from the United States, exporting 108,705 Honda and Acura models while importing only 88,357</p>
</div>
<div class="clear"></div>
</div>
<div class="grids_of_2 top">
<div class="grid images_3_of_1">
<img src="../images/pic2.jpg">
</div>
<div class="grid span_2_of_3">
<h3>CEO of Honda</h3>
<p class="para">Kawamoto acted quickly to change Honda's corporate culture, rushing through market-driven product development that resulted in recreational vehicles such as the Odyssey[disambiguation needed] and the CR-V, and a refocusing away from some of the numerous sedans and coupes that were popular with Honda's engineers but not with the buying public. The most shocking change to Honda came when Kawamoto ended Honda's successful participation in Formula One after the 1992 season, citing costs in light of the takeover threat from Mitsubishi as well as the desire to create a more environmentally-friendly company image.[21]
Later, 1995 gave rise to the Honda Aircraft Company with the goal of producing jet aircraft under Honda's name</p>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</center>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="footer_bg">
<div class="wrap">
<div class="wrapper">
<div class="footer">
<div class="copy">
<p class="w3-link">© </p>
</div>
<div class="f_nav">
<ul>
<li>Skype</li>
<li>Linked in</li>
<li>Twitter</li>
<li>Facebook</li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</body>
</html>
</body>
</html>
Least but not last! INDEX2.PHP-CODE:
<?php
session_start();
include "../includes/config.php";
include "function.php";
include ('../includes/header.php');
?>
<!DOCTYPE HTML>
<html>
<head>
<style>
#error_box{display:none; position:relative;top:-25px}
</style>
<title>Honda |</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='http://fonts.googleapis.com/css?family=Julius+Sans+One' rel='stylesheet' type='text/css'>
<link href="../css/style.css" rel="stylesheet" type="text/css" media="all" />
<!--slider-->
<link href="../css/camera.css" rel="stylesheet" type="text/css" media="all" />
<script type='text/javascript' src='../js/jquery.min.js'></script>
<script type='text/javascript' src='../js/jquery.mobile.customized.min.js'></script>
<script type='text/javascript' src='../js/jquery.easing.1.3.js'></script>
<script type='text/javascript' src='../js/camera.min.js'></script>
<script>
jQuery(function(){
jQuery('#camera_wrap_1').camera({
thumbnails: true
});
jQuery('#camera_wrap_2').camera({
height: '400px',
loader: 'bar',
pagination: false,
thumbnails: true
});
});
</script>
</head>
<body>
<!--start header-->
<div class="h_bg">
<div class="wrap">
<div class="wrapper">
<div class="header">
<div class="logo">
<img src="../images/logo.png">
</div>
<div class="cssmenu">
<ul>
<li class="active"><span>Home</span></li>
<li><span>About</span></li>
<li class="has-sub"><span>Gallery</span>
</li>
<li class="last"><span>Contact</span></li>
<div class="clear"></div>
</ul>
<div class="search">
<h2>search</h2>
<form>
<input type="text" value="" placeholder="Enter Your search...">
<input type="submit" value="">
</form>
</div>
<div class="search1">
<form action="" method="POST">
<br>
<h2>Welcome, <?=$_SESSION['sess_user'];?>!</h2><br><br>
<div class="pw">
<h3>Change details</h3>
</div>
<br><br>
<h2>Logout</h2>
</form>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- start slider -->
<div class="slider_bg">
<div class="wrap">
<div class="wrapper">
<div class="slider">
<!-- #camera_wrap_1 -->
<div class="fluid_container">
<div class="camera_wrap camera_azure_skin" id="camera_wrap_1">
<div data-thumb="../images/thumbs/slider1.jpg" data-src="../images/slider/slider1.jpg">
</div>
<div data-thumb="../images/thumbs/slider2.jpg" data-src="../images/slider/slider2.jpg">
</div>
<div data-thumb="../images/thumbs/slider3.jpg" data-src="../images/slider/slider3.jpg">
</div>
<div data-thumb="../images/thumbs/slider4.jpg" data-src="../images/slider/slider4.jpg">
</div>
</div><!-- #camera_wrap_1 -->
<div class="clear"></div>
</div>
<!-- end #camera_wrap_1 -->
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- start content -->
<div class="content_bg">
<div class="wrap">
<div class="wrapper">
<div class="main">
<!-- start content_right -->
<div class="image group">
<div class="grids_of_2">
<div class="grid images_3_of_1">
<img src="../images/pic1.jpg">
</div>
<div class="grid span_2_of_3">
<h3>How it all started</h3>
<p class="para">Honda Motor Co., Ltd. (本田技研工業株式会社 Honda Giken Kōgyō KK?, IPA: [hoɴda] ( listen); /ˈhɒndə/) is a Japanese public multinational corporation primarily known as a manufacturer of automobiles, motorcycles and power equipment.
Honda has been the world's largest motorcycle manufacturer since 1959,[3][4] as well as the world's largest manufacturer of internal combustion engines measured by volume, producing more than 14 million internal combustion engines each year.[5] Honda became the second-largest Japanese automobile manufacturer in 2001.[6][7] Honda was the eighth largest automobile manufacturer in the world behind General Motors, Volkswagen Group, Toyota, Hyundai Motor Group, Ford, Nissan, and PSA in 2011.[8]
Honda was the first Japanese automobile manufacturer to release a dedicated luxury brand, Acura, in 1986. Aside from their core automobile and motorcycle businesses, Honda also manufactures garden equipment, marine engines, personal watercraft and power generators, amongst others. Since 1986, Honda has been involved with artificial intelligence/robotics research and released their ASIMO robot in 2000. They have also ventured into aerospace with the establishment of GE Honda Aero Engines in 2004 and the Honda HA-420 HondaJet, which began production in 2012. Honda has three joint-ventures in China (Honda China, Dongfeng Honda, and Guangqi Honda).
In 2013, Honda invested about 5.7% (US$ 6.8 billion) of its revenues in research and development.[9] Also in 2013, Honda became the first Japanese automaker to be a net exporter from the United States, exporting 108,705 Honda and Acura models while importing only 88,357</p>
</div>
<div class="clear"></div>
</div>
<div class="grids_of_2 top">
<div class="grid images_3_of_1">
<img src="../images/pic2.jpg">
</div>
<div class="grid span_2_of_3">
<h3>CEO of Honda</h3>
<p class="para">Kawamoto acted quickly to change Honda's corporate culture, rushing through market-driven product development that resulted in recreational vehicles such as the Odyssey[disambiguation needed] and the CR-V, and a refocusing away from some of the numerous sedans and coupes that were popular with Honda's engineers but not with the buying public. The most shocking change to Honda came when Kawamoto ended Honda's successful participation in Formula One after the 1992 season, citing costs in light of the takeover threat from Mitsubishi as well as the desire to create a more environmentally-friendly company image.[21]
Later, 1995 gave rise to the Honda Aircraft Company with the goal of producing jet aircraft under Honda's name</p>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</center>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="footer_bg">
<div class="wrap">
<div class="wrapper">
<div class="footer">
<div class="copy">
<p class="w3-link">© </p>
</div>
<div class="f_nav">
<ul>
<li>Skype</li>
<li>Linked in</li>
<li>Twitter</li>
<li>Facebook</li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</body>
</html>
</body>
</html>
Any help is greatly appreciated! Thanks!
This is a really poor design, but i hope, you will get the logic.
session_start();
if (!empty($_POST["username"]) && !empty($_POST["password"])) {
//If form has submitted
//Get user from database.
if ($numrows > 0) {
$_SESSION["loggedIn"] = true;
//You can set here more session things, like username, email, etc...
} else {
$_SESSION["loggedIn"] = false;
}
}
if (empty($_SESSION["loggedIn"])) {
//Show content if user is not logged in.
//You can include your file here, when user not logged in
} else {
//Show content if user is logged in.
//You can include your file here
//The best practice, if you are redirect to the user here to another page.
//Do this check in all page, when user needs to be logged in
}
//HTML code comes here.

Categories