Hi, I am trying to execute an ajax call, but I keep getting "Bad server response". I am trying to get a list of ID's and put them into a separate text file
Here is my ajax call:
Here is my PHP file under \api\v1\custom
What am I doing incorrectly?
Here is my ajax call:
Code:
var id = value.substring(value.indexOf('id=')+3, value.length-1);
$.ajax({
type: "POST",
url: "/custom/idList.php",
data: {"str": id},
success: function(){
console.log("success");
}
});
Here is my PHP file under \api\v1\custom
Code:
if(isset($_POST["str"])){
$id = $_POST["str"];
file_put_contents('path.txt', $id);
}

Comment