I use php to create some html product elements for a shopping cart based on a database . The problem was that if I changed the product quantity and refreshed my page the quantity is changed back to ‘1’ . So I used localStorage to store the quantities of each product . If I refresh , the quantities remain unchanged
Tag: php
jquery – upload image file using ajax is not working
I want to submit my image via jquery and ajax , this is my code: just to add some explanation , when the use choose an image , the form submits immediately . it works fine and post the data to my php page , but it’s empty and has no data I put print_R($_POST) in my page and the
Php file won’t load ajax request
I try query my database from javascript, using ajax request to my php file. This is my code: So I included jquery file into my folder, so that I can access it as shown above. Now my trainPassFrequency.js look like this: where trainfrequency.php only returns (echo) output of the sql query. When I run this code, I never get through
JSON.aprse() error when using php json_encode()
i know that this question asked before but i have never found anything working for my case i have 2 array which is looking like this Array ( [0] => Array ( [`19 January 2021`] => Array ( [0] => Array ( [0] => 36 [1] => 817 [2] => 67 ) ) ) ) Array ( [0] => Array
How to sent value from select box using Ajax?
I have a select box with two options “Approved/Disapproved”. I want the selected option to be sent over to a page ‘action_user_2.php’. Currently, it is sending information when clicking on …
i want to send a javascript prompt answer to my sql databse, is this possible or is there a better way to do this? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question currently have this code activated by a html button: i wanna send the value of group in a sql query
Refresh site exactly every tenth minute (like Cron)
is there any options (PHP, JavaScript) how to refresh website exactly every 10th minute? I got some crob job on server, and every 10th minute I’m reloading the online RTSP stream downloading, and after this reload the video on site get stuck, so I need reload the page every 10th minute after the cron job executed. Thanks for hints. Answer
PHP Write HTML tags into file and display it
I want to make a simple comment system in PHP and my problem is when the user type ‘<‘ it disappear because it takes it to HTML code and mess my code. So what I need to do, when the user type this into the textarea: <stdio.h>, and post it, it should appear as <stdio.h>. My PHP code: I want
How can I filter a generated list from a query from PHP in JS?
I have a list of files from my database. I’m looking for a way to query them. but I’m receiving an error, which is… it only display the first item if my input matches the first. This is the form below is the php and I have the js here Answer You are generating mutliple myUl divs inside while loop
Javascript not printing within php loop
new to php and javascript. I am trying to print an id using javascript within a php loop and nothing is turning up. Here is the code: Answer The problem is, that you want PHP to know, what printID() is and what it should do. PHP knows nothing about JavaScript functions, because JavaScript and PHP are executed on totally different