.htaccess file is not getting post method in php -


i using simple .htaccess file rest service implementation

options +followsymlinks rewriteengine on  rewriterule ^([a-za-z_-]*)$ get_price.php?name=$1 [nc,qsa] 

currently working fine $_get method , returning

{ status: 200 status_message: "record found" data: "kashif@gmail.com" } 

but pass parameter using $_post returns

{ status: 200 status_message: "record found" data: "" } 

any idea doing mistake. not expert in .htaccess files.

below simple testing class get_price.php.

<?php  header("content-type:application/json"); include 'header.php'; $name = $_request['name'];   $friendresult = mysqli_query($con,"select id user                     name='$name'");      $row = mysqli_fetch_array($friendresult);            $data = $row['id'];  deliver_response(200,"record found",$data);  function deliver_response($status,$status_message,$data){  header("http/1.1 $status $status_message"); $response['status'] = $status; $response['status_message'] = $status_message; $response['data'] = $data;  $json_response = json_encode($response);  echo $json_response ;  }   ?> 


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -