Passing data from Python POST request to PHP -
Passing data from Python POST request to PHP -
using php laravel 5. can't seem find out how specific thing. have info in python script. running python command post php method , execute next when hard code api key , secret.
$api_key = 1; $api_secret = 'sesame'; //if api id , secret match, oldest job available timestamp before current time status of 0 if ($api_key == 1 , $api_secret == 'sesame') { $current_dt = ''; $current_dt = date('y.m.d h:i:s'); $first_job_that_qualifies = \app\job::orderby('created_at', 'desc') ->where('status', 0) ->where('available_ts', '<', $current_dt) ->first(); if ($first_job_that_qualifies != null){ $first_job_that_qualifies->status = 1; $first_job_that_qualifies->save(); } } } now take hard-coded values away , check them info i'm passing python.
info = { 'api_key': api_key, 'api_secret': api_secret, } print info r = requests.post(quasar_url, data=data) print r.text how phone call dictionary "data" python in php function can utilize in initial if statement?
thanks!
may mean reading $_post parameters?
if ($api_key == $_post['api_key'] , $api_secret == $_post['api_secret']) {
php python request laravel-5
Comments
Post a Comment