Exemple #1
0
<?php

include_once 'header.inc.php';
require_once 'class/tcn.class.php';
$url = $_GET['url'];
$tcn = new tcn();
$long_url = $tcn->expand($url);
?>




    <div class="jumbotron">
        <h1>网址缩短</h1>

        <?php 
if ($long_url != "0") {
    ?>
            <p class="lead ">
                <input name="url" class="form-control" value="<?php 
    echo $long_url;
    ?>
" >
            </p>
            <p>   <a class="btn  btn-info" href="<?php 
    echo $srt_url;
    ?>
">访问</a> <a class="btn btn-success" href="expand.php">返回</a></p>

        <?php 
}
Exemple #2
0
<?php

include_once 'header.inc.php';
require_once 'class/tcn.class.php';
$url = $_GET['url'];
$tcn = new tcn();
$srt_url = $tcn->srt($url);
?>




        <div class="jumbotron">
            <h1>网址缩短</h1>

                <?php 
if ($srt_url != "0") {
    ?>
                <p class="lead ">
                    <input name="url" class="form-control" value="<?php 
    echo $srt_url;
    ?>
" >
                </p>
                <p> <a class="btn  btn-info" href="<?php 
    echo $srt_url;
    ?>
">访问</a>  <a class="btn btn-success" href="index.php">返回</a></p>

                <?php 
}
Exemple #3
0
<?php

/**
 *  the demo of t.cn
 */
include_once '../class/tcn.class.php';
$demo = new tcn();
$url = "http://url.com";
$bk = $demo->srt($url);
$long = $demo->expand($bk);
?>

<p>Long Url: <?php 
echo $url;
?>
</p>
<p>Short Url: <?php 
echo $bk;
?>
</p>
<p>Expand Short Url: <?php 
echo $long;
?>
</p>