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
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.
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
I am developing my application with laravel5.2 .I have template with bootstrap and want to display 4 products with their pictures at each row.
this is my template
#extends('layouts.layout',[['subscribe'=>$subscribe]])
#section('content')
<section id="advertisement">
<div class="container">
<img src="{{asset('images/shop/advertisement.jpg')}}" alt="" />
</div>
</section>
<section>
<div class="container">
<div class="row">
<div class="col-sm-3">
<div class="left-sidebar">
#include('shared.sidebar',array('brands'=>$brands))
</div>
</div>
<div class="col-sm-9 padding-right">
<div class="features_items"><!--features_items-->
<h2 class="title text-center">Features Items</h2>
#foreach ($products as $product)
<div class="col-sm-3">
<div class="product-image-wrapper">
<div class="single-products">
<div class="productinfo text-center">
<img src="images/shop/{{$product->image}}" height="200" width="150" alt="">
<h2>{{$product->price}}</h2>
<h6><p>{{$product->name}}</p></h6>
<i class="fa fa-shopping-cart"></i>Add to cart
<i class="fa fa-info"></i>View Details
</div>
<div class="product-overlay">
<div class="overlay-content">
<h2>${{$product->price}}</h2>
<p>${{$product->name}}</p>
<form method="POST" action="{{url('cart')}}">
<input type="hidden" name="product_id" value="{{$product->id}}">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-fefault add-to-cart">
<i class="fa fa-shopping-cart"></i>
Add to cart
</button>
</form>
<i class="fa fa-info"></i>View Details
</div>
</div>
</div>
<div class="choose">
<ul class="nav nav-pills nav-justified">
<li><i class="fa fa-plus-square"></i>Add to wishlist</li>
<li><i class="fa fa-plus-square"></i>Add to compare</li>
</ul>
</div>
</div>
</div>
#endforeach
<ul class="pagination">
<li class="active">1</li>
<li>2</li>
<li>3</li>
<li>»</li>
</ul>
</div><!--features_items-->
</div>
</div>
</div>
</section>
#endsection
It is not disciplined.it display 4 at row in time and 2 in time .please help me to do it.
In order to have nested columns (4*x columns sm-3 inside the column sm-9) you need to wrap the 4 columns in a row so that it becomes
<div class="col-sm-9">
<div class="row">
#foreach ($products as $product)
<div class="col-sm-3">
...
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>