Problem with custom plugin using AJAX to pull info from php file

Đã có trọn bộ đề thi thử THPT Quốc Gia 2022 các môn: vip.dethihsg247.com

I’m extremely frustrated over what I expected to be an easy task.

I have a wordpress plugin that I’m looking to do the following (with woocommerce) —

When i do this my normal way, i get a file not found, but i can access it directly.

I’ve done this many times in the past, without wordpress, with no issue. Now i’m seeing things about needing to use admin-ajax as some sort of intermediary?? compounding that, all examples have things about adding in add’l JS files, which I’m not looking to do. I just want the JS added to the footer to look at a php file, then use that php files content elsewhere.

I’ve stripped down my code below. It’s not exactly my original intent, I just plan on moving the script in myfile.php to the my_action function. It returns a 400 error after many different attempts. can anyone point me in the right direction?

thanks

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com