Beispiel #1
0
$data[0]['res_id'] = '155';
$data[0]['url'] = 'http://www.11google.com';
$data[0]['title'] = 'tes data';
$data[0]['category_id'] = '1';
$data[0]['description'] = 'tes desc';

$data[1]['res_id'] = '157';
$data[1]['url'] = 'http://www.11google2.com';
$data[1]['title'] = 'tes data2';
$data[1]['category_id'] = '1';
$data[1]['description'] = "tes desc2's \nsdo";

$data[2]['res_id'] = '198';
$data[2]['url'] = 'http://www.11google3.com';
$data[2]['title'] = 'tes data3';
$data[2]['category_id'] = '12';
$data[2]['description'] = "tes desc3\"dsfj'dfdfd";

$out = json_serialize($data);

// send data with curl

$api_url = 'http://localhost/indexu_api/api/api.php';
$post['api_key'] = 'sjdfsidyr984idfjsdfhsdfh';
$post['act'] = 'res_edit';
$post['data'] = $out;

$result = ddcurl_post($api_url,$post);
print $result;
?>
<p>Done.</p>
Beispiel #2
0
<?php
  /************************************************
  ddcurl library
  by Dody Rachmat Wicaksono (dodyrw@gmail.com)
  
  version 1.0
  Nov 26 2010
  ************************************************/
  

  include "ddcurl.php";

  $url_login = '******';
  $url_clear_tpl = 'http://www.abcwebsites.com/admin/clear_templates_c.php';
  $url_restoredb = 'http://www.abcwebsites.com/admin/db_backup.php?file=demobackup.sql&pflag=res';

  $post['username'] = '******';
  $post['password'] = '******';
  $post['pflag'] = 'login';

  ddcurl_post($url_login,$post);
  ddcurl_fetch($url_restoredb);
  ddcurl_fetch($url_clear_tpl);
  
  print "DONE!";
?>