Jump to content



Recommended Posts


I need help with modifing this script:

    $smarty = new Smarty;
    $smarty->template_dir = "$dir_ws/tiny_templates";
    $smarty->compile_dir = "$dir_ws/tiny_templates_c";

    $HTTP_SESSION_VARS['searchurl'] = '';
    $randlink = '';

    if($_SERVER['QUERY_STRING'] && !$fullurl && !preg_match('/[\W]/',$_SERVER['QUERY_STRING'])){
      //loading index.php with query
      if($res = checkQueryString($_SERVER['QUERY_STRING'])){
        //query found
        if($res['showsplash'] && $config['refreshrate']){
          $smarty->assign("fullurl_substr", (strlen($res['fullurl'])>75?substr($res['fullurl'],0,75).'...':$res['fullurl']));
        else js_redirect($res['fullurl']);
        //query did not find

        preg_match("/^((http:\/\/)*)(.*)/i", $fullurl, $matches1);
        preg_match("/^(http:\/\/)*/i", $fullurl, $matches2);

        if($matches1[1]==$matches2[1] and $matches1[3]) $u = parse_url($fullurl);
        else $u['host'] = $fullurl;

        $ip = gethostbyname($u['host']);

        //if($ip == $u['host']){
        //  js_alert ('No such host!');
        $randlink = addLink($fullurl,$ip);

      //loading index.php



Sorry because of big script. This is for making short links, like mypage.com/?532sa. No I would like to change it so that when I type mypage.com/http://www.yoursite.com opens redirecting
to new site and then it redirect to new site. Currently nothing happends when I do that so probably changes need to be under else. The option for short link must stay...

Thank you in advance
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.