Location: PHPKode > scripts > InstaCounter > Christophe/Scripts/InstaCounter/release candidate/install.php
<?php  // install.php       -> Installation script.

$noglobal="1";
require("config.php");

// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// @@																			 @@
// @@		++++++++++++++++++		 											 @@
// @@		++ InstaCounter ++			Version:	 1.0						 @@
// @@		++++++++++++++++++													 @@
// @@																			 @@
// @@		InstaCounter was developed by Christophe Johanns. Therefore			 @@
// @@		he owns the copyright to all files of this script. Feel free		 @@
// @@		to modify the code for PERSONAL use.								 @@
// @@																			 @@
// @@	    Copyright © 2001 Christophe Johanns. All rights reserved.			 @@
// @@																			 @@
// @@		Support: http://www.freesources.net/instacounter.php				 @@
// @@		Comments: hide@address.com										 @@
// @@																			 @@
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// @@	SHOW LEFT MENU															 @@
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

if(!isset($step)){ $step="1"; }

if($step=="1") { $steps="<FONT size=\"2\" face=\"Verdana\">» <B>Mod. config.php</B><BR> » Create database<BR> » Make account<BR> » Admin Panel</FONT>"; } if($step=="2") { $steps="<FONT size=\"2\" face=\"Verdana\">» Mod. config.php<BR> » <B>Create database</B><BR> » Make account<BR> » Admin Panel</FONT>"; } if($step=="3") { $steps="<FONT size=\"2\" face=\"Verdana\">» Mod. config.php<BR> » Create database<BR> » <B>Make account</B><BR> » Admin Panel</FONT>"; } if($step=="4") { $steps="<FONT size=\"2\" face=\"Verdana\">» Mod. config.php<BR> » Create database<BR> » Make account<BR> » <B>Admin Panel</B></FONT>"; }

echo "<HTML><HEAD> <TITLE>Install Procedure °° InstaCount</TITLE> </HEAD><BODY bgcolor=\"#CCCCCC\" topmargin=\"0\" leftmargin=\"0\" link=\"#000000\" vlink=\"#000000\" alink=\"#006D8A\"><DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\"> <TR> <TD width=\"20%\" bgcolor=\"#EAEAEA\" valign=\"top\">&nbsp; <DIV align=\"center\"> <TABLE border=\"0\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\"> <TR> <TD width=\"100%\" height=\"110\"><SPAN style=\"position: absolute; left: 53; top: 11\"><IMG border=\"0\" src=\"logo.gif\" width=\"181\" height=\"105\"></SPAN><FONT size=\"2\" face=\"Verdana\"></FONT></TD> </TR> <TR> <TD width=\"100%\"> <P style=\"margin-left: 10; margin-right: 10\"><FONT size=\"2\" face=\"Verdana\">&nbsp;</FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#006D8A\"><FONT face=\"Verdana\" size=\"1\">&nbsp;<FONT color=\"#EAEAEA\" size=\"1\"><B>4 easy steps</B></FONT></FONT></TD> </TR> <TR> <TD width=\"100%\"> <P style=\"margin-left: 5; margin-right: 5\">$steps</TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#006D8A\"><B><FONT face=\"Verdana\" size=\"1\">&nbsp;<FONT color=\"#EAEAEA\">Troubleshooting</FONT></FONT></B></TD> </TR> <TR> <TD width=\"100%\"> <P style=\"margin-left: 5; margin-right: 5\"><FONT size=\"2\" face=\"Verdana\">» <A href=\"manual.php\">Manual</A><BR> » <A href=\"http://www.freesources.net/instacounter.php\">Online Help</A></FONT></TD> </TR> </TABLE> </DIV> </TD> <TD width=\"1\" bgcolor=\"#006D8A\" valign=\"top\"><IMG border=\"0\" src=\"pixel.gif\" width=\"1\" height=\"1\"></TD> <TD width=\"80%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"100%\" height=\"100\"> <P align=\"center\"><FONT size=\"1\" color=\"#EAEAEA\" face=\"Verdana\"><B>AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD</B></FONT><BR> <A href=\"http://freesources.net/scripts/bannerclick.php\"><IMG src=\"http://freesources.net/scripts/banner.php\" border=\"0\" width=\"351\" height=\"45\"></A><BR> <FONT size=\"1\" color=\"#EAEAEA\" face=\"Verdana\"><B>AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD&nbsp; AD</B></FONT></TD> </TR> <TR> <TD width=\"100%\"><BR><BR>";


// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// @@	STEP 1																	 @@
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

if($step=="1") {

	echo"<FORM action=\"install.php\" method=\"post\"><INPUT type=hidden name=step value=2><DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\"> <TR> <TD width=\"100%\" bgcolor=\"#FFFFFF\"> <DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellspacing=\"1\" width=\"100%\" cellpadding=\"0\"> <TR> <TD width=\"100%\" bgcolor=\"#006D8A\"><B><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">&nbsp;Step 1: Modify config.php.</FONT></B></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"></CENTER> <P style=\"margin-left: 10; margin-right: 10\"><FONT size=\"1\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT face=\"Verdana\">Open config.php in your favourite text-based editor. If you're not sure what kindof program this is, use Notepad, delivered standard with every copy of Windows. Do not use programs like Word, Dreamweaver,... .<BR> <BR> Scroll down to the 'DATABASE VARIABLES' part. There follow the instructions. If you are not sure what you have to fill in contact your hosting company.<BR> &nbsp;<BR> Save the config.php file and upload it to the directory where you have all the other InstaCounter files.<BR> &nbsp;<BR> <B>Important:</B> Only proceed if you have filled in the variables and uploaded it to your server!</FONT><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> </TR> </CENTER> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\">&nbsp;</TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#FFFFFF\"> <DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\"> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <P align=\"center\"><FONT size=\"1\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT><BR> <INPUT type=\"submit\" value=\"Proceed to step 2: Adding the database\" name=\"submit\" style=\"font-family: Verdana; font-size: 10pt; font-weight: bold\"><BR> <FONT size=\"1\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> </TR> </TABLE> </CENTER> </DIV> </TD> </TR> </TABLE> </DIV></FORM>";

}

// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// @@	STEP 2																	 @@
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

if($step=="2") {

	$db = @mysql_connect("localhost","$user","$pw"); mysql_select_db("$database"); if (!$db) { print "There was an error connecting to the database."; } else {

	mysql_query("CREATE TABLE InstaCounter_Config (cid tinyint(2) NOT NULL auto_increment,UserName varchar(10) NOT NULL,Password varchar(10) NOT NULL,CheckMethod tinyint(1) NOT NULL,eMail varchar(80) NOT NULL,ignoreIP varchar(200) NOT NULL,InstallDir varchar(100) NOT NULL,public_stats tinyint(1) NOT NULL,public_info tinyint(1) NOT NULL,public_styles tinyint(1) NOT NULL,PRIMARY KEY (cid))");

	mysql_query("CREATE TABLE InstaCounter_Counter (Hits bigint(30) NOT NULL,DateCreate date DEFAULT '0000-00-00' NOT NULL,Style smallint(2) NOT NULL,Name text NOT NULL,cid tinyint(7) NOT NULL auto_increment,PRIMARY KEY (cid))");

	mysql_query("CREATE TABLE InstaCounter_IPtracking (cid bigint(20) NOT NULL auto_increment,counterid tinyint(7) NOT NULL,IP varchar(100) NOT NULL,time varchar(100) NOT NULL,PRIMARY KEY (cid))");

	mysql_query("CREATE TABLE InstaCounter_Styles (cid tinyint(4) NOT NULL auto_increment,name varchar(50) NOT NULL,n1 varchar(200) NOT NULL,n2 varchar(200) NOT NULL,n3 varchar(200) NOT NULL,n4 varchar(200) NOT NULL,n5 varchar(200) NOT NULL,n6 varchar(200) NOT NULL,n7 varchar(200) NOT NULL,n8 varchar(200) NOT NULL,n9 varchar(200) NOT NULL,n0 varchar(200) NOT NULL,nleft varchar(200) NOT NULL,nright varchar(200) NOT NULL,PRIMARY KEY (cid))");

	echo"<FORM action=\"install.php\" method=\"post\"><INPUT type=hidden name=step value=3><DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\"> <TR> <TD width=\"100%\" bgcolor=\"#FFFFFF\"> <DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellspacing=\"1\" width=\"100%\" cellpadding=\"0\"> <TR> <TD width=\"100%\" bgcolor=\"#006D8A\"><B><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">&nbsp;Step 2: Add database.</FONT></B></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"></CENTER> <P style=\"margin-left: 10; margin-right: 10\"><FONT size=\"1\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT face=\"Verdana\">If you see no error messages above this table, all records have been added succesfully! You can proceed to step 3.<BR><BR>If there are error messages displayed please check if variables in config.php are correct or contact the server administrator.</FONT><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> </TR> </CENTER> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\">&nbsp;</TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#FFFFFF\"> <DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\"> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <P align=\"center\"><FONT size=\"1\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT><BR> <INPUT type=\"submit\" value=\"Proceed to step 3: Creating a user account\" name=\"submit\" style=\"font-family: Verdana; font-size: 10pt; font-weight: bold\"><BR> <FONT size=\"1\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> </TR> </TABLE> </CENTER> </DIV> </TD> </TR> </TABLE> </DIV></FORM>";

	}

}


// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// @@	STEP 3																	 @@
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

if($step=="3") {

	echo "<FORM method=\"post\" action=\"install.php\"><INPUT type=hidden name=step value=4><DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\"> <TR> <TD width=\"100%\" bgcolor=\"#FFFFFF\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\"> <TR> <TD width=\"100%\" bgcolor=\"#006D8A\"><B><FONT face=\"Verdana\" size=\"2\" color=\"#FFFFFF\">&nbsp;Create user account (all this info can be adjusted later on)</FONT></B></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#000000\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"1\"><B>&nbsp;Username</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Your username: (max. 10 char.)<BR> </FONT><INPUT type=\"text\" name=\"usern\" size=\"25\" style=\"font-family: Verdana; font-size: 10pt\" maxLength=\"10\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Your username is used to log in the Admin Panel.</FONT><FONT size=\"1\" face=\"Verdana\"><BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#000000\" valign=\"top\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"1\"><B>&nbsp;Password</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Your password: (max. 10 char.)<BR> </FONT><INPUT type=\"password\" name=\"pw1\" size=\"25\" style=\"font-family: Verdana; font-size: 10pt\" maxLength=\"10\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Your password is used to log in the Admin Panel.<BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Retype your password: (max. 10 char.)<BR> </FONT><INPUT type=\"password\" name=\"pw2\" size=\"25\" style=\"font-family: Verdana; font-size: 10pt\" maxLength=\"10\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Retype your password for verification.<BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#000000\" valign=\"top\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"1\"><B>&nbsp;Email address</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Your email address:<BR> </FONT><INPUT type=\"text\" name=\"email\" size=\"25\" style=\"font-family: Verdana; font-size: 10pt\"  maxLength=\"80\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Email address is used for username and password retrieval. It is essential that you fill in a valid email address.<BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#006D8A\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"2\"><B>&nbsp;Modify system settings</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#000000\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"1\"><B>&nbsp;Install directory</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Path to InstaScript directory:<BR> </FONT><INPUT type=\"text\" name=\"installdir\" size=\"25\" style=\"font-family: Verdana; font-size: 10pt\" maxLength=\"100\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">You need to enter the path to the install directory of this script.<BR> <BR> <FONT color=\"#006D8A\">Use the same address you would type in your webbrowser. (http://mysite.com/dir/dir/)</FONT><BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#000000\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"1\"><B>&nbsp;Repetitive count verification</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Choose a method: <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"14%\" valign=\"top\"><FONT size=\"1\" face=\"Verdana\"><INPUT type=\"radio\" value=\"0\" name=\"checkmethod\"></FONT></TD> <TD width=\"86%\"><FONT size=\"1\" face=\"Verdana\">Do <B>not</B> check for repetitive visits within 5 minutes.<BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"14%\" valign=\"top\"><FONT size=\"1\" face=\"Verdana\"><INPUT type=\"radio\" value=\"1\" name=\"checkmethod\"></FONT></TD> <TD width=\"86%\"><FONT size=\"1\" face=\"Verdana\">Use <B>cookies</B> to check for repetitive visits within 5 minutes. <FONT color=\"#006D8A\">(recommended)<BR> </FONT></FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"14%\" valign=\"top\"><FONT size=\"1\" face=\"Verdana\"><INPUT type=\"radio\" value=\"2\" name=\"checkmethod\"></FONT></TD> <TD width=\"86%\"><FONT size=\"1\" face=\"Verdana\">Use <B>IP tracking</B> to check for repetitive visits within 5 minutes.</FONT></TD> </TR> </TABLE> </DIV> <P style=\"margin-left: 10; margin-right: 10\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">InstaCounter can check whether or not a certain visitor has already visited the page within 5 minutes. This protects against constantly reloading the counter, making it reflect a wrong number of the amount of visitors the page has got.<BR> <BR> Use of cookies is recommended, because IP tracking will disable correct counting with users in a public area, where more than one user uses the same IP.<BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#000000\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"1\"><B>&nbsp;Ignore IP addresses</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT face=\"Verdana\" size=\"1\">IP addresses to ignore: (max. 200 char.)<BR> </FONT><TEXTAREA rows=\"5\" name=\"ignoreip\" cols=\"25\" style=\"font-family: Verdana; font-size: 10pt\"></TEXTAREA><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">You can enter some IP addresses, which InstaCounter will ignore. This was added to protect the counter from counting the visits of the webmaster of the page. It is not required though.<BR> <BR> <FONT color=\"#006D8A\">Put the IP addresses under eachother.</FONT><BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#006D8A\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"2\"><B>&nbsp;Modify public settings</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#000000\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"1\"><B>&nbsp;Individual counter information</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Choose an option: <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"14%\" valign=\"top\"><FONT size=\"1\" face=\"Verdana\"><INPUT type=\"radio\" value=\"1\" name=\"public_info\"></FONT></TD> </FONT> <TD width=\"86%\"><FONT face=\"Verdana\" size=\"1\"><B>Yes</B>, enable everyone to see information of individual counters.</FONT><FONT size=\"1\" face=\"Verdana\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> </TR> <TR> <TD width=\"14%\" valign=\"top\"><FONT size=\"1\" face=\"Verdana\"><INPUT type=\"radio\" value=\"0\" name=\"public_info\"></FONT></TD> <TD width=\"86%\"><FONT face=\"Verdana\" size=\"1\"><B>No</B>, keep the individual counter information private.</FONT><FONT color=\"#006D8A\" face=\"Verdana\" size=\"1\"><BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">You can choose to make the individual counter information page available to other people, without giving them access to the Admin Panel. You will need to provide the url with the id of their counter. You can find the url format <A href=\"admin.php?action=publicurl\" target=\"_blank\">here</A>.<BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#000000\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"1\"><B>&nbsp;Individual counter statistics</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Choose an option: <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"14%\" valign=\"top\"><FONT size=\"1\" face=\"Verdana\"><INPUT type=\"radio\" value=\"1\" name=\"public_stats\"></FONT></TD> </FONT> <TD width=\"86%\"><FONT face=\"Verdana\" size=\"1\"><B>Yes</B>, enable everyone to see statistics of individual counters.</FONT><FONT size=\"1\" face=\"Verdana\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> </TR> <TR> <TD width=\"14%\" valign=\"top\"><FONT size=\"1\" face=\"Verdana\"><INPUT type=\"radio\" value=\"0\" name=\"public_stats\"></FONT></TD> <TD width=\"86%\"><FONT face=\"Verdana\" size=\"1\"><B>No</B>, keep the individual counter statistics private.</FONT><FONT color=\"#006D8A\" face=\"Verdana\" size=\"1\"><BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">You can choose to make the individual counter statistics page available to other people, without giving them access to the Admin Panel. You will need to provide the url with the id of their counter. You can find the url format <A href=\"admin.php?action=publicurl\" target=\"_blank\">here</A>.<BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#000000\"><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"1\"><B>&nbsp;List of styles</B></FONT></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <TR> <TD width=\"50%\" valign=\"top\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">Choose an option: <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"14%\" valign=\"top\"><FONT size=\"1\" face=\"Verdana\"><INPUT type=\"radio\" value=\"1\" name=\"public_styles\"></FONT></TD> </FONT> <TD width=\"86%\"><FONT face=\"Verdana\" size=\"1\"><B>Yes</B>, enable everyone to see the list of styles.</FONT><FONT size=\"1\" face=\"Verdana\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> </TR> <TR> <TD width=\"14%\" valign=\"top\"><FONT size=\"1\" face=\"Verdana\"><INPUT type=\"radio\" value=\"0\" name=\"public_styles\"></FONT></TD> <TD width=\"86%\"><FONT face=\"Verdana\" size=\"1\"><B>No</B>, keep the styles list private.</FONT><FONT color=\"#006D8A\" face=\"Verdana\" size=\"1\"><BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> <TD width=\"50%\" valign=\"top\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#EAEAEA\"> <P style=\"margin-left: 10; margin-right: 10\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT size=\"1\" face=\"Verdana\">You can choose to make the list of styles available to other people, without giving them access to the Admin Panel. You can find the url <A href=\"admin.php?action=publicurl\" target=\"_blank\">here</A>.<BR> </FONT><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> <TR> <TD width=\"100%\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\">&nbsp;</TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#FFFFFF\"> <DIV align=\"center\"> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\"> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <P align=\"center\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <INPUT type=\"submit\" value=\"Make account and proceed to step 4: Admin panel\" name=\"submit\" style=\"font-family: Verdana; font-size: 10pt; font-weight: bold\"><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></P> </TD> </TR> </TABLE> </DIV> </TD> </TR> </TABLE> </CENTER> </DIV></FORM>";

}


// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// @@	STEP 4																	 @@
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

if($step=="4") {

	if($usern=="") {  $error=$error . "<br>You did not fill in a valid User name.";  }
	if($pw1=="") {  $error=$error . "<br>You did not fill in a valid Password.";  }
	if($pw1<>$pw2) {  $error=$error . "<br>Passwords did not match.";  }
	if($email=="") {  $error=$error . "<br>You did not fill in a valid email address.";  }
	if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$",$email)) {  $error=$error . "<br>You did not fill in a valid email address.";  }
	if($installdir=="") {  $error=$error . "<br>You did not fill in a valid install directory.";  }

	if(!isset($error)) {

		$db = @mysql_connect("localhost","$user","$pw"); mysql_select_db("$database"); if (!$db) { print "There was an error connecting to the database."; } else { 

		$query = mysql_query("SELECT * FROM InstaCounter_Config WHERE cid='1'"); $handle = mysql_fetch_array($query);	

		if(isset($handle[UserName])) { echo "You do not have permission to run this script!!"; } else {

			mysql_query("INSERT INTO InstaCounter_Config (cid, UserName, Password, CheckMethod, eMail, ignoreIP, InstallDir, public_stats, public_info, public_styles) VALUES ('', '$usern', '$pw1', '$checkmethod', '$email', '$ignoreip', '$installdir', '$public_stats', '$public_info', '$public_styles')");

		}

		}

	}

	else {

		echo "<FONT face=Verdana size=3><B>Error:</B><BR><FONT size=2>$error</FONT></FONT>";
		exit;

	}

	echo"<FORM action=\"admin.php\" method=\"post\"><DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\"> <TR> <TD width=\"100%\" bgcolor=\"#FFFFFF\"> <DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellspacing=\"1\" width=\"100%\" cellpadding=\"0\"> <TR> <TD width=\"100%\" bgcolor=\"#006D8A\"><B><FONT face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">&nbsp;Step 1: Modify config.php.</FONT></B></TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"></CENTER> <P style=\"margin-left: 10; margin-right: 10\"><FONT size=\"1\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"><BR> <FONT face=\"Verdana\">The user account was created succesfully! Now <A href=\"admin.php\">click here</A> to go to tha Admin panel.<BR><BR>Thank you for choosing for InstaCounter. If you have any comments please mail to <A href=\"mailto:hide@address.com\">hide@address.com</A>.<BR><BR>Please delete the the install.php file from your server, for security reasons.</FONT><BR> <IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> </TR> </CENTER> </TABLE> </DIV> </TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\">&nbsp;</TD> </TR> <TR> <TD width=\"100%\" bgcolor=\"#FFFFFF\"> <DIV align=\"center\"> <CENTER> <TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\"> <TR> <TD width=\"100%\" bgcolor=\"#CCCCCC\"> <P align=\"center\"><FONT size=\"1\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT><BR> <INPUT type=\"submit\" value=\"Go to Admin panel\" name=\"submit\" style=\"font-family: Verdana; font-size: 10pt; font-weight: bold\"><BR> <FONT size=\"1\"><IMG border=\"0\" src=\"pixel.gif\" width=\"5\" height=\"5\"></FONT></TD> </TR> </TABLE> </CENTER> </DIV> </TD> </TR> </TABLE> </DIV></FORM>";

}


// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// @@	END HTML																 @@
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

echo "</TD></TR></TABLE></DIV></TD></TR></TABLE></CENTER></DIV></BODY></HTML>";

?>
Return current item: InstaCounter