|
|
|
<?
//////////////////////////////////////////////////
// MyRedirector Version 1.0
// Redirector
// redirect.php3
// Written by Mark Kronsbein
// License: GPL
// I only ask that you to NOT delete the credit!
// Please mail me at mk@html-design.com
// if you use this Script! Thanx!
// See it in Action at http://www.gabber.de
//
// Installation:
// Insert your Values for $hostname, $username,
// $password, $userstable and $dbName and $host.
// Call it like
// redirect.php3?url=http://www.hostname.de
//////////////////////////////////////////////////
$host = "http://www.hostname.de/";
$hostname = "localhost";
$username = "your-username";
$password = "your-password";
$userstable = "redirect";
$dbName = "your-db-name";
if ($url != $host){
MYSQL_CONNECT($hostname, $username, $password) OR DIE(mysqlerror());
@mysql_select_db( "$dbName") or die(mysqlerror());
$query = mysql_fetch_row(mysql_query( "select * from $userstable where(url = '$url')"));
if ($query == false){
$hits = "1";
$query2 = "INSERT INTO $userstable (url,hits) VALUES('$url','$hits')";
}
else {
$hitquery = "select hits from $userstable where url = '$url'";
$result = mysql_query($hitquery);
$hits = mysql_result($result, 0, "hits");
$query2 = "update $userstable set hits = hits+1 where url = '$url'";
}
MYSQL_QUERY($query2);
}
if(!$url) {
$url = "$host";
}
else {
Header( "Location: $url");
}
?>
<?
//////////////////////////////////////////////////
// MyRedirector Version 1.0
// Stats-Viewer
// viewstats.php3
// Written by Mark Kronsbein
// License: GPL
// I only ask that you to NOT delete the credit!
// Please mail me at mk@html-design.com
// if you use this Script! Thanx!
// See it in Action at http://www.gabber.de
//
// Installation:
// Insert your Values for $hostname, $username,
// $password, $userstable and $dbName.
//////////////////////////////////////////////////
$hostname = "localhost";
$username = "your-username";
$password = "your-password";
$userstable = "redirect";
$dbName = "your-db-name";
$color10 = "#FFFF00"; /* Color for Hits between 1 and 9 */
$color20 = "#FF0000"; /* Color for Hits between 10 and 19 */
$color50 = "#008000"; /* Color for Hits between 20 and 49 */
$color1k = "#0000FF"; /* Color for Hits between 50 and 99 */
$color2k = "#0000A0"; /* Color for Hits between 100 and 199 */
$color5k = "#000040"; /* Color for Hits over 200*/
MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database");
@mysql_select_db( "$dbName") or die( "Unable to select database");
$query = "select * from $userstable order by hits desc";
$result = MYSQL_QUERY($query);
$number = MYSQL_NUMROWS($result) or die (mysql_error());
$i = 0;
IF ($number == 0) {
PRINT "<CENTER><P><b>No Links tracked yet!</b></CENTER>";
}
ELSEIF ($number >= 1) {
WHILE ($i < $number){
$hits = mysql_result($result,$i,hits);
$url = mysql_result($result,$i,url);
if ($hits < 10){
$color = "$color10";
}
elseif (($hits >= 10 ) AND ($hits < 20)){
$color = "$color20";
}
elseif (($hits >= 20 ) AND ($hits < 50)){
$color = "$color50";
}
elseif (($hits >= 50 ) AND ($hits < 100)){
$color = "$color1k";
}
elseif (($hits >= 100 ) AND ($hits < 200)){
$color = "$color2k";
}
elseif ($hits >= 200){
$color = "$color5k";
}
PRINT "<div align=\"left\">";
print "<table COLS=3 border=\"0\" width=\"100%\"><tr><td ALIGN=LEFT with=\"400\"><b><a
href=\"$url\">$url</a></b></td>";
print "<td ALIGN=right WIDTH=\"60\"><b>$hits</b></td>";
print "<td align=left WIDTH=\"$hits\" BGCOLOR=\"$color\"> </td></tr>";
$i++;
PRINT "</table>\n";
}
}
?>
#
# MyRedirect.sql
#
CREATE TABLE redirect (
url varchar(100) NOT NULL,
hits int(10) DEFAULT '0' NOT NULL,
PRIMARY KEY (url)
);
|
|
| phpHoo2 (Xhoo using php3/MySQL) is a Yahoo-like link directory. Much like the Open Directory Project (dmoz.org). Categories : PHP, Complete Programs, Directories, MySQL, URLs | | | bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager Categories : MySQL, PHP, MySQL, Complete Programs, Databases | | | Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | phpAds, a complete banner and ad management system with detailled tracking and stats. Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases | | | Point and Click Interface ala MS Access for creating SQL statements. Categories : MySQL, Complete Programs, General SQL, PHP, Databases | | | phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install. Categories : PHP, Complete Programs, HTML and PHP, MySQL | | | Tropicalm Genetree Family (MySQL based family tree) Categories : PHP, Interfaces, Databases, MySQL, Complete Programs | | | Web Self Service Resource Scheduler Using php3 and MySQL Categories : PHP, Complete Programs, MySQL | | | Shopping Basket On-Line Ordering System. Categories : Complete Programs, MySQL, PHP, Ecommerce, Databases | | | Example voting script. Lets people enter suggestions and vote for existing ones. Categories : MySQL, PHP, Cookies, Complete Programs, Databases | | | Free For All Links Page using PHP3 and Mysql Categories : PHP, MySQL, Complete Programs | | | fforum fumanchi forum MySQL treestructure Categories : Complete Programs, PHP, MySQL | | | Simple pipe delimited file export program that downloads to a local machine Categories : PHP, Filesystem, Databases, MySQL, HTTP | | | Simple Mini Poll class library (SimPoll) Categories : PHP, PHP Classes, Databases, MySQL, Complete Programs | | | Browse a MySQL database & draw a tree view & load final items into a template page. Categories : MySQL, Complete Programs, Algorithms, PHP, Databases | |
|
|
|