Skip to content
Advertisement

Tag: php

Ajax request with codeigniter 403 (forbidden)

I’m trying to send an value with Ajax to Controller file in Codeigniter but without success.I have searched for that problem and i now this question is made many times here,but still can’t find a sultion.Hope anyone can help me. Thanks ! Js file. Controller function.It’s in file called MyChat. Answer Add this code in your footer view before including

How do you modify a file using JavaScript together with PHP?

I want to add text to a text document using JavaScript and PHP. What would be the best way to do this? Answer This is possible by using Javascript (front-end) to send an ajax request to the PHP server script that does the operation (back-end). What you can do is use jQuery.ajax or XMLHttpRequest. XMLHttpRequest jQuery.ajax Note: There is also

AJAX works on localhost, but doesn’t on live server

Below code works on localhost, but not on live server. MAIN EDIT: Only 1 thing remains which is not working: On AJAX success this will being executed: How ever, the label(for example) is not being updated. The label needs to be updated by the score which is given (data.score_result). Ajax code: When I put alert(‘test’); above the $.ajax({ code it

CORS Errors only with 400 bad request react fetch request

I’m trying to make ‘POST’ request in react but i’m getting a few problems regarding CORS. I was just following what console says and fix them in server side [which is PHP] and client side everything works fine when the status is 200 but when status 400 it shows login:1 Failed to load http://192.168.0.102/API/: No ‘Access-Control-Allow-Origin’ header is present on

Why PHP strlen() and Javascript xxx.length is not equal?

I have following text: Ankylosaurus was an armored dinosaur that lived roughly 67 million years ago, at the very end of the Cretaceous Period. This genus was among the last of the non-avian dinosaurs, living alongside Tyrannosaurus, Triceratops, and Edmontosaurus. Its name means ‘fused lizard’; bones in its skull and other parts of its body were fused, increasing their strength.

How do I return data as a Key & Value pair from MySQL

I’m trying to return a JSON object with a Key,Value pair, both of which are seperate columns in my MySQL table. So the MySQL table Looks (simplified 1000%) like this: And I want a JSON object like I could build it up as a string in MySQL by looping through the table and concat everything together, then just parse it

Sweetalert2 redirection

I’m struggling with this for a few hours already and I think that the solution is very simple. First a bit of background. So, I have a php page where I can enter a number in a texfield. If the number entered is higher than the credit the user has, then I have to show an error message. When the

Advertisement