Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. 220061

    PHP how to store the quantities alongside the products which the user has added to their cart.

    Hello I'm trying to create this shopping cart and I dont understand how to store the quantities alongside the products which the user has added to their cart. I know I need a session but thats all i know. I have tried to do: $_SESSION['quantity'] = $_POST['quantity']; or making an array and...
  2. 220061

    PHP calculate total price based on quantity

    well it'' not solved completely yet. right now I have the problem that it only want to calculate the price * quantity of one item. someone told me I need to store a quantity against each cart item. but I don't understand how to do that this is what I have now for some reason I can't put any code...
  3. 220061

    PHP calculate total price based on quantity

    oke so a little update I'm almost done but I still need it to change only the one that the user changes and not everything. example of what happens now: 1. 2. change quantity for hamburger 3. it changes for everything???? example of what I want to happen: I want that it just changes for the...
  4. 220061

    PHP calculate total price based on quantity

    can I calculate the total price depending on the number that the user types into the input? so for example idk how to do this? this is my code. I have been looking around on the internet but they only gave me examples of how their shopping cart was looking. I don't want that I want ot be able...
  5. 220061

    PHP calculating price based on option

    how do I calculate the price based on the option that the user chooses?? <?php session_start(); error_reporting(E_ALL); ini_set('display_errrors', '1'); // session_destroy(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport"...
  6. 220061

    PHP show item based on id in array

    I feel like i almost got the solution but I'm just not there yet maybe some of you can help me. I have this array where I put id's in. what I want to do is show in winkelmandje (a.k.a shopping cart) the items that are equal to the id. how do I do this? I just can't figure it out?? code <?php...
  7. 220061

    PHP keep item in cart

    I might have a idea what the problem is but not how to fix it how do I show the items that are in the array and not show the items based on the id from the link?
  8. 220061

    PHP keep item in cart

    @simong1993 been trying it for the past few weeks but still no luck items don't stay in cart <?php session_start(); error_reporting(E_ALL); ini_set('display_errrors', '1'); // session_destroy(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta...
  9. 220061

    PHP keep item in cart

    if your asking about where I start the session, well that one is already started I have this kind of session that is on all my coding pages
  10. 220061

    PHP keep item in cart

    yes I'm working with sessions $_SESSION['basket']; is where I want to put the array in
  11. 220061

    PHP keep item in cart

    example of what happens when you do add to cart but the you press the back button and try to add another thing to cart again and the previous item is gone how do I fix this?? where is the previous item???
  12. 220061

    PHP keep item in cart

    hello I'm creating a shopping cart with an array but it doesn't keep the selected item in cart. how do I keep it in the cart? <?php error_reporting(E_ALL); ini_set('display_errrors', '1'); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta...
  13. 220061

    JavaScript clicking on button doesn't show title in the console.log

    I had to add another parentElement to the var shopItem
  14. 220061

    JavaScript clicking on button doesn't show title in the console.log

    thanks for your reply but sadly this doesn't work either
  15. 220061

    JavaScript clicking on button doesn't show title in the console.log

    Hello I'm following a tutorial on javascript and I try to implement this into my project but I have a problem. whenever I click on the add to cart button it doesn't show the title in the console.log like I want it to. how do I fix this this is my error: Uncaught TypeError: Cannot read...
  16. 220061

    PHP submit button sends to blank page loginback??

    new update still doesn't work its stuck on if ($stmt->num_rows == 1){ <?php // dit is allemaal nog niet veilig session_start(); // Check if the user is already logged in, if yes then redirect him to welcome page if(isset($_POST["email"]) && $_POST["password"] === true){ header("location...
  17. 220061

    PHP submit button sends to blank page loginback??

    UPDATE still doesn't work but this is the code right now it stops working by the password verify. thats when it continues to give me false <?php // dit is allemaal nog niet veilig session_start(); // Check if the user is already logged in, if yes then redirect him to welcome page...
  18. 220061

    PHP submit button sends to blank page loginback??

    Hello, I don't really know how to explain this but right now when I submit it stays on the loginback page andit gives me a blank screen? why is it doing this? I have already tried to display the error messages by using ini_set('display_errors', 1); ini_set('display_startup_errors', 1)...
  19. 220061

    PHP inserting twice?

    ah wait never mind I know the problem it is because when I say if($stmt->execute()) it will actually call that execute twice
  20. 220061

    PHP inserting twice?

    hello I'm trying to find out why my db inserts the same row twice., I just can't seem to find out why it does this? <?php include "navbar.php"; include "config.php"; ?> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"...
Back
Top Bottom