- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在代码中存储多个 ID 时遇到问题。我需要将 id 保存在单个变量(数组)中,因为我将在 cart.php 中调用它来显示添加到购物车的元素。这是我的代码。
<!--This is the android.php where you can browse the items to be added to the cart -->
<?php
include('php/userloginprocess.php'); // Includes Login Script
if($_SESSION['login'] == FALSE){
header("location: login.php");
}
if($_SESSION['login'] == TRUE)
?>
<!Document HTML>
<html>
<head>
<title> Marketech | Buy Genuine Gadgets Online | Android Phones</title>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="shortcut icon" href="images/marketechlogo.ico" />
</head>
<body>
<!-- First Navigation Bar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<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="index.php">Marketech</a>
</div>
<?php
//connection
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("marketech_db") or die(mysql_error());
//query
$sql = "SELECT * FROM user_tbl";
$records=mysql_query($sql);
while($users=mysql_fetch_assoc($records)){
}
?>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="cart.php"><span class = "glyphicon glyphicon-shopping-cart"></span> Cart</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo $_SESSION ['fname']; ?><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="useraccountsettings.php">Account Settings</a></li>
<li><a href="php/logout.php">Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- Second Navigation Bar -->
<br><br><br>
<div class = "container-fluid">
<nav class="navbar navbar-inverse navbar-lower">
<div class="container-fluid">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
<ul class="nav navbar-nav col-lg-12">
<li class="active col-md-2"><a href="android.php">Samsung</a></li>
<li class="col-md-2"><a href="iphone.php">Apple</a></li>
<li class="col-md-2"><a href="windows.php">Microsoft</a></li>
<li class="col-md-2"><a href="smartwatch.php">Smart Watch</a></li>
<li class="col-md-2"><a href="computer.php">Computers</a></li>
<li class="dropdown col-xs-2"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Other Popular Brands <span class="caret"></span></a>
<ul class="dropdown-menu col-xs-2">
<li><a href="sony.php">Sony</a></li>
<li><a href="asus.php">Asus</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- Marketechs Third Navigation (with glyphicons) -->
<div class="container-fluid">
<ul class="list-unstyled">
<li class = "col-md-3"><span class="glyphicon glyphicon-transfer"></span> 30 days Free Returns</li>
<li class = "col-md-3"><span class="glyphicon glyphicon-plane"></span> Free Delivery Above 999 php</li>
<li class = "col-md-3"><span class="glyphicon glyphicon-usd"></span> Cash on Delivery</li>
<li class = "col-md-3"><span class="glyphicon glyphicon-earphone"></span> Call (049) 557 2681</li>
</ul>
</div>
</div>
<!-- Carousel -->
<div class="col-md-0 col-md-offset-0">
<div class="container">
<div class = "col-md-14">
<div class="carousel slide" id="carousel1" data-ride"carousel">
<ol class="carousel-indicators">
<li data-target="#carousel1" data-slide-to="0" class="active"></li>
<li data-target="#carousel1" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src = "images/androidbanner1.jpg">
<div class = "carousel-caption">
<h4> Samsung J1 Mini Prime</h4>
</div>
</div>
<div class="item">
<img src = "images/androidbanner2.jpg">
<div class = "carousel-caption">
<h4>Samsung S7</h4>
</div>
</div>
</div>
<a href="#carousel1" data-slide="prev" class = "left carousel-control"><span class = "glyphicon glyphicon-chevron-left"></span></a>
<a href="#carousel1" data-slide="next" class = "right carousel-control"><span class = "glyphicon glyphicon-chevron-right"></span></a>
</div>
</div>
</div>
</div>
<!-- Items Division -->
<center><h2 id="samsung"><b>Samsung</b></h2></center>
<?php
mysql_connect("localhost","root","") or die(mysql_error());
$result = mysql_query("SELECT * FROM product_tbl where brand = 'samsung' AND type ='android'");
while($row = mysql_fetch_array($result)) {
?>
<p class = "col-md-4"><a href = "#">
<img class="img-responsive" src = "uploaded_images/<?php echo $row['item_image']?>" data-toggle="modal" data-target = "#modal<?php echo $row['prod_id'] ?>">
</a>
<a href = "#" data-toggle = "modal" data-target = "#modal<?php echo $row['prod_id']?>">
<font color = "black"><?php echo $row['item_name']?>
</a>
<br>
Price: <?php echo $row['item_price']?> Php</p>
<!-- Footer Navigation -->
<!-- Modal Locations -->
<!-- Start of the First Modal (SAMSUNG J1 MINI)-->
<div class = "modal fade" id = "modal<?php echo $row['prod_id']?>">
<div class = "modal-dialog">
<div class = "modal-content">
<div class = "modal-header">
<p> <?php echo $row['item_name']?> </p>
</div>
<div class = "modal-body">
<p class = "col-md-12"><b>Specifications</b>
<ul class = "list-unstyled col-md-12">
<li class = "col-md-12"><center><b><font color = "green">Display:</font></b><?php echo$row['display']?></center></li>
<li class = "col-md-12"><center><b><font color = "green">Resolution:</font></b><?php echo$row['resolution']?></center></li>
<li class = "col-md-12"><center><b><font color = "green">Storage:</font></b> <?php echo$row['storage']?></center></li>
<li class = "col-md-12"><center><b><font color = "green">RAM:</font></b> <?php echo$row['ram']?></center></li>
<li class = "col-md-12"><center><b><font color = "green">Front Cam:</font></b><?php echo$row['frontcam']?></center></li>
<li class = "col-md-12"><center><b><font color = "green">Rear Cam:</font></b><?php echo$row['rearcam']?></center></li>
<li class = "col-md-12"><center><b><font color = "green">OS:</font></b><?php echo$row['os']?></center></li>
<li class = "col-md-12"><center><b><font color = "green">Processor:</font></b><?php echo$row['processor']?></center></li>
<li class = "col-md-12"><center><b><font color = "green">Battery Capacity:</font></b><?php echo$row['battery']?></center></li>
</ul>
<div class = "zoom_img">
<center><img class = "img-responsive" src = "uploaded_images/<?php echo $row['item_image']?>"></center>
</p></div>
</div>
<div class = "modal-footer">
<form method = "GET" action = "php/addtocartprocess.php">
<p>Price: <?php echo $row['item_price']?><br>
<input class="btn btn-success" type="submit" name="add_to_cart" value="Add to Cart">
<input type="hidden" name="product_id" value="<?php echo $row["prod_id"];?>">
<span class="glyphicon glyphicon-shopping-cart"></span></form>
</p>
</p>
</div>
</div>
</div>
</div>
<?php
}
?>
<!-- End of Modal Locations -->
<!-- footer -->
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div class ="container">
<nav class="navbar navbar-default">
<div class="container">
<ul class ="list-unstyled">
<li class = "col-md-2"><h5><b>Call Us: (049) 557 2681</b></h5></li>
<li class = "col-md-2"><h5><b><a href = "about.php"><font color = "black">About Us </b></h5></font></a></li>
<li class = "col-md-2"><h5><b><a href = "contact.php"><font color = "black">Contact Us</b></h5></font></a></li>
<li class = "col-md-2"><h5><b><a href = "privacy.php"><font color = "black">Privacy</b></h5></font></a></li>
<li class = "col-md-2"><h5><b><a href = "terms.php"><font color = "black">Terms of Service</b></h5></font></a></li>
<li class = "col-md-2"><h5><b>Copyright (c) 2016<h5></li>
</ul>
</div>
</nav>
</div>
<!--
Members:
Marlon Mendoza
-->
</body>
</html>
<!-- Here's my addtocartprocess.php where the ids are stored-->
<?php
*if (session_status() == PHP_SESSION_NONE) {
session_start();
$_SESSION['cart'] = array();
}
$connection = mysql_connect("localhost", "root", "");
if(isset($_GET['add_to_cart'])){
array_push($_SESSION['cart'], $_GET['product_id']);
header("location: ../android.php?id=" . $_GET['product_id'] . "");
}
mysql_close($connection);
?>
<!-- This is the cart.php it shows the items that were added to the cart. My problem is I can't call the items in the cart. Sometimes it is working but it can only store one id so if you clicked another item and add it to the cart the previous item that you selected will be removed to the cart-->
<?php
include('php/userloginprocess.php'); // Includes Login Script
include('php/addtocartprocess.php');
$prod_id = $_SESSION['cart'];
/*$id = $_SESSION['prod_id'];
$gadgets = $_SESSION['prod_id'];*/
if($_SESSION['login'] == FALSE){
header("location: login.php");
}
if($_SESSION['login'] == TRUE)
?>
<?php
//connection
mysql_connect("localhost","root", "") or die(mysql_error());
//database connection
mysql_select_db("marketech_db") or die(mysql_error());
//sql query
$sql = "SELECT * FROM user_tbl";
$records=mysql_query($sql);
?>
<html>
<head>
<title> Marketech | Buy Genuine Gadgets Online </title>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="shortcut icon" href="images/marketechlogo.ico" />
</head>
<body>
<!-- First Navigation Bar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<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="#">Marketech</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class = "glyphicon glyphicon-shopping-cart"></span> Cart</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo $_SESSION ['fname']; ?><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="useraccountsettings.php">Account Settings</a></li>
<li><a href="php/logout.php">Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- Second Navigation Bar -->
<br><br><br>
<div class = "container-fluid">
<nav class="navbar navbar-inverse navbar-lower">
<div class="container-fluid">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
<ul class="nav navbar-nav col-lg-12">
<li class="col-md-2"><a href="android.php">Android Phone</a></li>
<li class="col-md-2"><a href="iphone.php">iPhone</a></li>
<li class="col-md-2"><a href="windows.php">Windows Phone</a></li>
<li class="col-md-2"><a href="smartwatch.php">Smart Watch</a></li>
<li class="col-md-2"><a href="computer.php">Computers</a></li>
<li class="dropdown col-md-2"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Popular Brands <span class="caret"></span></a>
<ul class="dropdown-menu col-xs-2">
<li><a href="android.php#samsung">Samsung</a></li>
<li><a href="iphone.php">Apple</a></li>
<li><a href="windows.php">Microsoft</a></li>
<li><a href="android.php#sony">Sony</a></li>
<li><a href="android.php#asus">Asus</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</nav>
<!-- Marketechs Third Navigation (with glyphicons) -->
<div class="container">
<ul class="list-unstyled">
<li class = "col-md-3"><span class="glyphicon glyphicon-transfer"></span> 30 days Free Returns</li>
<li class = "col-md-3"><span class="glyphicon glyphicon-plane"></span> Free Delivery Above 999 php</li>
<li class = "col-md-3"><span class="glyphicon glyphicon-usd"></span> Cash on Delivery</li>
<li class = "col-md-3"><span class="glyphicon glyphicon-earphone"></span> Call (049) 557 2681</li>
</ul>
</div>
</div>
<!-- Cart -->
<div class = "container-fluid">
<form method = "GET" action = "deletecartproduct.php">
<div class = "col-md-9">
<table class = "table table-responsive table-hover">
<tr>
<th>Delete</th>
<th>Item Name</th>
<th>Item Price</th>
<th>Image</th>
</tr>
<?php
//connection
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("marketech_db") or die (mysql_error());
$sql = "SELECT * FROM product_tbl WHERE prod_id IN (".implode(',',$prod_id).")";
$prod_records = mysql_query($sql);
while($products=mysql_fetch_assoc($prod_records)){
echo "<tr>";
echo "<td>" .'<input type="checkbox" name="products[]" value='.$products['prod_id'].'>'."</td>";
echo "<td>".$products['item_name']."</td>";
echo "<td>".$products['item_price']."</td>";
echo "<td>".$products['item_image']."</td>";
echo "</tr>";
}
?>
</table>
<input type ="submit" class = "btn btn-danger" name = "delete_cart_item" value = "Delete"></form>
</div>
</div>
<br><br><br><br><br>
<!-- Footer Navigation -->
<nav class="navbar navbar-default">
<div class="container">
<ul class ="list-unstyled">
<li class = "col-md-2"><h5><b>Call Us: (049) 557 2681</b></h5></li>
<li class = "col-md-2"><h5><b><a href = "about.php"><font color = "black">About Us </b></h5></font></a></li>
<li class = "col-md-2"><h5><b><a href = "contact.php"><font color = "black">Contact Us</b></h5></font></a></li>
<li class = "col-md-2"><h5><b><a href = "privacy.php"><font color = "black">Privacy</b></h5></font></a></li>
<li class = "col-md-2"><h5><b><a href = "terms.php"><font color = "black">Terms of Service</b></h5></font></a></li>
<li class = "col-md-2"><h5><b>Copyright (c) 2016<h5></li>
</ul>
</div>
</nav>
<!--
Members:
Marlon Mendoza
-->
</body>
</html>
最佳答案
我设法通过使用不同的方法检索 ID 并将其存储在多维数组中来回答我自己的问题。
关于javascript - 在电子商务网站中添加多个商品到购物车(add to cart),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41039517/
我有这个网站,这个特定页面是安全的,但是当它回发时,它回发到一个不安全的页面。如何解决? 我正在使用 ASP.NET 向导。我有这个页面 - checkout.aspx,页面包含这个控件 checko
我有 2 个 azure 网站 - 两个独立的项目 我现在有 2 个网址: myazurewebsite.azurewebsites.net myazureblog.azurewebsites.net
我有 2 个 azure 网站 - 两个独立的项目 我现在有 2 个网址: myazurewebsite.azurewebsites.net myazureblog.azurewebsites.net
环境: 旧网站: React 托管在 Heroku URL( http://sameurl.com ) 新网站: Java 托管在 Heroku URL ( http://sameurl.com )
我已在 Windows Azure 上注册了一个测试帐户来对其进行测试。我构建了一个 Hello world ASP.NET Web 应用程序 + 数据库只是为了测试。 我安装了 Visual Stu
我有一个可以收集和显示各种测量值的产品(不会详细介绍)。正如人们所期望的那样,显示部分是一个数据库+建立在其之上的网站(使用 Symfony)。 但是,我们可能还会创建一个 API 来向第三方公开数据
这个问题在这里已经有了答案: Software keyboard resizes background image on Android (16 个答案) 关闭 8 年前。 我有一个类似的问题:So
这个问题似乎很常见,但我真的无法根据现有答案解决问题。 我有一个简单的 maven 项目,没有任何复杂的部署配置等,并且想在点击“mvn site”时生成一个 Maven CheckStyle 报告。
有没有人看过有关何时进行横向扩展与纵向扩展的最佳选择的任何分析或信息。什么时候一个比另一个更有意义。 目前,在标准模式和基本模式下,2 个小型实例的费用与 1 个中型实例的费用相同。 拥有 2 个小型
有没有办法找到 azure 网站何时停止? (我通过门户网站停止了网站,但我不记得是什么时候......) 我正在寻找一些日志,但没有找到任何有用的内容。 谢谢。 最佳答案 您拥有的最接近的是 azu
我目前在 Azure VM 的 IIS 中拥有一个网站。我已将该站点复制到 2 个可用区域中的 2 个虚拟机上。 这可以保护网站免遭停机。 我需要为高负载时刻实现一些可扩展性。这似乎就是创建音阶集的目
我有一个托管在 Azure 上的网站 ( http://mike-ward.azurewebsites.net/ )。我从 Azure 门户设置了一个指向(引用?)我的网站的 Azure CDN。根据
我有一个 Azure 网站(不是 Web 角色),有 2 个槽:生产和暂存。 我只想为生产插槽启用 CDN,而不是为登台启用,问题是我找不到识别主机插槽的方法。 RoleEnvironment 不可用
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提出有关书籍、工具、软件库等建议的问题。您可以编辑问题,以便可以用事实和引用来回答它。 4年前关
我们正在考虑将一些网站从 Azure 云服务迁移到 Azure 网站(事情似乎就是这样进行的)。显然,我们被明确告知云服务不会保留文件系统状态,因为它们会在机器故障时重新部署。 我假设网站是基于 Bl
我有一个 Azure 网站,需要使用在 VM 上运行的 Elasticsearch 服务。 虽然我需要能够锁定对 Elasticsearch 的访问,以便只有 Azure 网站可以访问它,但我似乎无法
我有一个 azure 网站,位于 yis3.azurewebsites.net - 我已将其提升为“共享”网站,以便我可以使用自定义域。我拥有从 123-reg.co.uk 购买的域名 yorkshi
我正在使用 abcPDF 动态创建 PDF。 我想保存这些 PDF,以便客户随时检索。最简单的方法(也是我现在在当前服务器上所做的方法)是将完成的 PDF 保存到文件系统。 看来我一直坚持使用 blo
我们正在尝试了解 Windows Azure 管理 API 为 Azure 网站(而非 Webroles)返回的监控数据的复杂性 例如,下图描述了为 CPUTime 检索的数据点。它似乎表明,在晚上
看起来真的很愚蠢,因为我找不到它: 门户网站似乎不太直观,我如何为一个“网站”付费并在其中运行最多 500 个网站?我想当我通过单击左下角的加号添加“网站”时,我添加了整个虚拟机而不是子站点。如何仅添
我是一名优秀的程序员,十分优秀!