كيف استطيع ارسال هذا الكود مباشرتآ من شريط العنوان ؟
<?php
/* Dot TK API - PHP example. Be sure to have openSSL support */
/* parameter array */
$postdata = http_build_query(
array(
'command' => 'ADD',
'url' => 'http://www.example.net/a/very/long/url/here',
'domainname' => 'THATSSHORT.TK',
'output' => 'TEXT',
'registrantnr'=> '1234567',
'token' => '0123456789ABCDEFgh',
'test' => 1
)
);
/* options for our call */
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
/* create a context */
$context = stream_context_create($opts);
/* post data to url and retrieve result */
$result = file_get_contents('https://secure.dot.tk/api/freedomain', false, $context);
/* print result */
print $result;
?>