Jump to content

divinedesigns1

Members
  • Posts

    1,200
  • Joined

  • Last visited

Everything posted by divinedesigns1

  1. So i have been editing this website over and over again from resolution 240px to 1680px and it looks great on my desktop but soon as i place it online it keep on messing up the placement for certain divs on the website. can someone take a look and let me know what the H im doing wrong? www.divinedesigns1.net
  2. hey so i been working on this website and as always have to make changes to it, so now im stuck on trying to get the used price of an items if the person picked to buy the used product. but i keep on ending up with the original price all the time can anyone give me some tips or hint on going about doing this? if(isset($_POST['promit'])){ include "php/sql_cn2.php"; $pid = $_POST['pid']; $sql = mysqli_query($con, "SELECT usedprice, price FROM thoseproduct WHERE id='$pid'") or die('Error: ' . mysqli_error($con)); if($sql){ while($row = mysqli_fetch_assoc($sql)){ $uprice = $row['usedPrice']; $price = $row['price']; } } $wasFound = false; $i = 0; // if the cart session is empty or not set if(!isset($_SESSION['cart_array']) || count($_SESSION['cart_array']) < 1){ // if the cart is empty $_SESSION['cart_array'] = array(0 => array("item_id" => $pid, "quantity" => 1, "price" => $price, "uprice" => $uprice)); header("location: confirm.php"); }else{ // run cart if have atleast one item foreach($_SESSION['cart_array'] as $each_item){ $i++; while(list($key, $value) = each($each_item)){ if($key == "item_id" && $value == $pid){ // that item is in the cart already adject quantity array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id" => $pid, "quantity" => $each_item["quantity"] + 1, "price" => $price, "uprice" => $uprice))); $wasFound = true; header("location: confirm.php"); } } } // if no item is in the cart if($wasFound == false){ array_push($_SESSION['cart_array'], array("item_id" => $pid, "quantity" => 1)); header("location: confirm.php"); } } }
  3. hey, i have create a website, e-commerce website and i ran into a problem, where the chopping cart icon or image doesnt display the total amount of items within the cart once i click the add to cart button how do i go about doing this? i know i have to use ajax to get this done but i have zero experience with ajax
  4. yes the $product gets the name from another page. and ill definitely try that, thanks Don
  5. hey, i need some help, i am trying to use an array to create an dynamic statement so i can create this page no matter what the own decided to add to the database $query = mysqli_query($con, "SELECT * FROM department ORDER BY id ASC") or die('Error: ' . mysqli_error($con)); if($query){ while($row = mysqli_fetch_assoc($query)){ $id = $row['id']; $name = $row['name']; $list[] = $name; $detail = $row['description']; $department = $row['type']; } } foreach($list as $items){ $items = strtolower($items); echo $items . '<br>'; } if($product == $items){ } ok so the above codes, get all the information for me, which i need, it then add the name only to the array list[]. after that i used the foreach function to convert the array, and remove all uppercases to lowercases. now for the last statement it suppose to create an if statement which it compares the items, to the $product and if it does then it does something. but this is the part i need help with. how do i go about getting this done? any tips or hints?
  6. how do i go about getting the lowest price from the database? it was solve, imma use the min() function to get it done
  7. hey i keep on having vertical spaces, between my divs that doesnt contain no <p> tags, i have margin and padding set at 0. been googling a solution for a while now. any advice would be helpful issue solve, went over my codes and i notice i had min-height:100% else where, which now im not sure why it should matter if i have move than one min-height for the website main div and another secondary div
  8. thats what im using, maybe i shouldnt use sanitized to describe the use of mysqli real escape string
  9. divinedesigns1

    error issue

    so i keep getting this error, i try to escaping the double and single quotes but nothing seem to be working but if i remove the single and double quotes myself it gets save no problem Errors: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's G-Shock anti-magnetic X-Large G watch features a 51mm wide by 17mm thick black' at line 1 this is the code im using to escape the single and double quotes $detail = str_replace('"','"',$detail);$detail = str_replace("'","'",$detail); any tips or hint will be useful
  10. problem was fixed with explode() + its limit if there's another way of doing this let me know
  11. how would i go about getting specific words from the database once im using the query or after i full the information from the query like if i have "Big Sales On Wednesday Join Us Now" but i only want "Sales On Wednesday" how do i go about doing this? im at a blank at the moment
  12. wooot wooot it working thank you guys, dsonesuk and justsomeguy
  13. wooot wooot it working thank you guys, dsonesuk and justsomeguy
  14. getting a boolean of false once i upload a jpg, etc but boolean of true once i upload a txt or doc file when i var_dump() the $ptype i get this once i try to upload a doc or txt file string 'application/octet-stream' (length=24) and i get this once i try to upload the correct file string 'image/gif' (length=9) so im not sure how the file isnt being stopped once i try to compare it to the array
  15. actually i went around a few ways to figure out $ptype is holding any value, also i echo out $ptype, i used the $allowed array to select each value one by one $allowed[0], etc. i have even tried the foreach() different if statements and now im about to do var_dump and print_r
  16. thats the thing, i tried that and it still doesnt give out the correct respond
  17. so that should work even with this $ptype = $_FILES['imgs']['type'];
  18. ok, so im using the in_array() dont i have to use it against the variable im checking for?
  19. ok im having this issue with the format that is in an array() when comparing it to the $_FILES type $allowed = array('png', 'jpg', 'jpeg', 'gif');if($ptype != $allowed){ $errors[] = 'This format isnt allow</br>Accepted formats are as followed: PNG, JPG, JPEG, GIF';} when i try to upload a .tiff, .doc, .txt file it still upload but once i upload the correct file it displays the error message any tips, hint, advice on how i can go about fixing this?
  20. ok, i think im going in too deeply here, but i would like to accomplish this as an achievement and as a learning process. i have 3 tables in my database at the moment, these database are x, y, z. i would like the database Y, which holds all the items and department numbers to display 1 or 2 of each items within those departments. how do i go about doing this? any tips? hint? or advice?
×
×
  • Create New...