Goedemorgen mensen,
Nou, alvast bedankt.
Prettig weekeinde,
Jaap.
En hier dan alvast twee bestanden :
setup.php :
-----------------------------------------------------------------
<?php
/*
# THIS FILE NEEDS NO CONFIGURATION - DO NOT ALTER ANY OF THE CODE ON THIS PAGE
#
##############################################################################
*/
error_reporting(E_ALL & ~ (E_NOTICE));
$menuvar=$HTTP_POST_VARS["menuvar"];
$admin_user_name=$HTTP_POST_VARS["admin_user_name"];
$admin_password=$HTTP_POST_VARS["admin_password"];
$owner_email=$HTTP_POST_VARS["owner_email"];
$customcount_url=$HTTP_POST_VARS["customcount_url"];
include ("functions.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CustomCount - customisable page hit counter</title>
<meta name="robots" content="noindex, nofollow">
<meta name="MSSmartTagsPreventParsing" content="true">
<meta name="rating" content="general">
<meta name="copyright" content="This page and all of its contents are the copyright of Jemweb Internet Designs">
<meta name="Author" content ="Jemweb Internet Designs">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
</script>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#003333">
<table width="758" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td bgcolor="#FFFFF8" align="center">
<table width="754" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<img src="images/banner.png" alt="CustomCount" width="754" height="70" border="0" usemap="#jemscripts"></td>
</tr>
<tr>
<td class="footNote">Version 2.1</td>
</tr>
<tr>
<td valign="middle" align="right" bgcolor="#FFFFF8" class="titleBox">CustomCount Set-up </td>
</tr>
<tr bgcolor="#E8E8EB">
<td align="center" class="backgroundPanel">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<p> </p>
<?php
$sub_title="CustomCount Set-up";
switch ($menuvar) {
case "":
?>
<form action="setup.php" method="post" style="padding:0; border:0; margin:0">
<input type="hidden" name="menuvar" value="validate_execute">
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td class="bodyTextBold"><?php echo "$sub_title"; ?><br><br>
</td>
</tr>
<tr>
<td class="bodyText">
<p>The application requires some basic information before it can be used. Please complete the required details in the boxes below.
If you are not sure what to enter, click on the "Help" link beside that particular item.</p>
<p class="bodyText">You can change any or all of these details later on if necessary.<br>
</p>
</td>
</tr>
</table>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="3">
<tr>
<td height="25" colspan="3" valign="middle"> </td>
</tr>
<tr>
<td valign="middle" bgcolor="#C8D1D8" class="pageCell">CustomCount admin user name</td>
<td align="center" valign="top" bgcolor="#C8D1D8" class="pageCell">
<input type="text" name="admin_user_name" <?php echo "value='$admin_user_name'"; ?> class="formBoxes" maxlength="8">
</td>
<td align="center" valign="middle" bgcolor="#C8D1D8" class="pageCell">
<a href="javascript:;" class="link" onFocus="if(this.blur)this.blur()" onClick="MM_openBrWindow('setup_help.php?helpVar=AdminUserName','','scrollbars=yes,resizable=yes,width=460,height=280,top=20,left=20')">help</a>
</td>
</tr>
<tr>
<td valign="middle" bgcolor="#C8D1D8" class="pageCell">CustomCount admin password</td>
<td align="center" valign="top" bgcolor="#C8D1D8" class="pageCell">
<input name="admin_password" type="text" <?php echo "value='$admin_password'"; ?> class="formBoxes" maxlength="8">
</td>
<td align="center" valign="middle" bgcolor="#C8D1D8" class="pageCell">
<a href="javascript:;" class="link" onFocus="if(this.blur)this.blur()" onClick="MM_openBrWindow('setup_help.php?helpVar=AdminPassword','','scrollbars=yes,resizable=yes,width=460,height=280,top=20,left=20')">help</a>
</td>
</tr>
<tr>
<td valign="middle" bgcolor="#C8D1D8" class="pageCell">Your e-mail address.</td>
<td align="center" valign="top" bgcolor="#C8D1D8" class="pageCell">
<input type="text" name="owner_email" <?php echo "value='$owner_email'"; ?> class="formBoxes" maxlength="255">
</td>
<td align="center" valign="middle" bgcolor="#C8D1D8" class="pageCell">
<a href="javascript:;" class="link" onFocus="if(this.blur)this.blur()" onClick="MM_openBrWindow('setup_help.php?helpVar=OwnerEmail','','scrollbars=yes,resizable=yes,width=460,height=280,top=20,left=20')">help</a>
</td>
</tr>
<tr>
<td valign="middle" bgcolor="#C8D1D8" class="pageCell">The full URL of the file "customcount.php".</td>
<td align="center" valign="top" bgcolor="#C8D1D8" class="pageCell">
<input type="text" name="customcount_url" <?php echo "value='$customcount_url'"; ?> class="formBoxes" maxlength="255">
</td>
<td align="center" valign="middle" bgcolor="#C8D1D8" class="pageCell">
<a href="javascript:;" class="link" onFocus="if(this.blur)this.blur()" onClick="MM_openBrWindow('setup_help.php?helpVar=customcount_url','','scrollbars=yes,resizable=yes,width=460,height=280,top=20,left=20')">help</a>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr align="right" valign="middle">
<td colspan="2" valign="top" bgcolor="#C8D1D8" class="pageCell">
Please ensure that you have entered all the required items above.
<input type="submit" name="submit" value="Set it up!">
</td>
<td bgcolor="#E8E8EB"> </td>
</tr>
</table>
</form>
<?php
break;
case "validate_execute":
error_reporting(0);
$write_test_file="datafiles/ud.dat";
if (!$twf=fopen($write_test_file, "w")) {
$form_action="nothing";
$message_a="CustomCount set-up encountered a problem when attempting to write to the data files.";
$message_b="You will probably need to set permissions (CHMOD) on these files and possibly also the folders in which they reside.";
$message_b.=" Please refer to the file
<a href=\"http://www.customcount.co.uk/documentation/file_permissions.html\" target=\"_blank\">File Permissions</a>
for instructions on how to proceed.";
$b_align="left";
$button_message="";
$submit="<input type=\"button\" name=\"Button\" value=\"OK\" onClick=\"javascript:self.close();\">";
include("messaging.php");
exit();
}
fclose($twf);
ValidateEmail($owner_email);
NumAlphaOnly ($admin_user_name);
if ($num_alpha_invalid=="1") $UserInvalid="1";
NumAlphaOnly ($admin_password);
if ($num_alpha_invalid=="1") $PassInvalid="1";
if ($UserInvalid=="1" or $PassInvalid=="1") {
$message_a="Please use only alphanumeric characters in your user name and/or password.";
}
elseif (trim($admin_user_name)=="") {
$message_a="You have not entered your admin user name.";
}
elseif (trim($admin_password)=="") {
$message_a="You have not entered your admin password.";
}
elseif ($EmailInvalid=="1" or !$owner_email) {
$message_a="Your e-mail address appears to be in an invalid format, or is not entered.";
}
elseif (trim($customcount_url)=="") {
$message_a="You have not entered the "customcount.php" file URL.";
}
if ($message_a) {
$owner_email=eregi_replace("[|\"'\]","", $owner_email);
$count_page_name=eregi_replace("[|\"'\]","", $count_page_name);
$customcount_url=eregi_replace("[|\"']","", $customcount_url);
if (!$message_b) $message_b="Please return to the form and check/re-enter the item.";
$form_action="setup.php";
$hidden_fields="<input type='hidden' name='menuvar' value=''>";
$hidden_fields.="<input type='hidden' name='admin_user_name' value='$admin_user_name'>";
$hidden_fields.="<input type='hidden' name='admin_password' value='$admin_password'>";
$hidden_fields.="<input type='hidden' name='owner_email' value='$owner_email'>";
$hidden_fields.="<input type='hidden' name='customcount_url' value='$customcount_url'>";
$button_message="Return to form ";
$submit="<input type='submit' name='submit' value='Go!'>";
include("messaging.php");
}
if (!$message_a) {
$owner_email=trim(eregi_replace("[|\"'\]","", $owner_email));
$count_page_name=trim(eregi_replace("[|\"'\]","", $count_page_name));
$customcount_url=trim(eregi_replace("[|\"']","", $customcount_url));
$admin_user_name=trim(base64_encode($admin_user_name));
$admin_password=trim(base64_encode($admin_password));
$ignore_hits="no";
$before_count_phrase="This site has received";
$after_count_phrase="visits to date.";
$email_frequency="25";
$counter_type="text";
$unique_visitors="no";
$image_folder_url=str_replace("customcount.php", "images/", $customcount_url);
$writefile ="datafiles/count_data.dat";
$wf=fopen($writefile, "w");
$count_data=$ignore_hits."|";
$count_data.=$email_frequency."|";
$count_data.=$unique_visitors."|";
$count_data.=$customcount_url."|";
$count_data.=$image_folder_url."|";
fwrite($wf, $count_data);
fclose($wf);
$writefile ="datafiles/ud.dat";
$wf=fopen($writefile, "w");
$user_data=$admin_user_name."|";
$user_data.=$admin_password."|";
$user_data.=$owner_email."|";
fwrite($wf, $user_data);
fclose($wf);
if ($setup_issues=="1") {
$message_a="CustomCount was unable to complete all of the set-up procedures - see the next screen for details.";
}
elseif (!$setup_issues) {
$message_a="The counter and all necessary files were created successfully.";
}
$message_b="Click the "Go!" button to continue the set-up process.";
$form_action="menu.php";
$hidden_fields="<input type=\"hidden\" name=\"pass\" value=\"1\">";
$hidden_fields.="<input type=\"hidden\" name=\"menuvar\" value=\"setup\">";
$hidden_fields.="<input type=\"hidden\" name=\"js_no_copy\" value='$js_no_copy'>";
$hidden_fields.="<input type=\"hidden\" name=\"setup_issues\" value='$setup_issues'>";
$hidden_fields.="<input type=\"hidden\" name=\"ccid\" value='$ccid'>";
$button_message="";
$submit="<input type=\"submit\" name=\"submit\" value=\"Go!\">";
include("messaging.php");
}
break;
}
?>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#FFFFF8" align="center" class="bodyTextBold"> </td>
</tr>
<tr bgcolor="#C8D1D8">
<td align="center" class="subHead">This application is copyright © JemWeb Internet Designs</td>
</tr>
</table>
</td>
</tr>
</table>
<map name="jemscripts">
<area shape="rect" coords="615,6,744,40" href="http://www.jemscripts.co.uk/" target="_blank">
</map>
</body>
</html>
--------------------------------------------------------------------
login.php :
--------------------------------------------------------------------
<?php
/*
# THIS FILE NEEDS NO CONFIGURATION - DO NOT ALTER ANY OF THE CODE ON THIS PAGE
#
##############################################################################
*/
error_reporting(E_ALL & ~ (E_NOTICE));
$menu_var=$HTTP_POST_VARS["menu_var"];
$authorised=$HTTP_POST_VARS["authorised"];
$try_name=$HTTP_POST_VARS["try_name"];
$try_pass=$HTTP_POST_VARS["try_pass"];
$log_off=$HTTP_POST_VARS["log_off"];
if ($log_off) $authorised="";
include ("functions.php");
get_user_data();
$sub_title="Log-in";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CustomCount - customisable page hit counter</title>
<meta name="robots" content="index, follow">
<meta name="MSSmartTagsPreventParsing" content="true">
<meta name="rating" content="general">
<meta name="copyright" content="This page and all of its contents are the copyright of Jemweb Internet Designs">
<meta name="Author" content ="Jemweb Internet Designs">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
</script>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#003333">
<table width="758" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td bgcolor="#FFFFF8" align="center">
<table width="754" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<img src="images/banner.png" alt="CustomCount" width="754" height="70" border="0" usemap="#jemscripts">
</td>
</tr>
<tr>
<td class="footNote">Version 2.1</td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFF8" class="titleBox">Log-in </td>
</tr>
<tr bgcolor="#E8E8EB">
<td align="center" class="backgroundPanel">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<p> </p>
<?php
switch ($menu_var)
{
case "":
?>
<form action="login.php" method="post" style="padding:0; border:0; margin:0">
<input type="hidden" name="menu_var" value="validate_execute">
<input type="hidden" name="pass" value="1">
<table width="65%" border="0" align="center" cellpadding="2" cellspacing="0">
</table>
<table width="65%" border="0" align="center" cellpadding="2" cellspacing="3">
<tr>
<td class="bodyTextBold"><?php echo $sub_title; ?><br>
</td>
</tr>
<tr>
<td><p> <br></p>
</td>
</tr>
<tr>
<td valign="middle" bgcolor="#C8D1D8" class="pageCell">Enter your user name</td>
<td width="260" align="center" valign="middle" bgcolor="#C8D1D8" class="pageCell">
<input type="text" name="try_name" <?php echo "value='$try_name'"; ?> class="formBoxes">
</td>
</tr>
<tr>
<td valign="middle" bgcolor="#C8D1D8" class="pageCell">Enter your password</td>
<td align="center" valign="middle" bgcolor="#C8D1D8" class="pageCell">
<input type="password" name="try_pass" <?php echo "value='$try_pass'"; ?> class="formBoxes">
</td>
</tr>
<tr valign="middle">
<td colspan="2" align="right" class="bodyText"> Click to log-in
<input type="submit" name="Submit" value="Go!">
</td>
</tr>
<tr valign="bottom">
<td height="50" colspan="2" valign="top" class="bodyText">
<p><a href="javascript:;" class="link" onFocus="if(this.blur)this.blur()" onClick="MM_openBrWindow('help.php?helpVar=lost_login','','scrollbars=yes,resizable=yes,width=500,height=250,top=10,left=15')">Forgotten your user name/password?</a><br>
<a href="javascript:;" class="link" onFocus="if(this.blur)this.blur()" onClick="MM_openBrWindow('http://www.customcount.co.uk/documentation/index.html','','scrollbars=yes,resizable=yes,width=450,height=250,top=10,left=15')">Documentation</a></p>
</td>
</tr>
</table>
</form>
<?php
break;
case "validate_execute":
$TryName=HTMLSpecialChars($TryName);
$TryPass=HTMLSpecialChars($TryPass);
$admin_user_name=base64_decode($admin_user_name);
$admin_password=base64_decode($admin_password);
if (trim($try_name!=$admin_user_name)) {
$message_a="You have not entered the correct user name.";
}
elseif (trim($try_pass!=$admin_password)) {
$message_a="You have not entered the correct password.";
}
if($message_a) {
$message_b="Please return to the form and check/re-enter the item.";
$form_action="login.php";
$hidden_fields="<input type='hidden' name='menu_var' value=''>";
$hidden_fields.="<input type='hidden' name='pass' value='1'>";
$hidden_fields.="<input type='hidden' name='try_name' value='$try_name'>";
$hidden_fields.="<input type='hidden' name='try_pass' value='$try_pass'>";
$button_message="Return to form ";
$submit="<input type='submit' name='submit' value='Go!'>";
}
else {
$message_a="Your log-in details were accepted.";
$form_action="menu.php";
$hidden_fields="<input type=\"hidden\" name=\"pass\" value=\"1\">";
$hidden_fields.="<input type=\"hidden\" name=\"menuvar\" value=\"menu\">";
$button_message="Continue to the Admin Area ";
$submit="<input type=\"submit\" name=\"submit\" value=\"Go!\">";
}
include("messaging.php");
break;
}
?>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="22" bgcolor="#FFFFF8" align="center" class="bodyTextBold"> </td>
</tr>
<tr>
<td bgcolor="#C8D1D8" align="center" class="subHead">This application is copyright © JemWeb Internet Designs</td>
</tr>
</table>
</td>
</tr>
</table>
<map name="jemscripts">
<area shape="rect" coords="615,6,744,40" href="http://www.jemscripts.co.uk/" target="_blank">
</map>
</body>
</html>
-------------------------------------------------------------------------
[modedit=Aar]Code-tags toegevoegd om de boel leesbaar te houden. Gelieve dit in het vervolg zelf te doen. Zie ook de UBB-codes op de '
Meest gestelde vragen' op de site.