Why is $email and $pass not printing out, they are posting as empty.
I’m getting the following results from print_r()
[email] =>
[password] =>
Below is my code. What am i doing wrong
<?php
$email = $_POST["data[User][email]"];
$pass = $_POST["data[User][password]"];
$base = 'https://api.whatever.com/Api?';
$params = array(
'Format' => 'json'
,'email' => "$email"
,'password' => "$pass"
);
$url = $base . http_build_query( $params );
$result = file_get_contents( $url );
echo '<pre>';
print_r( json_decode( $result ) );
echo '</pre>';
?>
Extending from comment:
If you post something like
You’ll have to use
to retrieve corresponding value.