3 require_once( dirname(__FILE__).'/includes/config.php' );
\r
4 if (defined('YOURLS_PRIVATE') && YOURLS_PRIVATE == true)
\r
5 require_once 'includes/auth.php';
\r
7 $db = yourls_db_connect();
\r
8 $return = yourls_add_new_link( $_REQUEST['url'], $_REQUEST['keyword'], $db );
\r
10 switch ( $_REQUEST['format'] ) {
\r
12 header('Content-type: application/json');
\r
13 echo yourls_json_encode($return);
\r
17 header('Content-type: application/xml');
\r
18 echo yourls_xml_encode($return);
\r
23 echo $return['shorturl'];
\r