get_movie_category.php

/******************************************* 
menu.js : EZserver API Samples
Author: EZhometech
Initial Date: 09/30/2016
Modified Date: 09/30/2016
http://www.ezhometech.com
sales@ezhometech.com
Copyright: EZhometech Inc. 
********************************************/
filename: get_movie_category.php

description: use token to get movie categories.

<?php
$szezserverip="192.168.0.10";
$szAPIport="17000";
$szuserid="root";
$szpassword="1234";
$str=vsprintf("%s:%s",array($szuserid,$szpassword));
$strenc=base64_encode($str);
// Web API: createtokenbased64 
$apiurl=vsprintf("http://%s:%s/token/createtokenbased64?encrpty=%s",array($szezserverip,$szAPIport,$strenc));
$szreponse = file_get_contents($apiurl);
// Get token
$sztoken=substr($szreponse,6,strlen($szreponse)-8);
// Web API: get_movie_category with token
$apiurl=vsprintf("http://%s:%s/server/get_movie_category?token=%s",array($szezserverip,$szAPIport,$sztoken));
$ezresult = file_get_contents($apiurl);
echo $ezresult;
// Web API: destroytoken with token
$apiurl=vsprintf("http://%s:%s/token/destroytoken?token=%s",array($szezserverip,$szAPIport,$sztoken));
$szuptime = file_get_contents($apiurl);
?>


Copyright © EZhometech, Inc.