URL Shortener using Auto-Increment field.
Good Night,
This is a new version of URL-Shortener that don't create random IDs to websites, it uses the auto-increment field and replace it to other base.
Good Night,
This is a new version of URL-Shortener that don't create random IDs to websites, it uses the auto-increment field and replace it to other base.
Hello
I decided to implement a Chart vision of the access to a address of the last 30 days. THe system that I choosed is Open Flash Chart.
The new methods:
getAccess($id) - Return an Associative Array with the access by date and the total
formatData($data) - Receive the access of getAccess and transform it in a Numeric Array.
criarLabels() - Create the labels to the bottom part of the chart.
If you want to access it, you have to manually get the ID and use http://www.example.com/diretorio/chart.php?id=ID where ID is UID from the MySQL table.
Example:
URL Shortener with Statistics and Chart.
Creating your own Url shortener
Statistics on your URL Shortener
Best Regards,
Matheus
PS: Don't forget the Rewrite Rules.
Hello,
I will just show how to quickly install Apache 2, PHP5, MYSQL and PHPmyAdmin in Ubuntu.
Install apache2 with:
$ sudo apt-get install apache2
Install PHP5:
$ sudo apt-get install php5 php5-common php5-cli
Install MYSQL:
$ sudo apt-get install mysql-client mysql-server
(During the installation it will ask you password for root user of MySQL)
Install PHPMyAdmin:
$ sudo apt-get install phpmyadmin
(It will ask the MySQL password and of the PHPMyAdmin user)
Best Regards,
Matheus
Hello
A few weeks ago I showed you how to create your own URL-Shortener. I decide to improve it, creating a simple system to control the number of access
First of all you need to add some tables to your data base:
CREATE TABLE information (
iid INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
ip VARCHAR(255) NULL,
PRIMARY KEY(iid)
);
After this you should do a modification in your function-little-url.php in the function take_url($url):
In this System there is a table with IPs that already accessed some URL, when a URL is accessed it verify the IP, if it is on the table just create an access to this IP in the new address. Otherwise, add the IP and create the access to the address.
How to create a URL-Shortener with Statistics
Matheus
Good Night,
Here I will show you how to create your own url shortener.
First of all you need to create a table like this:
CREATE TABLE IF NOT EXISTS `urls` (
`uid` int(11) NOT NULL auto_increment,
`url` text default NULL,
`unique_chars` varchar(25) BINARY NOT NULL,
PRIMARY KEY (`uid`),
UNIQUE KEY `unique_chars` (`unique_chars`)
);
This code was taken from Abhise in this post "Create your own tinyurl with php and mySQL" that was my bigest reference, from it I took some functions and update other ones to be more efficient. For an example I changed the field to BINARY so it be CASE SENSITIVE (aaaa different from AAAA)
The Abhise says to create many files, I particularly, created one file with all functions where I add all the functions and just called the functions in the files.