پسورد و پیج با جیسون ارسال نمیشن
من کد php رو براتون میزارم
<?php
if ( isset( $_POST['password'])) {
if ( $_POST['password'] == "1478914789" ) {
header( "Content-type: application/json" );
$sitename = "http://localhost/";
$hostname = "localhost";
$username = "root";
$password = "";
$database = "specialprogram";
$tbl_name = "Orders_TBL";
$order_by = "id";
$records_limit = "10";
$connect = @mysqli_connect( $hostname, $username, $password, $database);
if( $connect ) {
@mysqli_query( $connect , "SET CHARACTER SET utf8;");
$temp1 = @mysqli_query( $connect , "SELECT COUNT(*) FROM ".$tbl_name);
$temp2 = @mysqli_fetch_row( $temp1);
$total_records = $temp2[0];
if( isset( $_POST['page'])) {
$page= $_POST['page'] - 1;
$offset = $page * $records_limit;
} else {
$page= 0;
$offset = 0;
}
$my_query = "SELECT * FROM ".$tbl_name." ORDER BY ".$order_by." DESC LIMIT ".$offset." , ".$records_limit;
$result = @mysqli_query( $connect, $my_query);
if( $result ) {
$response['orders'] = array();
$response['success'] = 1;
while( $row = @mysqli_fetch_array( $result )) {
$orders = array();
$orders['id'] = $row['id'];
$orders['name'] = $row['name'];
$orders['email'] = $row['email'];
$orders['phone'] = $row['phone'];
$orders['tools'] = $row['tools'];
$orders['dateTime'] = $row['dateTime'];
array_push( $response['orders'] , $orders);
}
} else {
$response['success'] = 0;
$response['message'] = "nothing";
}
echo( json_encode( $response ) );
@mysqli_close( $connect );
}
} else { echo ("<center>Invaild Password</center>"); } } else { echo ("<center>Can't connect to the server.</center>"); }
?>