Jump to content

Dorkmind

Members
  • Posts

    10
  • Joined

  • Last visited

Dorkmind's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i see that the problem is this right border in <nav> menu #cssmenu > ul > li > a { border-right: 4px solid #1b9bff ; color: #ffffff; } if i remove it the problem is solved but i really like it so is there another solution
  2. So i have a <drop down> menu, and a <nav> menu on my left side of the page. I have a problem when i click at the first column of my drop down menu and it explores submenu, the submenu mixes with the nav menu that is under the drop down menu on the left. i could solve it with margin-top of the nav menu but i don't like the empty space beetwen them. I tried with putting overflow:visible; in CSS of my dropdown menu but it is still the same. drop down menu is seen but there is stil seen nav menu under and they are mixed. So basicly i want my dropdown menu to be priority, so when i clicks on my first column (only first column is problem because there under is nav menu the other are open nice) it will explore submenu and the part of nav menu that covers the submenu will be hidden. Here is the screen shot: Here is the code of head <dropdown> menu if someone finds the problem. #menu, #menu ul { margin: 0; padding: 0; list-style: none; } #menu { width: 900px; margin-top:20px; margin-left:auto; margin-right:auto; border: 1px solid #222; background-color: #111; background-image: linear-gradient(#444, #111); border-radius: 6px; box-shadow: 0 1px 1px #777; } #menu:before, #menu:after { content: ""; display: table; } #menu:after { clear: both; } #menu { zoom:1; } #menu li { float: left; border-right: 1px solid #222; box-shadow: 1px 0 0 #444; position: relative; } #menu a { float: left; padding: 12px 30px; color: #999; text-transform: uppercase; font: bold 12px Arial, Helvetica; text-decoration: none; text-shadow: 0 1px 0 #000; } #menu li:hover > a { color: #fafafa; } *html #menu li a:hover { /* IE6 only */ color: #fafafa; } #menu ul { margin: 20px 0 0 0; _margin: 0; /*IE6 only*/ opacity: 0; visibility: hidden; position: absolute; top: 38px; left: 0; z-index: 1; background: #444; background: linear-gradient(#444, #111); box-shadow: 0 -1px 0 rgba(255,255,255,.3); border-radius: 3px; transition: all .2s ease-in-out; } #menu li:hover > ul { opacity: 1; visibility: visible; margin: 0; } #menu ul ul { top: 0; left: 150px; margin: 0 0 0 20px; _margin: 0; /*IE6 only*/ box-shadow: -1px 0 0 rgba(255,255,255,.3); } #menu ul li { float: none; display: block; border: 0; _line-height: 0; /*IE6 only*/ box-shadow: 0 1px 0 #111, 0 2px 0 #666; } #menu ul li:last-child { box-shadow: none; } #menu ul a { padding: 10px; width: 130px; _height: 10px; /*IE6 only*/ display: block; white-space: nowrap; float: none; text-transform: none; } #menu ul a:hover { background-color: #0186ba; background-image: linear-gradient(#04acec, #0186ba); } #menu ul li:first-child > a { border-radius: 3px 3px 0 0; } #menu ul li:first-child > a:after { content: ''; position: absolute; left: 40px; top: -6px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #444; } #menu ul ul li:first-child a:after { left: -6px; top: 50%; margin-top: -6px; border-left: 0; border-bottom: 6px solid transparent; border-top: 6px solid transparent; border-right: 6px solid #3b3b3b; } #menu ul li:first-child a:hover:after { border-bottom-color: #04acec; } #menu ul ul li:first-child a:hover:after { border-right-color: #0299d3; border-bottom-color: transparent; } #menu ul li:last-child > a { border-radius: 0 0 3px 3px; } Here is the code of <nav> menu if someone finds the problem. #cssmenu { width:15%; padding: 0; margin-top: 50px; margin-left:auto; margin right:auto; float:left; border: 0; line-height: 1; } #cssmenu ul, #cssmenu ul li, #cssmenu ul ul { list-style: none; margin: 0; padding: 0; } #cssmenu ul { position: relative; z-index: 597; float: left; } #cssmenu ul li { float: left; min-height: 1px; line-height: 1em; vertical-align: middle; position: relative; } #cssmenu ul li.hover, #cssmenu ul li:hover { position: relative; z-index: 599; cursor: default; } #cssmenu ul ul { visibility: hidden; position: absolute; top: 100%; left: 0px; z-index: 598; width: 100%; } #cssmenu ul ul li { float: none; } #cssmenu ul ul ul { top: -2px; right: 0; } #cssmenu ul li:hover > ul { visibility: visible; } #cssmenu ul ul { top: 1px; left: 99%; } #cssmenu ul li { float: none; } #cssmenu ul ul { margin-top: 1px; } #cssmenu ul ul li { font-weight: normal; } /* Custom CSS Styles */ #cssmenu { width: 200px; background: #333333; font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif; zoom: 1; font-size: 12px; } #cssmenu:before { content: ''; display: block; } #cssmenu:after { content: ''; display: table; clear: both; } #cssmenu a { display: block; padding: 15px 20px; color: #ffffff; text-decoration: none; text-transform: uppercase; } #cssmenu > ul { width: 200px; } #cssmenu ul ul { width: 200px; } #cssmenu > ul > li > a { border-right: 4px solid #1b9bff; color: #ffffff; } #cssmenu > ul > li > a:hover { color: #ffffff; } #cssmenu > ul > li.active a { background: #1b9bff; } #cssmenu > ul > li a:hover, #cssmenu > ul > li:hover a { background: #1b9bff; } #cssmenu li { position: relative; } #cssmenu ul li.has-sub > a:after { content: '+'; position: absolute; top: 50%; right: 15px; margin-top: -6px; } #cssmenu ul ul li.first { -webkit-border-radius: 0 3px 0 0; -moz-border-radius: 0 3px 0 0; border-radius: 0 3px 0 0; } #cssmenu ul ul li.last { -webkit-border-radius: 0 0 3px 0; -moz-border-radius: 0 0 3px 0; border-radius: 0 0 3px 0; border-bottom: 0; } #cssmenu ul ul { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } #cssmenu ul ul { border: 1px solid #0082e7; } #cssmenu ul ul a { font-size: 12px; color: #ffffff; } #cssmenu ul ul a:hover { color: #ffffff; } #cssmenu ul ul li { border-bottom: 1px solid #0082e7; } #cssmenu ul ul li:hover > a { background: #4eb1ff; color: #ffffff; } #cssmenu.align-right > ul > li > a { border-left: 4px solid #1b9bff; border-right: none; } #cssmenu.align-right { float: right; } #cssmenu.align-right li { text-align: right; } #cssmenu.align-right ul li.has-sub > a:before { content: '+'; position: absolute; top: 50%; left: 15px; margin-top: -6px; } #cssmenu.align-right ul li.has-sub > a:after { content: none; } #cssmenu.align-right ul ul { visibility: hidden; position: absolute; top: 0; left: -100%; z-index: 598; width: 100%; } #cssmenu.align-right ul ul li.first { -webkit-border-radius: 3px 0 0 0; -moz-border-radius: 3px 0 0 0; border-radius: 3px 0 0 0; } #cssmenu.align-right ul ul li.last { -webkit-border-radius: 0 0 0 3px; -moz-border-radius: 0 0 0 3px; border-radius: 0 0 0 3px; } #cssmenu.align-right ul ul { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; }
  3. Hi guys i have another question about my shopping cart. I have in my sql database table called products. It consist of 4 columns (product_id, description, quantity, price). Now on my index page, I want to call just one product from cell, which would have special price. But i don't know how to call one single product. So my code looks like that: <?php $sql="SELECT product_id FROM Products"; $query=mysql_query($sql); $row=mysql_fetch_array($query); ?><table > <tr><img src="Images/Image.jpg" width="380" height="300" /> </tr> <tr> <td><a href="index.php?page=index&action=add&id=<?php echo $row['product_id']?>">Add to cart</a></td> </tr> <?php ?> </table> This code display me first product but i would like to call 3 product how would i do that, so i have 6 products and i would like to call product N.3 to my index page. My code calls the first one, how would it call the third.
  4. So i fixed it $Productname=array(); $Quantity=array(); $Allprice=array(); while($row=mysql_fetch_array($query)) { $subtotal=$_SESSION['cart'][$row['product_id']]['quantity']*$row['price']; $totalprice+=$subtotal; ?> <tr> <td><?php echo $row['name'] ?></td>; <td><input type="text" name="quantity[<?php echo $row['product_id']?>]" size="5" value="<?php echo $_SESSION['cart'][$row['product_id']]['quantity'] ?>"/></td> <td><?php echo $row['price']?>€</td> <td><?php echo $_SESSION['cart'][$row['product_id']]['quantity']*$row['price']?>€</td> </tr> <?php $Allprice[$i]=$_SESSION['cart'][$row['product_id']]['quantity']*$row['price'];?> <?php $Productname[$i]=$row['name'];?> <?php $Quantity[$i]=$_SESSION['cart'][$row['product_id']]['quantity']?> <?php $i++; } but now i have another problem i would like to send them to my email. so i made a form <form method="post" action="checkout.php"> <?php echo print_r($Productname,true) ?> <?php echo print_r($Quantity,true) ?> <?php echo print_r($Allprice,true) ?> <input type="submit" value="Buy"> </form> and checkout looks like that <?php mail('my_mail@mail.com',$_POST['$Productname'], $_POST['$Quantity'], $_POST['$Allprice']); ?> <p>Your products where bought.</p> but it does not work, i tried it with : <textarea name="message"><?php echo print_r($Productname,true) ?></textarea> and then i was calling message in my chechout.php, but the problem is it displays the input window with my array inside it, on my cart.php, but i don't want that i want, when user presses buy, it would send me the arrays without displaying them again on my website. Thank you in advance
  5. so can you please tell me where to put that while loop you wrote inside my while loop or under it. <h1 align="center"> Cart </h1> <form method="post" action="cart.php"> <table align="center"> <tr> <th>Name</th> <th>Quantity</th> <th>Price 1</th> <th>Price all </th> </tr> <?php $sql="SELECT * FROM Products WHERE product_id IN ("; foreach($_SESSION['cart'] as $id => $value) { $sql.=$id.","; } $sql=substr($sql, 0, -1).") ORDER BY name ASC"; $query=mysql_query($sql); $totalprice=0; if(!empty($query)){ while($row=mysql_fetch_array($query)) { $subtotal=$_SESSION['cart'][$row['product_id']]['quantity']*$row['price']; $totalprice+=$subtotal; ?> <tr> <td><?php echo $row['name'] ?></td> <td><input type="text" name="quantity[<?php echo $row['product_id']?>]" size="5" value="<?php echo $_SESSION['cart'][$row['product_id']]['quantity'] ?>"/></td> <td><?php echo $row['price']?>€</td> <td><?php echo $_SESSION['cart'][$row['product_id']]['quantity']*$row['price']?>€</td> </tr> <?php } } else{ echo "<p> Your cart is empty </p>"; } ?> <tr> <td> For pay: <?php echo $totalprice ?> € </td> </table> <h2 align="center"><br/><button type="submit" name="submit"> Refresh cart</button></h2> </form> </tr> </table> <h3 align="center"><p> To remove from cart, set to 0.</p></h3>
  6. Hi guys, i have a shopping cart made in php, now it works very well but i have a problem with sending its content to my email. So basicly when a customer chooses all the stuff he wants to buy i need it to send me the cart content to my email. Here si the while loop : while($row=mysql_fetch_array($query)) { $subtotal=$_SESSION['cart'][$row['product_id']]['quantity']*$row['price']; $totalprice+=$subtotal; ?> <tr> <td><?php echo $row['name'] ?></td> <td><input type="text" name="quantity[<?php echo $row['product_id']?>]" size="5" value="<?php echo $_SESSION['cart'][$row['product_id']]['quantity'] ?>"/></td> <td><?php echo $row['price']?>€</td> <td><?php echo $_SESSION['cart'][$row['product_id']]['quantity']*$row['price']?>€</td> </tr> <?php } So how could i copy the content of the cart that is created in this while loop and send it to email. I used <form action="checkout.php" method="post"> <textarea name="message">Full price: <?php echo $totalprice; ?></textarea> </form> Which send me a total price but i can't figure out how to send all the bought products with it.
  7. Hi everyone i made a shopping cart using PHP and MYSQL table. I am kind of an amateur in php and i would like to have an online store, so the basic problem is i have a website and a Shopping Cart, but i don't know what to do, so when a buyer presses buy now, the content of shopping cart will be sent to my email, so i would know what he bought. So can you tell me how to implement a button BUY NOW that will if pressed send me a content of shopping cart straight to my email.Here is the code. I have a table called products in my mysql database. <?php if(isset($_POST['submit'])){ foreach ($_POST['quantity'] as $key => $val) { if ($val==0) { unset ($_SESSION['cart'][$key]); } else { $_SESSION['cart'][$key]['quantity']=$val; } } } ?> <h1> Cart </h1> <form method="post" action="index.php?page=cart"> <table> <tr> <th>Name</th> <th>Quantity</th> <th>Price</th> <th>All Price </th> </tr> <?php $sql="SELECT * FROM products WHERE product_id IN ("; foreach($_SESSION['cart'] as $id => $value) { $sql.=$id.","; } $sql=substr($sql, 0, -1).") ORDER BY name ASC"; $query=mysql_query($sql); $totalprice=0; while($row=mysql_fetch_array($query)) { $subtotal=$_SESSION['cart'][$row['product_id']]['quantity']*$row['price']; $totalprice+=$subtotal; ?> <tr> <td><?php echo $row['name'] ?></td> <td><input type="text" name="quantity[<?php echo $row['product_id']?>]" size="5" value="<?php echo $_SESSION['cart'][$row['product_id']]['quantity'] ?>"/></td> <td><?php echo $row['price']?>€</td> <td><?php echo $_SESSION['cart'][$row['product_id']]['quantity']*$row['price']?>€</td> </tr> <?php } ?> <tr> <td> To Pay: <?php echo $totalprice ?></td> </table> <br/><button type="submit" name="submit"> Refresh</button> </form> <p> To remove product set to 0.</p>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.