Experiencing Undefined Index and session already started - php

I have tried some answers given here on stackoverflow relating to undefined index and session already started, but still dont seem to get whats wrong.
the below code is the whole code in the index.php file
Please someone should guide me or assist me on what im doing wrongly or didnt get right.
<?php
// check for minimum PHP version
if (version_compare(PHP_VERSION, '5.3.7', '<')) {
exit('Sorry, this script does not run on a PHP version smaller than 5.3.7 !');
} else if (version_compare(PHP_VERSION, '5.5.0', '<')) {
// if you are using PHP 5.3 or PHP 5.4 you have to include the password_api_compatibility_library.php
// (this library adds the PHP 5.5 password hashing functions to older versions of PHP)
require_once('./php-login-advanced-master/libraries/password_compatibility_library.php');
}
// include the config
require_once('./php-login-advanced-master/config/config.php');
// include the to-be-used language, english by default. feel free to translate your project and include something else
require_once('./php-login-advanced-master/translations/en.php');
// include the PHPMailer library
require_once('./php-login-advanced-master/libraries/PHPMailer.php');
// load the login class
require_once('./php-login-advanced-master/classes/Login.php');
// load match class
require_once('./php_scrips/matching.php');
// load the registration class
require_once('./php-login-advanced-master/classes/Registration.php');
// create the registration object. when this object is created, it will do all registration stuff automatically
// so this single line handles the entire registration process.
$registration = new Registration();
// create a login object. when this object is created, it will do all login/logout stuff automatically
// so this single line handles the entire login process.
$login = new Login();
//create a match object
$match = new match();
?>
<body>
<ul class="nav navbar-right top-nav">
<li class="dropdown">
<i class="fa fa-user"></i> <?php echo $_SESSION[user_name] ?> <b class="caret"></b>
<ul class="dropdown-menu">
<?php
if(isset($_SESSION['user_email'])){
echo '
<li><i class="fa fa-dashboard"></i> My Dashboard</li>
<li><i class="fa fa-user"></i> My Profile</li>';
if($_SESSION['user_level']=='ADMINISTRATOR'){
echo '<li>Rematch Member</li>
<li>Set User Recovery Question</li>
<li>Rematch Admins</li>';
}
echo '
<li><i class="fa fa-warning"></i> Pending Payments</li>
<li><i class="fa fa-money"></i> Paid Members</li>
<li class="divider"></li>
<li>
<i class="fa fa-fw fa-power-off"></i> Log Out
</li>';
}?>
</ul>
</li>
</ul>
<?php
if(isset($_SESSION['user_email'])){
echo '<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
<li class="active"><i class="fa fa-dashboard"></i> My Dashboard</li>
<li><i class="fa fa-user"></i> My Profile</li>';
if($_SESSION['user_level']=='ADMINISTRATOR'){
echo '<li>Rematch Member</li>
<li>Set User Recovery Question</li>
<li>Rematch Admins</li>';
}
echo '
<li><i class="fa fa-warning"></i> Pending Payments</li>
<li><i class="fa fa-money"></i> Paid Members</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</nav>
<div id="page-wrapper">
<div class="container-fluid">
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Dashboard <small>Statistics Overview</small>
</h1>
<ol class="breadcrumb">
<li class="active">
<i class="fa fa-dashboard"></i> Dashboard
</li>
</ol>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-12">
<div class="alert alert-info alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="fa fa-info-circle"></i> <strong>Please note that your account will be automatically deleted once you complete your cycle.<br/>To continue with the TapFortune system for the 2nd or as many times as posible, you have to register for every cycle.
</div>
</div>
</div>
<!-- /.row -->';
$match->to_pay($_SESSION['user_to_pay'],$_SESSION['user_status']);
$match->to_get($_SESSION['user_email'],$_SESSION['user_status']);
echo '<!--
<div class="row">
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-clock-o fa-fw"></i> Last 10 Sign Ups</h3>
</div>
<div class="panel-body">
<div class="list-group">
<a href="#" class="list-group-item">
<span class="badge">just now</span>
<i class="fa fa-fw fa-user"></i> Egere Samuel
</a>
<a href="#" class="list-group-item">
<span class="badge">just now</span>
<i class="fa fa-fw fa-user"></i> Egere Samuel
</a>
<a href="#" class="list-group-item">
<span class="badge">just now</span>
<i class="fa fa-fw fa-user"></i> Egere Samuel
</a>
<a href="#" class="list-group-item">
<span class="badge">just now</span>
<i class="fa fa-fw fa-user"></i> Egere Samuel
</a>
</div>
<div class="text-right">
See More <i class="fa fa-arrow-circle-right"></i>
</div>
</div>
</div>
</div>
</div>-->
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->';
}
if(!isset($_SESSION['user_email']) && !isset($_GET['reg']) && !isset($_GET['password_rest']) && !isset($_SESSION['user_reset'])){
echo '<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
<li class="active">Login</li>
<li>Sign Up</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</nav>
<div id="page-wrapper">
<div class="container-fluid">
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Login
</h1>
<ol class="breadcrumb">
<li class="active">
<i class="fa fa-dashboard"></i> Login
</li>
</ol>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-xs-1 col-sm-3 col-md-3 col-lg-4"></div>
<div class="col-xs-10 col-sm-6 col-md-6 col-lg-4" style="margin-bottom:200px">'
.$registration->messages['recovery_reset_successful'].'
<form method="post" enctype="application/x-www-form-urlencoded">
<div class="form-group">
<label for="username">Email</label>
<input type="text" name="user_name" class="form-control" placeholder="Enter Email">
</div>'
.$login->errors['invalid_email'].'
<div class="form-group">
<label for="username">Password</label>
<input type="password" name="user_password" class="form-control" placeholder="Enter Password">
</div>'
.$login->errors['Login_failed'].$login->errors['wrong_password'].'
<div class="checkbox">
<label>
<input type="checkbox" name="user_rememberme" value="1">
Remember me </label>
</div>
<div>
<input type="submit" name="login" value="Sign In" class="btn btn-success btn-block" style="font-size:18px; font-weight:900" />
</div>
<div>
Forgotten password
</div>
</form>
</div>
<div class="col-xs-1 col-sm-3 col-md-3 col-lg-4"></div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->';
}
if(!isset($_SESSION['user_email']) && isset($_GET['password_rest'])){
echo '<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
<li class="active">Login</li>
<li>Sign Up</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</nav>
<div id="page-wrapper">
<div class="container-fluid">
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Password Reset
</h1>
<ol class="breadcrumb">
<li class="active">
<i class="fa fa-dashboard"></i> Password Reset
</li>
</ol>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-xs-1 col-sm-3 col-md-3 col-lg-4"></div>
<div class="col-xs-10 col-sm-6 col-md-6 col-lg-4" style="margin-bottom:200px">
<form method="post" enctype="application/x-www-form-urlencoded">
<div class="form-group">
<label for="username">Email</label>
<input type="text" name="user_email" class="form-control" placeholder="Enter Email">
</div>'
.$registration->errors['user_email_error'].'
<div class="form-group">
<label for="user_question">Recovery Question:
<select name="user_question" class="form-control">
<option value="" selected="selected">select Recovery Question</option>
<option value="1">My pets name</option>
<option value="2">Mothers maiden name</option>
<option value="3">My First car</option>
<option value="4">My favourite uncle\'s name</option>
<option value="5">My favourite childs name</option>
</select>
</label>
'.$registration->errors['recovery_question'].'
</div>
<div class="form-group">
<label for="user_answer">Answer:
<input type="text" name="user_answer" class="form-control"/>
'.$registration->errors['recovery_answer'].'
</label>
</div>
<div>
<input type="submit" name="verify_me" value="Verify Me" class="btn btn-success btn-block" style="font-size:18px; font-weight:900" />
</div>
</form>
</div>
<div class="col-xs-1 col-sm-3 col-md-3 col-lg-4"></div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->';
}
if(!isset($_SESSION['user_email']) && isset($_SESSION['user_reset'])){
echo '<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
<li class="active">Login</li>
<li>Sign Up</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</nav>
<div id="page-wrapper">
<div class="container-fluid">
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Password Reset
</h1>
<ol class="breadcrumb">
<li class="active">
<i class="fa fa-dashboard"></i> Password Reset
</li>
</ol>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-xs-1 col-sm-3 col-md-3 col-lg-4"></div>
<div class="col-xs-10 col-sm-6 col-md-6 col-lg-4" style="margin-bottom:200px">'
.$registration->messages['recovery_reset_successful'].'
<form method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="user_email" value="'.$_SESSION['user_reset'].'">
<div class="form-group">
<label for="username">New Password</label>
<input type="text" name="user_password" class="form-control" placeholder="Enter New Password">
</div>
<div class="form-group">
<label for="username">Repeat Password</label>
<input type="text" name="user_password_repeat" class="form-control" placeholder="Repeat New Password">
</div>'
.$registration->errors['user_password_error'].''
.$registration->errors['user_password_repeat_error'].'
<div>
<input type="submit" name="password_rest" value="Reset Password" class="btn btn-success btn-block" style="font-size:18px; font-weight:900" />
</div>
</form>
</div>
<div class="col-xs-1 col-sm-3 col-md-3 col-lg-4"></div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->';
}
if(!isset($_SESSION['user_email']) && isset($_GET['reg'])){
echo '<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
<li>Login</li>
<li class="active">Sign Up</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</nav>
<div id="page-wrapper">
<div class="container-fluid">
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Sign Up
<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<div class="row">
<div class="col-lg-12">
<div class="alert alert-info alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="fa fa-info-circle"></i> <strong>Please we advice you have your mobile banking available to you in order to avoid being removed from the system due to inability to pay in 24 hours.
</div>
</div>
</div>
<!-- /.row -->
<div class="row">
<div class="col-xs-12 col-sm-10" style="padding-top:30px; padding-bottom:5px">
'.$registration->messages['success'].'
'.$registration->errors['registration_error'].'
<form method="post">
<label for="mobile_number">Phone:
<input type="text" name="mobile_number" class="form-control" />
'.$registration->errors['mobile_number_error'].'
</label><br />
<label for="user_email">Email:
<input type="email" name="user_email" class="form-control"/>
'.$registration->errors['user_email_error'].'
</label><br />
<label for="user_password_new">Password:
<input type="password" name="user_password_new" class="form-control"/>
'.$registration->errors['user_password_error'].'
</label><br />
<label for="user_password_repeat">Repeat Password:
<input type="password" name="user_password_repeat" class="form-control" />
'.$registration->errors['user_password_repeat_error'].'
</label><br />
<label for="user_amount">Amount to Cycle:
<select name="user_amount" class="form-control">
<option value="" selected="selected">Amount to cycle</option>
<option value="10,000">N 10,000</option>
<option value="20,000">N 20,000</option>
<option value="50,000">N 50,000</option>
<option value="100,000">N 100,000</option>
</select>
'.$registration->errors['user_amount_error'].'
</label><br />
<label for="user_name">Account Name(Name As it shows in your account):
<input type="text" name="user_name" class="form-control"/>
'.$registration->errors['user_name_error'].'
</label><br />
<label for="user_account_number">Account Number:
<input type="number" name="user_account_number" class="form-control"/>
'.$registration->errors['user_account_number_error'].'
</label><br />
<label for="user_bank_name">Bank Name:
<input type="text" name="user_bank_name" class="form-control"/>
'.$registration->errors['user_bank_name_error'].'
</label><br />
<label for="email">Country:
<select name="country" class="form-control">
<option value="Nigeria" selected="selected">Nigeria</option>
</select>
'.$registration->errors['country_error'].'
</label><br />
<label for="user_question">Recovery Question:
<select name="user_question" class="form-control">
<option value="" selected="selected">select Recovery Question</option>
<option value="1">My pets name</option>
<option value="2">Mothers maiden name</option>
<option value="3">My First car</option>
<option value="4">My favourite uncle\'s name</option>
<option value="5">My favourite childs name</option>
</select>
</label><br />
'.$registration->errors['recovery_question'].'
<label for="user_answer">Answer:
<input type="text" name="user_answer" class="form-control"/>
'.$registration->errors['recovery_answer'].'
</label><br />
<img src="./php-login-advanced-master/tools/showCaptcha.php" alt="captcha" /><br />
<label for="captcha">Enter the captcha above
<input type="text" name="captcha" required class="form-control"/>
</label>
'.$registration->errors['captcha_error'].'<br />
<input type="submit" name="register" value="SIGN UP" class="btn btn-success"/>
</form>
';
}?>
Registration.php session part
public function __construct()
{
session_start();
// if we have such a POST request, call the registerNewUser() method
if (isset($_POST["register"])) {
$this->registerNewUser($_POST['user_name'], $_POST['user_email'], $_POST['user_password_new'], $_POST['user_password_repeat'], $_POST["captcha"], $_POST['mobile_number'],$_POST['country'],$_POST['user_account_number'],$_POST['user_bank_name'],$_POST['user_question'],$_POST['user_answer'],$_POST['user_amount']);
}
// if we have such a POST request, call the verifyUser() method
if (isset($_POST["verify_me"])) {
$this->verifyUser($_POST['user_email'], $_POST['user_question'], $_POST['user_answer']);
}
// if we have such a POST request, call the reset_recovery() method
if (isset($_POST["reset_recovery"])) {
$this->reset_recovery($_POST['user_email'], $_POST['user_question'], $_POST['user_answer']);
}
// if we have such a POST request, call the reset_recovery() method
if (isset($_POST["password_rest"])) {
$this->reset_password($_POST['user_email'], $_POST['user_password'], $_POST['user_password_repeat']);
}
}
Session was also stated in the login file...
This is the error message i get:
PHP Notice: A session had already been started - ignoring session_start() in php-login-advanced-master/classes/Registration.php on line 39
PHP Notice: Use of undefined constant user_name - assumed 'user_name' in index.php on line 125
PHP Notice: Undefined index: user_name in index.php on line 125
PHP Notice: Undefined index: recovery_reset_successful in index.php on line 272
PHP Notice: Undefined index: invalid_email in index.php on line 278
PHP Notice: Undefined index: Login_failed in index.php on line 283
PHP Notice: Undefined index: wrong_password in index.php on line 283

