如何进行登录,其中参数和值是我从meta\\U key和meta\\U value获取的,其中具有相同的post\\U id。。我一直在努力,但没有任何效果。
下面是我的代码:
//* Login Driver *//
$command = $_GET[\'command\'];
switch ($command) {
case \'login_driver\':
if(empty($_REQUEST[\'email\']) OR empty($_REQUEST[\'password\'])) {
$data = array( "api_status" => 0, "api_message" => "Wrong Email Or Password");
echo json_encode($data);
} elseif( $_REQUEST[\'email\'] == get_post_meta(get_the_ID(), \'email\', true) AND $_REQUEST[\'password\'] == get_post_meta(get_the_ID(), \'password\', true) ) {
$loop = new WP_Query(
array(
\'post_type\' => \'drivers\',
\'meta_query\' => array(
\'relation\' => \'AND\',
array(
\'key\' => \'username\',
\'value\' => $_REQUEST[\'email\'],
\'compare\' => \'=\'
),
array(
\'key\' => \'password\',
\'value\' => $_REQUEST[\'password\'],
)
)
)
);
$data = array("api_status" => 1, "api_message" => "success", "result" => "");
if( $loop->have_posts() ) :
while($loop->have_posts()) : $loop->the_post();
$data[\'result\'][] = array(
"id" => get_the_ID(),
"post_name" => get_the_title(),
"username" => get_post_meta(get_the_ID(), \'username\', true),
"password" => get_post_meta(get_the_ID(), \'password\', true),
"email" => get_post_meta(get_the_ID(), \'email\', true),
"phone" => get_post_meta(get_the_ID(), \'phone\', true),
);
endwhile;
endif;
echo json_encode($data);
}elseif($_REQUEST[\'email\'] != get_post_meta(get_the_ID(), \'email\', true) OR $_REQUEST[\'password\'] != get_post_meta(get_the_ID(), \'password\', true)){
$data = array( "api_status" => 0, "api_message" => "Wrong Email Or Password");
echo json_encode($data);
}else{
$data = array( "api_status" => 0, "api_message" => "Wrong Email Or Password");
echo json_encode($data);
}
break;
}
这是我的桌子:

有人帮我解决问题吗?或者有人能为我提供解决方案吗?因为现在我被困了。。