1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Url shortener integration

Discussion in 'PHP' started by RoundShots, Sep 27, 2015.

  1. #1
    Hello,
    One of my website was using url shortener "taken.to", but since yesterday night, it seems that site is down, so of course it generates php errors on my pages.

    basically, my php code looks like this :
    function insert_get_short_url($a)
    {
        global $conn, $config;
        $SPID = intval($a['PID']);
        $sshort = stripslashes($a['short']);
        $SSEO = stripslashes($a['SEO']);
        $shortdamn_url = $config['baseurl']."/".$SSEO;
        if($SPID > 0)
        {
            if($sshort == "")
            {
                $takenurl =  file_get_contents("http://www.taken.to/shortdamn.php?url=".$shortdamn_url);
                if($takenurl != "")
                {
                    $sshort = str_replace("http://www.taken.to/", "", $takenurl);
                    if($sshort != "")
                    {
                        $query = "UPDATE posts SET short='".mysql_real_escape_string($sshort)."' WHERE PID='".mysql_real_escape_string($SPID)."'";
                        $conn->execute($query);
                        $rme =     "http://www.taken.to/".$sshort;
                    }
                }           
            }
            else
            {
                $rme =     $sshort;
            }
        }
        return $rme;
    }
    PHP:
    I wonder if there is another url shortener that would have the same url base ?

    or how can i replace it with another good url shortener service that wouldnt crash.

    I was thinking to create a subdomain and install its own url shorten script, but i'm not sure.
     
    RoundShots, Sep 27, 2015 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    What legitimate reason for using an url shortener on a web page could there possibly be?
     
    PoPSiCLe, Sep 27, 2015 IP
  3. RoundShots

    RoundShots Active Member

    Messages:
    231
    Likes Received:
    16
    Best Answers:
    1
    Trophy Points:
    80
    #3
    i asked myself the same, i only noticed this url shortener now, because after all these years , i got php errors, just yesterday.
     
    RoundShots, Sep 27, 2015 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    I don't see the point - only place I know of where an url-shortener really comes in handy is places where you can't actually write the link content yourself (very few places), or on Twitter.
     
    PoPSiCLe, Sep 27, 2015 IP
  5. HowDoYou

    HowDoYou Well-Known Member

    Messages:
    443
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    130
    #5
    HowDoYou, Sep 28, 2015 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #6
    If all you have stored is their shortcut, you may very well be up **** creek once that shortener goes AWOL. Unless you also stored the actual URL locally, you're pretty well shtupped.
     
    deathshadow, Oct 3, 2015 IP