Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (25 sloc) 1.32 KB
Thank you for trying the PHP SQLite Link Redirection script.
You can have a Microsoft looking link redirection service with counter.
Now you can post links in different places and if the target link changes you dont have to go back to edit the whole link, just go to linkmanagement folder and edit the link there.
To use upload the directory structure to your server.
Change the variables in in linkmanagement folder.
Change the username "admin" and password "adminpassword" in index.php file located here if($username == "admin" && $password == "adminpassword") to whatever you want.
Change the name of database in $dbname = "LinksRedirect.db"; to some random name to keep it secret.
chmod /db folder 777
chmod /db/LinksRedirect.db or whatever name you choose.
Run setup.php and then delete the file setup.php
To display the count use this code.
// Example to show counter from link ID 73, change it to whatever ID counter you want to show.
$link = "73";
// Change the below path accordingly.
include "linkmanagement/";
$db = new PDO("sqlite:linkmanagement/db/$dbname");
$result = $db->prepare("SELECT Counter FROM Links WHERE rowid = '$link' LIMIT 1");
$row = $result->fetch();
echo $row['Counter'];