Related

Second tab not showing in form boostrap

This my code
I have a form with bootstrap and 2 tabs, when I display the form shows the first tab, but when I click on the second tab nothing happens.
I dont know what I missing.......................................
...............................................................
<div class="container" style="margin-top:70px">
<div class ="card bg-light col-8">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs pull-left">
<li class="nav-item">
<a class="nav-link active" href="#contactos">Contactos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#domicilio">Domicilio</a>
</li>
</ul>
</div>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])."?opc=".$opc."&id=".$id;?>" method="post" id ="formulario" class="tab-content">
<div class="tab-pane fade show active" id="contactos">
<div class="form-row" > <!--linea1-->
<div class="col-3">
<div class="form-group">
<label for="text1">ID</label>
<input id="text1" name="text1" type="text" class="form-control" value="<?php echo $campo1?>" readonly>
</div>
</div>
</div> <!--linea1-->
</div> <!--tab contacto-->
<div class="tab-pane fade" id="domicilio">
<div class="form-row" > <!--linea5-->
<div class="col">
<div class="form-group">
<label for="text11">Calle</label>
<input id="text11" name="text11" type="text" class="form-control" value="<?php echo $campo11?>" required <?php if ($opc == 'C'){echo "readonly";}?>>
<span class="error"><?php echo $error_text11;?></span>
</div>
</div>
</div> <!--linea5-->
</div> <!--tab domicilio-->
<div class="form-row"> <!--linea9-->
<div class="col-6">
<div class="form-group">
Cancelar
<button name="submit" type="submit" class="btn btn-primary">Confirmar</button>
</div>
</div>
</div> <!--linea9-->
</form>
</div>
</div>
for bootstrap 5 as per docs you need to add data-bs-toggle="tab" data-bs-target="#{tabID}" type="button" role="tab" aria-controls="{tabID}" aria-selected="true" to the a tag with class nav-link
so your code should be
<div class="container" style="margin-top:70px">
<div class ="card bg-light col-8">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs pull-left">
<li class="nav-item">
<a class="nav-link active" href="#contactos" data-bs-toggle="tab" data-bs-target="#contactos" type="button" role="tab" aria-controls="contactos" aria-selected="true">Contactos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#domicilio" data-bs-toggle="tab" data-bs-target="#domicilio" type="button" role="tab" aria-controls="domicilio" aria-selected="true">Domicilio</a>
</li>
</ul>
</div>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])."?opc=".$opc."&id=".$id;?>" method="post" id ="formulario" class="tab-content">
<div class="tab-pane fade show active" id="contactos">
<div class="form-row" > <!--linea1-->
<div class="col-3">
<div class="form-group">
<label for="text1">ID</label>
<input id="text1" name="text1" type="text" class="form-control" value="<?php echo $campo1?>" readonly>
</div>
</div>
</div> <!--linea1-->
</div> <!--tab contacto-->
<div class="tab-pane fade" id="domicilio">
<div class="form-row" > <!--linea5-->
<div class="col">
<div class="form-group">
<label for="text11">Calle</label>
<input id="text11" name="text11" type="text" class="form-control" value="<?php echo $campo11?>" required <?php if ($opc == 'C'){echo "readonly";}?>>
<span class="error"><?php echo $error_text11;?></span>
</div>
</div>
</div> <!--linea5-->
</div> <!--tab domicilio-->
<div class="form-row"> <!--linea9-->
<div class="col-6">
<div class="form-group">
Cancelar
<button name="submit" type="submit" class="btn btn-primary">Confirmar</button>
</div>
</div>
</div> <!--linea9-->
</form>
</div>
</div>
working example JSfiddle
Edit:
if you are using bootstrap 4 just remove -bs from the data attributes so it would be data-toggle="tab" data-target="#{tabID}" type="button" role="tab" aria-controls="{tabID}" aria-selected="true"
<div class="container" style="margin-top:70px">
<div class ="card bg-light col-8">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs pull-left">
<li class="nav-item">
<a class="nav-link active" href="#contactos" data-toggle="tab" data-target="#contactos" type="button" role="tab" aria-controls="contactos" aria-selected="true">Contactos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#domicilio" data-toggle="tab" data-target="#domicilio" type="button" role="tab" aria-controls="domicilio" aria-selected="true">Domicilio</a>
</li>
</ul>
</div>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"])."?opc=".$opc."&id=".$id;?>" method="post" id ="formulario" class="tab-content">
<div class="tab-pane fade show active" id="contactos">
<div class="form-row" > <!--linea1-->
<div class="col-3">
<div class="form-group">
<label for="text1">ID</label>
<input id="text1" name="text1" type="text" class="form-control" value="<?php echo $campo1?>" readonly>
</div>
</div>
</div> <!--linea1-->
</div> <!--tab contacto-->
<div class="tab-pane fade" id="domicilio">
<div class="form-row" > <!--linea5-->
<div class="col">
<div class="form-group">
<label for="text11">Calle</label>
<input id="text11" name="text11" type="text" class="form-control" value="<?php echo $campo11?>" required <?php if ($opc == 'C'){echo "readonly";}?>>
<span class="error"><?php echo $error_text11;?></span>
</div>
</div>
</div> <!--linea5-->
</div> <!--tab domicilio-->
<div class="form-row"> <!--linea9-->
<div class="col-6">
<div class="form-group">
Cancelar
<button name="submit" type="submit" class="btn btn-primary">Confirmar</button>
</div>
</div>
</div> <!--linea9-->
</form>
</div>
</div>
working fiddle for bootstrap 4

How do I dynamically populate modal from PHP server side product data?

I am retrieving some products from the database using PHP and MySQL. I am displaying these products in a carousel. When the user hovers, a "Show Quick Details" button will appear.
When the user clicks that button, a modal shows up displaying the product details.
Example:
Here is the modal when the user clicks.... (no, the products don't match right now, I am using a template the client gave me with example images ).
User Clicks Button:
My question is, how do I go about populating the modal with the correct product information? Do I have to create 10 modals dynamically in my PHP , or is there a better route? I am kinda stumped on how to approach this.
Here is the modal I am using, in case that is helpful for an answer:
<!--====== Quick View Part Start ======-->
<!-- Modal -->
<div class="modal fade " id="productQuickModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<i class="fal fa-times"></i>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="product-quick-view-image mt-30">
<div class="quick-view-image">
<div class="single-view-image">
<img src="images/product-17.jpg" alt="product">
</div>
<div class="single-view-image">
<img src="images/product-18.jpg" alt="product">
</div>
<div class="single-view-image">
<img src="images/product-19.jpg" alt="product">
</div>
<div class="single-view-image">
<img src="images/product-20.jpg" alt="product">
</div>
<div class="single-view-image">
<img src="images/product-21.jpg" alt="product">
</div>
</div>
<ul class="quick-view-thumb">
<li>
<div class="single-thumb">
<img src="images/product-17.jpg" alt="">
</div>
</li>
<li>
<div class="single-thumb">
<img src="images/product-18.jpg" alt="">
</div>
</li>
<li>
<div class="single-thumb">
<img src="images/product-19.jpg" alt="">
</div>
</li>
<li>
<div class="single-thumb">
<img src="images/product-20.jpg" alt="">
</div>
</li>
<li>
<div class="single-thumb">
<img src="images/product-21.jpg" alt="">
</div>
</li>
</ul>
</div> <!-- Modal Quick View Image -->
</div>
<div class="col-md-6">
<div class="product-quick-view-content mt-30">
<h3 class="product-title">Trans-Weight Hooded Wind and Water Resistant Shell</h3>
<p class="reference">Reference: demo_12</p>
<ul class="rating">
<li class="rating-on"><i class="fas fa-star"></i></li>
<li class="rating-on"><i class="fas fa-star"></i></li>
<li class="rating-on"><i class="fas fa-star"></i></li>
<li class="rating-on"><i class="fas fa-star"></i></li>
<li class="rating-on"><i class="fas fa-star"></i></li>
</ul>
<div class="product-prices">
<span class="sale-price"> €23.90</span>
<span class="regular-price">€21.03</span>
<span class="save">Save 12%</span>
</div>
<p class="product-description">Block out the haters with the fresh adidas® Originals Kaval Windbreaker Jacket. <br> Part of the Kaval Collection. <br> Regular fit is eased, but not sloppy, and perfect for any activity. <br> Plain-woven jacket specifically constructed for freedom of movement.</p>
<div class="product-size-color flex-wrap">
<div class="product-size">
<h5 class="title">Size</h5>
<select>
<option value="1">S</option>
<option value="2">M</option>
<option value="3">L</option>
<option value="4">XL</option>
</select>
</div>
<div class="product-color">
<h5 class="title">Color</h5>
<div class="color-input">
<div class="single-color color-1">
<input type="radio" id="radio-1" name="color">
<label for="radio-1"></label>
</div>
<div class="single-color color-2">
<input type="radio" id="radio-2" name="color">
<label for="radio-2"></label>
</div>
<div class="single-color color-3">
<input type="radio" id="radio-3" name="color">
<label for="radio-3"></label>
</div>
</div>
</div>
<div class="product-quantity">
<h5 class="title">Quantity</h5>
<div class="quantity d-flex">
<button type="button" id="sub" class="sub"><i class="fal fa-minus"></i></button>
<input type="text" value="1" />
<button type="button" id="add" class="add"><i class="fal fa-plus"></i></button>
</div>
</div>
</div>
<div class="product-add-cart">
<button><i class="icon ion-bag"></i> Add to cart</button>
</div>
<div class="product-wishlist-compare">
<ul class="d-flex flex-wrap">
<li><i class="fal fa-heart"></i> Add to wishlist</li>
<li><i class="fal fa-repeat"></i> Add to compare</li>
</ul>
</div>
<div class="product-share d-flex">
<p>Share</p>
<ul class="social media-body">
<li><i class="fab fa-facebook-f"></i></li>
<li><i class="fab fa-twitter"></i></li>
<li><i class="fab fa-google"></i></li>
<li><i class="fab fa-pinterest-p"></i></li>
</ul>
</div>
</div> <!-- Modal Quick View Content -->
</div>
</div> <!-- row -->
</div> <!-- Modal Body -->
</div> <!-- Modal content -->
</div> <!-- Modal dialog -->
</div> <!-- Modal -->
Any easier ways other than creating x number of modals?
Thank you

No Such File Directoy

Dont know whats the reason behind because my code wont run. Its say's there's no such file directory but there is and index inside a folder. Does my code or the server?Dont know whats the reason behind because my code wont run. Its say's there's no such file directory but there is and index inside a folder. Does my code or the server?
Please see images below. Thanks!.
https://ibb.co/fKqZ5m
https://ibb.co/cDynQm
code:
navbar.php
<?php include('tooltip.php'); ?>
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<a 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>
</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class=""><a rel="tooltip" data-placement="bottom" title="Home" id="home" href="index.php"><i class="icon-home icon-large"></i> Home</a> </li>
<!-- <li class="divider-vertical"></li> -->
<li class="">
<a rel="tooltip" data-placement="bottom" title="Click Here to About" id="login" href="about.php"><i class="icon-info-sign icon-large"></i> About</a>
</li>
<li class="">
<a rel="tooltip" data-placement="bottom" title="Click Here to Admin Login" id="login" href="librarian/index.php"><i class="icon-user icon-large"></i> Admin</a>
</li>
<!--<li class="">
<a rel="tooltip" data-placement="bottom" title="Click Here to Register Member" id="login" href="register_member.php"><i class="icon-user icon-large"></i> Register Member</a>
</li>-->
</ul>
</div>
</div>
</div>
</div>
index.php inside librarian directory.
<?php
include('header.php');
include('navbar.php');
?>
<div class="container">
<div class="margin-top">
<div class="row">
<div class="span12">
<div class="login">
<div class="log_txt">
<p><strong><center>Login</center></strong></p>
</div>
<form class="form-horizontal" method="POST">
<div class="control-group">
<label class="control-label" for="inputEmail">Username</label>
<div class="controls">
<input type="text" name="username" id="username" placeholder="Username" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">Password</label>
<div class="controls">
<input type="password" name="password" id="password" placeholder="Password" required>
</div>
</div>
<div class="control-group">
<div class="controls">
<button id="login" name="submit" type="submit" class="btn"><i class="icon-signin icon-large"></i> Submit</button>
</div>
</div>
<?php
if (isset($_POST['submit'])){
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
$query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
$result = mysql_query($query)or die(mysql_error());
$num_row = mysql_num_rows($result);
$row=mysql_fetch_array($result);
if( $num_row > 0 ) {
header('location:users.php');
$_SESSION['id']=$row['user_id'];
}
else{ ?>
<div class="alert alert-danger">Access Denied</div>
<?php
}}
?>
</form>
</div>
</div>
</div>
</div>
</div>
It should be ../librarian/index.php because navbar.php is in a different directory (youth).
Most likely your tree is like this:
htdocs
- librarian
- index.php
- youth
- navbar.php
Using ../ will move you up a directory then you can target librarian.

Data printed on form duplicates when I switch accounts?

I'm trying to create a profile page with blanks like username, city etc. I have successfully stored username & city in the MySQL Database using the UPDATE query. I have set the WHERE condition according to the email of the users. I have made 2 accounts with separates emails, for testing purposes. When I logged in from account #1, entered username & id, it was successfully stored in the correct row. Then I logged out, and logged in from account #2, and the username & city I entered in account #1 was duplicated and printed on blanks of account #2. BUT in database, the data was still distinguished until I pressed ENTER. So my question is, why is this happening and how do I fix this?
Action.php:
<?php
session_start(); //---> start session
ini_set('display_errors', 1); ini_set('log_errors',1); error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$con = mysqli_connect('localhost', 'id1753243_venom', 'roushan123', 'id1753243_gameware_01');
if(!$con)
{
echo 'Not connected to the server';
}
$city = $_SESSION['city'];
$city = $_POST['city'];
if(isset($_POST['username']))
if(isset($_POST['city']))
{
$username = $_POST['username'];
$sql = "UPDATE users SET username='".mysqli_real_escape_string($con,$username)."', city = '$city' WHERE email='".mysqli_real_escape_string($con,$_SESSION['email'])."‌​'";
$insert = mysqli_query($con,$sql);
$_SESSION['username'] = $username; //---> this will store username into session variable
$_SESSION['city'] = $city; //---> this will store city into session variable
}
if(!$insert)
{
echo 'Not inserted';
}
else
{
echo 'Inserted';
}
header("refresh:2; url=user.php");
?>
And this is the user.php:
<?php
ini_set('display_errors', 1); ini_set('log_errors',1); error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
/* Displays user information and some useful messages */
session_start();
include 'db.php';
// Check if user is logged in using the session variable
if ( $_SESSION['logged_in'] != 1 ) {
$_SESSION['message'] = "You must log in before viewing your profile page!";
header("location: error.php");
}
else {
// Makes it easier to read
$first_name = $_SESSION['first_name'];
$last_name = $_SESSION['last_name'];
$email = $_SESSION['email'];
$active = $_SESSION['active'];
$username = $_SESSION['username'];
$city = $_SESSION['city'];
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/png" href="assets/img/favicon.ico">
<title>Social Junction | User Profile</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="viewport" content="width=device-width" />
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
<!-- Animation library for notifications -->
<link href="assets/css/animate.min.css" rel="stylesheet"/>
<!-- Light Bootstrap Table core CSS -->
<link href="assets/css/light-bootstrap-dashboard.css" rel="stylesheet"/>
<!-- CSS for Demo Purpose, don't include it in your project -->
<link href="assets/css/demo.css" rel="stylesheet" />
<!-- Fonts and icons -->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href='//fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'>
<link href="assets/css/pe-icon-7-stroke.css" rel="stylesheet" />
</head>
<body>
<div class="wrapper">
<div class="sidebar" data-color="blue" data-image="http://www.zastavki.com/pictures/originals/2015/Creative_Wallpaper_Set_of_business_people_100390_.jpg">
<!-- you can change the color of the sidebar using: data-color="blue | azure | green | orange | red | purple" -->
<div class="sidebar-wrapper">
<div class="pic"></div>
<div class="logo">
<a href="#">
<span style="font-size: 28px;">Hello <span style="font-weight: bold;"><?php echo $first_name.' '.$last_name; ?>!</span></span>
</a>
</div>
<ul class="nav">
<li>
<a href="dashboard.php">
<i class="pe-7s-graph"></i>
<p>Dashboard</p>
</a>
</li>
<li class="active">
<a href="user.html">
<i class="pe-7s-user"></i>
<p>User Profile</p>
</a>
</li>
</ul>
</div>
</div>
<div class="main-panel">
<nav class="navbar navbar-default navbar-fixed">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigation-example-2">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Profile</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-left">
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-dashboard"></i>
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-globe"></i>
<b class="caret"></b>
<span class="notification">5</span>
</a>
<ul class="dropdown-menu">
<li>Notification 1</li>
<li>Notification 2</li>
<li>Notification 3</li>
<li>Notification 4</li>
<li>Another notification</li>
</ul>
</li>
<li>
<a href="">
<i class="fa fa-search"></i>
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="">
Account
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Dropdown
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something</li>
<li>Another action</li>
<li>Something</li>
<li class="divider"></li>
<li>Separated link</li>
</ul>
</li>
<li>
<a href="index.php">
Log out
</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="header">
<h4 class="title">Edit Profile</h4>
</div>
<div class="content">
<form method="POST" action="action.php">
<div class="row">
<div class="col-md-5">
<div class="form-group">
<label>Company (disabled)</label>
<input type="text" class="form-control" disabled placeholder="Company" value="Creative Code Inc.">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Username</label>
<input name="username" type="text" class="form-control" placeholder="Username" value="<?php echo $username; ?>">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" placeholder="Email" value="<?php echo $email; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>First Name</label>
<input type="text" name="first_name" class="form-control" placeholder="Company" value="<?php echo $first_name; ?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Last Name</label>
<input type="text" name="last_name" class="form-control" placeholder="Last Name" value="<?php echo $last_name; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>Address</label>
<input type="text" name="address" class="form-control" placeholder="Home Address" value="Bld Mihail Kogalniceanu, nr. 8 Bl 1, Sc 1, Ap 09">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label>City</label>
<input type="text" name="city" class="form-control" placeholder="City" value="<?php echo $_SESSION['city']; ?>">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Country</label>
<input type="text" name="country" class="form-control" placeholder="Country" value="Andrew">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Postal Code</label>
<input type="number" class="form-control" placeholder="ZIP Code">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>About Me</label>
<textarea name="aboutme" rows="5" class="form-control" placeholder="Here can be your description" value="Mike">Lamborghini Mercy, Your chick she so thirsty, I'm in that two seat Lambo.</textarea>
</div>
</div>
</div>
<button type="submit" class="btn btn-info btn-fill pull-right">Update Profile</button>
<div class="clearfix"></div>
</form>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card card-user">
<div class="image">
<img src="https://ununsplash.imgix.net/photo-1431578500526-4d9613015464?fit=crop&fm=jpg&h=300&q=75&w=400" alt="..."/>
</div>
<div class="content">
<div class="author">
<a href="#">
<img class="avatar border-gray" src="assets/img/faces/face-3.jpg" alt="..."/>
<h4 class="title"><?php echo $first_name; ?><br />
<small><?php echo $username; ?></small>
</h4>
</a>
</div>
<p class="description text-center"> "Lamborghini Mercy <br>
Your chick she so thirsty <br>
I'm in that two seat Lambo"
</p>
</div>
<hr>
<div class="text-center">
<button href="#" class="btn btn-simple"><i class="fa fa-facebook-square"></i></button>
<button href="#" class="btn btn-simple"><i class="fa fa-twitter"></i></button>
<button href="#" class="btn btn-simple"><i class="fa fa-google-plus-square"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container-fluid">
<nav class="pull-left">
<ul>
<li>
<a href="#">
Home
</a>
</li>
<li>
<a href="#">
Company
</a>
</li>
<li>
<a href="#">
Portfolio
</a>
</li>
<li>
<a href="#">
Blog
</a>
</li>
</ul>
</nav>
<p class="copyright pull-right">
© 2016 Creative Tim, made with love for a better web
</p>
</div>
</footer>
</div>
</div>
</body>
<!-- Core JS Files -->
<script src="assets/js/jquery-1.10.2.js" type="text/javascript"></script>
<script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
<!-- Checkbox, Radio & Switch Plugins -->
<script src="assets/js/bootstrap-checkbox-radio-switch.js"></script>
<!-- Charts Plugin -->
<script src="assets/js/chartist.min.js"></script>
<!-- Notifications Plugin -->
<script src="assets/js/bootstrap-notify.js"></script>
<!-- Google Maps Plugin -->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<!-- Light Bootstrap Table Core javascript and methods for Demo purpose -->
<script src="assets/js/light-bootstrap-dashboard.js"></script>
<!-- Light Bootstrap Table DEMO methods, don't include it in your project! -->
<script src="assets/js/demo.js"></script>
</html>
I know the code is not secure, this is just for test purposes. Help is highly appreciated.

Bootstrap localhost error

My website is running with phpstorm's editor's localhot with any error .
http://localhost:63342/html/Bag%C4%B1s/bagisyap.html
on the other hand ; if i want to start with only my localhost
http://localhost/Bag%C4%B1s/index.html
i can not connect bootstrap 's argumant . how i can i solve that ?
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<title>Bağış Sitesi</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="../Bagıs/public/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="../Bagıs/public/css/main.css">
<!-- Owl Carousel -->
<link rel="stylesheet" href="../Bagıs/public/css/owl.carousel.css">
<link rel="stylesheet" href="../Bagıs/public/css/owl.theme.css">
</head>
<body id="index">
<div class="container main-nav">
<div class="row margin-bottom-zero">
<div class="col-xs-12">
<nav class="navbar">
<ul class="nav navbar-nav">
<li class="active"><i class="glyphicon glyphicon-home"></i> Anasayfa</li>
<li>Neden yardım etmeliyim</li>
<li>Bağış Yap</li>
<li>İhtiyaç sahipleri</li>
<li>Hakkımızda</li>
<li>İletişim</li>
</ul>
<ul class="nav navbar-nav navbar-right user-login-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<i class="glyphicon glyphicon-user"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>Giriş</li>
<li>Kayıt Ol</li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
<div class="row panel">
<div class="col-xs-12">
<img class="img-responsive" src="../Bagıs/public/img/logo.png" alt="Logo">
</div>
</div>
</div>
<div class="container">
<div class="row white-box-style min-row-height">
<form action="bagısyap.php" method="POST">
<div class="col-xs-4 choose-category">
<h4>Kategori Seçin</h4>
<select class="form-control" name="category">
<option value="0">Kategori Seçin</option>
<option value="1">Elbise</option>
<option value="2">Teknoloji</option>
<option value="3">Mobilya</option>
<option value="3">Küçük Ev Aletleri</option>
</select>
<select class="form-control" name="category">
<option value="0">Alt Kategori Seçin</option>
<option value="1">Telefon</option>
<option value="2">Laptop</option>
<option value="3">Monitör</option>
<option value="3">Telefon Kılıfları</option>
</select>
</div>
<div class="col-xs-8">
<div class="row">
<h4> </h4>
<div class="col-xs-3">
<a href="#" class="thumbnail">
<img class="img-responsive" src="../Bagıs/public/img/empty-image.jpg" alt="...">
</a>
</div>
<div class="col-xs-9">
<textarea name="desc" class="form-control" rows="6" placeholder="Ürün hakkında kısa bir açıklama"></textarea>
</div>
</div>
<div class="checkbox">
<label>
<input type="checkbox" value="1">
Bu ürünü ismimi gizleyerek (anonim olarak) ekleyin
</label>
</div>
<button type="submit" class="btn btn-primary">Tamamla</button>
</div>
</form>
</div>
</div>
<div class="modal fade" id="login-modal-box" role="dialog" aria-labelledby="gridSystemModalLabel" aria-hidden="true">
<form action="#giris-kontrol" method="POST">
<div class="modal-dialog user-login-box-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="gridSystemModalLabel">Kullanıcı Giriş Paneli</h4>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="form-group">
<label for="exampleInputEmail1">Eposta Adresiniz</label>
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Şifre</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="checkbox">
<label>
<input type="checkbox"> Beni hatırla
</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
Giriş Yap
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</form>
</div><!-- /.modal -->
<!-- Include Jquery -->
<script src="../Bagıs/public/js/jquery-1.11.1.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="../Bagıs/public/js/bootstrap.min.js"></script>
<script src="../Bagıs/public/js/owl.carousel.min.js"></script>
<script src="../Bagıs/public/js/script.js"></script>
</body>
</html>

Categories