how to install phurl

krdando

New Member
Messages
3
Reaction score
0
Points
0
how would i go about install shorturl service to my site?

http://code.google.com/p/phurl/

all i get is this after i install it..

vk5899acwsam92.png


any help?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Where is config.php? It should have come with phurl. You should place it in the /shorty/ directory.
 

krdando

New Member
Messages
3
Reaction score
0
Points
0
I had to create the Config file..then i uploaded it then worked fine.. but then i go to create a short url and get this..

x82w31hnwe49j6.png



this is what global php looks like.

PHP:
<?php
function db_connect() {
    global $config;

    mysql_connect($config['db_hostname'].":".$config['db_port'], $config['db_username'], $config['db_password']) or die(mysql_error());
    mysql_select_db($config['db_name']) or die(mysql_error());
}

function generate_url() {
    $keys = "23456789abcdefghkmnpqrstvwxyz";
    $i    = 0;
    $url  = "";

    while ($i < 6) {
      $random = mt_rand(0, strlen($keys) - 1);
      $url   .= $keys{$random};
      $i++;
    }

    return $url;
}
?>

do i have to point to a database? if so how do i create and have the url service point to it?
 
Last edited:
Top