Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

jQuery, PHP, Ajax For the url value, whatever I try url: cart-process.php, url: /cart-process.php, url: ./cart-process.php, it is not working. It shows that the page

jQuery, PHP, Ajax

For the url value, whatever I try url: "cart-process.php", url: "/cart-process.php", url: "./cart-process.php", it is not working. It shows that the page is not found (404).

How to solve this problem? Thank you.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

features Php cart-process.php us cart.js us head rColor.js us hideForm.js us toggleCart.js us toggleSidebar.js us admin.js us jquery.min.js 5 5 $(function() { $('.product-button_add").on("click', function() { const p_id = $(this).attr("data-id"); console.log(p_id); $.ajax({ type: "GET", data: {p_id : p_id}, url: "cart-process.php", dataType: "JSON", success: function (data) { console.log(data); }, error: function (error) { console.log('Error:', error); } }); }); }); us cart.js us headerColor.js PhD cart-process.php X php index.php php functions.php assets > js > features > Php cart-process.php > ... 1 E?php 2 3 // require_once("db.php"); 4 5 6 if (isset($_GET['p_id'])) { $p_id = htmlspecialchars($_GET['p_id'], ENT_QUOTES, 'UTF-8'); echo $p_id; } 7 8 9 10 ? * GET http://localhosta tart-process.php?p_id=1 jquery.min.js:2 0404 (Not Found) Error: cart.js:16 {readyState: 4, getResponseHeader: f, getAll ResponseHeaders: f.setRequestHeade r: f, overrideMimeType: f, ...}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions