POST METHOD is not working but not showing any ErrorHow does database indexing work?How can I sanitize user input with PHP?Detecting request type in PHP (GET, POST, PUT or DELETE)How do I get PHP errors to display?How does PHP 'foreach' actually work?php script echoing part of the php instead of what intendedReference - What does this error mean in PHP?how to get Data from MySQL using PHP ? Getting error with my codejquery ajax post doesn't workmulti object PDO Json Response
Can you remove a blindfold using the Telekinesis spell?
Help me, I hate squares!
Why don't short runways use ramps for takeoff?
Adding a (stair/baby) gate without facing walls
Should I put my name first or last in the team members list?
Just how much information should you share with a former client?
How and why does the ATR-72 sometimes use reverse thrust to push back from the gate?
Patio gate not at right angle to the house
A conjectural trigonometric identity
Applications of pure mathematics in operations research
How to structure presentation to avoid getting questions that will be answered later in the presentation?
Why didn't General Martok receive discommendation in Star Trek: Deep Space Nine?
Why do we need a voltage divider when we get the same voltage at the output as the input?
Using Python in a Bash Script
What Marvel character has this 'W' symbol?
LWC: Removing a class name on scroll
Were there any unmanned expeditions to the moon that returned to Earth prior to Apollo?
How to efficiently shred a lot of cabbage?
Best practice for keeping temperature constant during film development at home
Best Ergonomic Design for a handheld ranged weapon
What to expect in a jazz audition
May a hotel provide accommodation for fewer people than booked?
Scam? Checks via Email
What do the novel titles of The Expanse series refer to?
POST METHOD is not working but not showing any Error
How does database indexing work?How can I sanitize user input with PHP?Detecting request type in PHP (GET, POST, PUT or DELETE)How do I get PHP errors to display?How does PHP 'foreach' actually work?php script echoing part of the php instead of what intendedReference - What does this error mean in PHP?how to get Data from MySQL using PHP ? Getting error with my codejquery ajax post doesn't workmulti object PDO Json Response
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am new to PHP. I am using below code in my project but its not working but its not throwing any error. I tried to convert it to GET method but still its not working too.
PHP is my frontend and MYSQL database is the backend.
I have already created the table in the back end and I checked the user table but values are not inserted too.
Methods Tried:
I have inserted data manually using insert command and its working fine.
API Call
http://localhost/test/register.php?phone=12345&name=Smith&birthdate=1974-12-01&address=7th Avenue
Error:
"error_msg":"Required parameter (phone,name,birthdate,address) is missing!"
Register.php
<?php
require_once 'db_functions.php';
$db=new DB_Functions();
$response=array();
if(isset($_POST['phone']) &&
isset($_POST['name']) &&
isset($_POST['birthdate']) &&
isset($_POST['address']))
$phone=$_POST['phone'];
$name=$_POST['name'];
$birthdate=$_POST['birthdate'];
$address=$_POST['address'];
if($db->checkExistsUser($phone))
$response["error_msg"]="User already exists with" .$phone;
echo json_encode($response);
else
//Create new user
$user=$db->registerNewUser($phone,$name,$birthdate,$address);
if($user)
$response["phone"]=$user["Phone"];
$response["name"]=$user["Name"];
$response["birthdate"]=$user["Birthdate"];
$response["address"]=$user["Address"];
echo json_encode($response);
else
$response["error_msg"]="Unknown Error occurred in registration!";
echo json_encode($response);
else
$response["error_msg"]="Required parameter (phone,name,birthdate,address) is missing!";
echo json_encode($response);
?>
CheckUser.PHP
<?php
require_once 'db_functions.php';
$db=new DB_Functions();
$response=array();
if(isset($_POST['phone']))
$phone=$_POST['phone'];
if($db->checkExistsUser($phone))
$response["exists"]=TRUE;
echo json_encode($response);
else
$response["exists"]=FALSE;
echo json_encode($response);
else
$response["error_msg"]="Required parameter (phone) is missing!";
echo json_encode($response);
?>
db_functions.php
<?php
class DB_Functions
private $conn;
function __construct()
require_once 'db_connect.php';
$db=new DB_Connect();
$this->conn=$db->connect();
function __destruct()
// TODO: Implement __destruct() method.
/*
* Check user exists
* return true/false
*/
function checkExistsUser($phone)
$stmt=$this->conn->prepare("select * from User where Phone=?");
$stmt->bind_param("s",$phone);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows > 0)
$stmt->close();
return true;
else
$stmt->close();
return false;
/*
* Register new user
* return User Object if user was created
* Return error mssage if have exception
*/
public function registerNewUser($phone,$name,$birthdate,$address)
$stmt=$this->conn->prepare("INSERT INTO User(Phone,Name,Birthdate,Address) VALUES(?,?,?,?)");
$stmt->bind_param("ssss",$phone,$name,$birthdate,$address);
$result=$stmt->execute();
$stmt->close();
if($result)
$stmt=$this->$this->conn->prepare("SELECT * FROM User where Phone = ?");
$stmt->bind_param("s",$phone);
$stmt->execute();
$user=$stmt->get_result()->fetch_assoc();
$stmt->close();
return $user;
else
return false;
db_connect.php
<?php
class DB_Connect
private $conn;
public function connect()
require_once 'config.php';
$this->conn=new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_DATABASE);
return $this->conn;
?>
Name, Phone, Address and Dateofbirth value need to be inserted in MYSQL database.
php mysql sql mysqli
|
show 9 more comments
I am new to PHP. I am using below code in my project but its not working but its not throwing any error. I tried to convert it to GET method but still its not working too.
PHP is my frontend and MYSQL database is the backend.
I have already created the table in the back end and I checked the user table but values are not inserted too.
Methods Tried:
I have inserted data manually using insert command and its working fine.
API Call
http://localhost/test/register.php?phone=12345&name=Smith&birthdate=1974-12-01&address=7th Avenue
Error:
"error_msg":"Required parameter (phone,name,birthdate,address) is missing!"
Register.php
<?php
require_once 'db_functions.php';
$db=new DB_Functions();
$response=array();
if(isset($_POST['phone']) &&
isset($_POST['name']) &&
isset($_POST['birthdate']) &&
isset($_POST['address']))
$phone=$_POST['phone'];
$name=$_POST['name'];
$birthdate=$_POST['birthdate'];
$address=$_POST['address'];
if($db->checkExistsUser($phone))
$response["error_msg"]="User already exists with" .$phone;
echo json_encode($response);
else
//Create new user
$user=$db->registerNewUser($phone,$name,$birthdate,$address);
if($user)
$response["phone"]=$user["Phone"];
$response["name"]=$user["Name"];
$response["birthdate"]=$user["Birthdate"];
$response["address"]=$user["Address"];
echo json_encode($response);
else
$response["error_msg"]="Unknown Error occurred in registration!";
echo json_encode($response);
else
$response["error_msg"]="Required parameter (phone,name,birthdate,address) is missing!";
echo json_encode($response);
?>
CheckUser.PHP
<?php
require_once 'db_functions.php';
$db=new DB_Functions();
$response=array();
if(isset($_POST['phone']))
$phone=$_POST['phone'];
if($db->checkExistsUser($phone))
$response["exists"]=TRUE;
echo json_encode($response);
else
$response["exists"]=FALSE;
echo json_encode($response);
else
$response["error_msg"]="Required parameter (phone) is missing!";
echo json_encode($response);
?>
db_functions.php
<?php
class DB_Functions
private $conn;
function __construct()
require_once 'db_connect.php';
$db=new DB_Connect();
$this->conn=$db->connect();
function __destruct()
// TODO: Implement __destruct() method.
/*
* Check user exists
* return true/false
*/
function checkExistsUser($phone)
$stmt=$this->conn->prepare("select * from User where Phone=?");
$stmt->bind_param("s",$phone);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows > 0)
$stmt->close();
return true;
else
$stmt->close();
return false;
/*
* Register new user
* return User Object if user was created
* Return error mssage if have exception
*/
public function registerNewUser($phone,$name,$birthdate,$address)
$stmt=$this->conn->prepare("INSERT INTO User(Phone,Name,Birthdate,Address) VALUES(?,?,?,?)");
$stmt->bind_param("ssss",$phone,$name,$birthdate,$address);
$result=$stmt->execute();
$stmt->close();
if($result)
$stmt=$this->$this->conn->prepare("SELECT * FROM User where Phone = ?");
$stmt->bind_param("s",$phone);
$stmt->execute();
$user=$stmt->get_result()->fetch_assoc();
$stmt->close();
return $user;
else
return false;
db_connect.php
<?php
class DB_Connect
private $conn;
public function connect()
require_once 'config.php';
$this->conn=new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_DATABASE);
return $this->conn;
?>
Name, Phone, Address and Dateofbirth value need to be inserted in MYSQL database.
php mysql sql mysqli
Where is your HTML form? Can you show it to us too? Maybe you just made a typo or not specified the right method.
– Dharman
Mar 26 at 22:37
How did you send the request? can you add the form?
– user1334621
Mar 26 at 22:38
1
Replace all$_POST
with$_GET
as you're passing query parameters
– kuh-chan
Mar 26 at 22:45
1
What do you get if you vardump$_GET
?
– kuh-chan
Mar 26 at 22:49
1
Yes, you can use POST in PHP, but the API URL you've shown is using GET parameters.
– Greg Schmidt
Mar 26 at 23:07
|
show 9 more comments
I am new to PHP. I am using below code in my project but its not working but its not throwing any error. I tried to convert it to GET method but still its not working too.
PHP is my frontend and MYSQL database is the backend.
I have already created the table in the back end and I checked the user table but values are not inserted too.
Methods Tried:
I have inserted data manually using insert command and its working fine.
API Call
http://localhost/test/register.php?phone=12345&name=Smith&birthdate=1974-12-01&address=7th Avenue
Error:
"error_msg":"Required parameter (phone,name,birthdate,address) is missing!"
Register.php
<?php
require_once 'db_functions.php';
$db=new DB_Functions();
$response=array();
if(isset($_POST['phone']) &&
isset($_POST['name']) &&
isset($_POST['birthdate']) &&
isset($_POST['address']))
$phone=$_POST['phone'];
$name=$_POST['name'];
$birthdate=$_POST['birthdate'];
$address=$_POST['address'];
if($db->checkExistsUser($phone))
$response["error_msg"]="User already exists with" .$phone;
echo json_encode($response);
else
//Create new user
$user=$db->registerNewUser($phone,$name,$birthdate,$address);
if($user)
$response["phone"]=$user["Phone"];
$response["name"]=$user["Name"];
$response["birthdate"]=$user["Birthdate"];
$response["address"]=$user["Address"];
echo json_encode($response);
else
$response["error_msg"]="Unknown Error occurred in registration!";
echo json_encode($response);
else
$response["error_msg"]="Required parameter (phone,name,birthdate,address) is missing!";
echo json_encode($response);
?>
CheckUser.PHP
<?php
require_once 'db_functions.php';
$db=new DB_Functions();
$response=array();
if(isset($_POST['phone']))
$phone=$_POST['phone'];
if($db->checkExistsUser($phone))
$response["exists"]=TRUE;
echo json_encode($response);
else
$response["exists"]=FALSE;
echo json_encode($response);
else
$response["error_msg"]="Required parameter (phone) is missing!";
echo json_encode($response);
?>
db_functions.php
<?php
class DB_Functions
private $conn;
function __construct()
require_once 'db_connect.php';
$db=new DB_Connect();
$this->conn=$db->connect();
function __destruct()
// TODO: Implement __destruct() method.
/*
* Check user exists
* return true/false
*/
function checkExistsUser($phone)
$stmt=$this->conn->prepare("select * from User where Phone=?");
$stmt->bind_param("s",$phone);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows > 0)
$stmt->close();
return true;
else
$stmt->close();
return false;
/*
* Register new user
* return User Object if user was created
* Return error mssage if have exception
*/
public function registerNewUser($phone,$name,$birthdate,$address)
$stmt=$this->conn->prepare("INSERT INTO User(Phone,Name,Birthdate,Address) VALUES(?,?,?,?)");
$stmt->bind_param("ssss",$phone,$name,$birthdate,$address);
$result=$stmt->execute();
$stmt->close();
if($result)
$stmt=$this->$this->conn->prepare("SELECT * FROM User where Phone = ?");
$stmt->bind_param("s",$phone);
$stmt->execute();
$user=$stmt->get_result()->fetch_assoc();
$stmt->close();
return $user;
else
return false;
db_connect.php
<?php
class DB_Connect
private $conn;
public function connect()
require_once 'config.php';
$this->conn=new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_DATABASE);
return $this->conn;
?>
Name, Phone, Address and Dateofbirth value need to be inserted in MYSQL database.
php mysql sql mysqli
I am new to PHP. I am using below code in my project but its not working but its not throwing any error. I tried to convert it to GET method but still its not working too.
PHP is my frontend and MYSQL database is the backend.
I have already created the table in the back end and I checked the user table but values are not inserted too.
Methods Tried:
I have inserted data manually using insert command and its working fine.
API Call
http://localhost/test/register.php?phone=12345&name=Smith&birthdate=1974-12-01&address=7th Avenue
Error:
"error_msg":"Required parameter (phone,name,birthdate,address) is missing!"
Register.php
<?php
require_once 'db_functions.php';
$db=new DB_Functions();
$response=array();
if(isset($_POST['phone']) &&
isset($_POST['name']) &&
isset($_POST['birthdate']) &&
isset($_POST['address']))
$phone=$_POST['phone'];
$name=$_POST['name'];
$birthdate=$_POST['birthdate'];
$address=$_POST['address'];
if($db->checkExistsUser($phone))
$response["error_msg"]="User already exists with" .$phone;
echo json_encode($response);
else
//Create new user
$user=$db->registerNewUser($phone,$name,$birthdate,$address);
if($user)
$response["phone"]=$user["Phone"];
$response["name"]=$user["Name"];
$response["birthdate"]=$user["Birthdate"];
$response["address"]=$user["Address"];
echo json_encode($response);
else
$response["error_msg"]="Unknown Error occurred in registration!";
echo json_encode($response);
else
$response["error_msg"]="Required parameter (phone,name,birthdate,address) is missing!";
echo json_encode($response);
?>
CheckUser.PHP
<?php
require_once 'db_functions.php';
$db=new DB_Functions();
$response=array();
if(isset($_POST['phone']))
$phone=$_POST['phone'];
if($db->checkExistsUser($phone))
$response["exists"]=TRUE;
echo json_encode($response);
else
$response["exists"]=FALSE;
echo json_encode($response);
else
$response["error_msg"]="Required parameter (phone) is missing!";
echo json_encode($response);
?>
db_functions.php
<?php
class DB_Functions
private $conn;
function __construct()
require_once 'db_connect.php';
$db=new DB_Connect();
$this->conn=$db->connect();
function __destruct()
// TODO: Implement __destruct() method.
/*
* Check user exists
* return true/false
*/
function checkExistsUser($phone)
$stmt=$this->conn->prepare("select * from User where Phone=?");
$stmt->bind_param("s",$phone);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows > 0)
$stmt->close();
return true;
else
$stmt->close();
return false;
/*
* Register new user
* return User Object if user was created
* Return error mssage if have exception
*/
public function registerNewUser($phone,$name,$birthdate,$address)
$stmt=$this->conn->prepare("INSERT INTO User(Phone,Name,Birthdate,Address) VALUES(?,?,?,?)");
$stmt->bind_param("ssss",$phone,$name,$birthdate,$address);
$result=$stmt->execute();
$stmt->close();
if($result)
$stmt=$this->$this->conn->prepare("SELECT * FROM User where Phone = ?");
$stmt->bind_param("s",$phone);
$stmt->execute();
$user=$stmt->get_result()->fetch_assoc();
$stmt->close();
return $user;
else
return false;
db_connect.php
<?php
class DB_Connect
private $conn;
public function connect()
require_once 'config.php';
$this->conn=new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_DATABASE);
return $this->conn;
?>
Name, Phone, Address and Dateofbirth value need to be inserted in MYSQL database.
php mysql sql mysqli
php mysql sql mysqli
edited Mar 26 at 23:13
ADyson
28.6k12 gold badges28 silver badges46 bronze badges
28.6k12 gold badges28 silver badges46 bronze badges
asked Mar 26 at 22:35
KotlinKotlin
196 bronze badges
196 bronze badges
Where is your HTML form? Can you show it to us too? Maybe you just made a typo or not specified the right method.
– Dharman
Mar 26 at 22:37
How did you send the request? can you add the form?
– user1334621
Mar 26 at 22:38
1
Replace all$_POST
with$_GET
as you're passing query parameters
– kuh-chan
Mar 26 at 22:45
1
What do you get if you vardump$_GET
?
– kuh-chan
Mar 26 at 22:49
1
Yes, you can use POST in PHP, but the API URL you've shown is using GET parameters.
– Greg Schmidt
Mar 26 at 23:07
|
show 9 more comments
Where is your HTML form? Can you show it to us too? Maybe you just made a typo or not specified the right method.
– Dharman
Mar 26 at 22:37
How did you send the request? can you add the form?
– user1334621
Mar 26 at 22:38
1
Replace all$_POST
with$_GET
as you're passing query parameters
– kuh-chan
Mar 26 at 22:45
1
What do you get if you vardump$_GET
?
– kuh-chan
Mar 26 at 22:49
1
Yes, you can use POST in PHP, but the API URL you've shown is using GET parameters.
– Greg Schmidt
Mar 26 at 23:07
Where is your HTML form? Can you show it to us too? Maybe you just made a typo or not specified the right method.
– Dharman
Mar 26 at 22:37
Where is your HTML form? Can you show it to us too? Maybe you just made a typo or not specified the right method.
– Dharman
Mar 26 at 22:37
How did you send the request? can you add the form?
– user1334621
Mar 26 at 22:38
How did you send the request? can you add the form?
– user1334621
Mar 26 at 22:38
1
1
Replace all
$_POST
with $_GET
as you're passing query parameters– kuh-chan
Mar 26 at 22:45
Replace all
$_POST
with $_GET
as you're passing query parameters– kuh-chan
Mar 26 at 22:45
1
1
What do you get if you vardump
$_GET
?– kuh-chan
Mar 26 at 22:49
What do you get if you vardump
$_GET
?– kuh-chan
Mar 26 at 22:49
1
1
Yes, you can use POST in PHP, but the API URL you've shown is using GET parameters.
– Greg Schmidt
Mar 26 at 23:07
Yes, you can use POST in PHP, but the API URL you've shown is using GET parameters.
– Greg Schmidt
Mar 26 at 23:07
|
show 9 more comments
1 Answer
1
active
oldest
votes
Your URL call is GET method, but you are querying POST variables.
So basically your if statement resulted to false hence the error message. Change them to GET.
if(isset($_GET['phone']) &&
isset($_GET['name']) &&
isset($_GET['birthdate']) &&
isset($_GET['address']))
Then it should work
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367148%2fpost-method-is-not-working-but-not-showing-any-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your URL call is GET method, but you are querying POST variables.
So basically your if statement resulted to false hence the error message. Change them to GET.
if(isset($_GET['phone']) &&
isset($_GET['name']) &&
isset($_GET['birthdate']) &&
isset($_GET['address']))
Then it should work
add a comment |
Your URL call is GET method, but you are querying POST variables.
So basically your if statement resulted to false hence the error message. Change them to GET.
if(isset($_GET['phone']) &&
isset($_GET['name']) &&
isset($_GET['birthdate']) &&
isset($_GET['address']))
Then it should work
add a comment |
Your URL call is GET method, but you are querying POST variables.
So basically your if statement resulted to false hence the error message. Change them to GET.
if(isset($_GET['phone']) &&
isset($_GET['name']) &&
isset($_GET['birthdate']) &&
isset($_GET['address']))
Then it should work
Your URL call is GET method, but you are querying POST variables.
So basically your if statement resulted to false hence the error message. Change them to GET.
if(isset($_GET['phone']) &&
isset($_GET['name']) &&
isset($_GET['birthdate']) &&
isset($_GET['address']))
Then it should work
answered Mar 27 at 4:26
GeneCodeGeneCode
5,7776 gold badges35 silver badges66 bronze badges
5,7776 gold badges35 silver badges66 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367148%2fpost-method-is-not-working-but-not-showing-any-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Where is your HTML form? Can you show it to us too? Maybe you just made a typo or not specified the right method.
– Dharman
Mar 26 at 22:37
How did you send the request? can you add the form?
– user1334621
Mar 26 at 22:38
1
Replace all
$_POST
with$_GET
as you're passing query parameters– kuh-chan
Mar 26 at 22:45
1
What do you get if you vardump
$_GET
?– kuh-chan
Mar 26 at 22:49
1
Yes, you can use POST in PHP, but the API URL you've shown is using GET parameters.
– Greg Schmidt
Mar 26 at 23:07