I saw the php versions but my shared hosting only has php 4, php 5.2 and php 5.3 listed...
funny thing was that this script was working before they switched servers on me and now it doesnt work unless i goto php 5.2 which i dont wanna do..
I did find out in the script that its only the .csv part not uploading. the part where I can edit stats manually works.
here is some of my code for you to see
<?
if (!function_exists('str_getcsv')) {
function str_getcsv($input, $delimiter = ',', $enclosure = '"', $escape = null,
$eol = null)
{
$temp = fopen("php://memory", "rw");
fwrite($temp, $input);
fseek($temp, 0);
$r = array();
while (($data = fgetcsv($temp, 4096, $delimiter, $enclosure)) !== false) {
$r[] = $data;
}
fclose($temp);
return $r;
}
}
function fix($array)
{
$newarray = array();
for ($i = 1; $i != count($array); $i++) {
$newarray[] = $array[$i];
}
return $newarray;
}
function str_compare($str1, $str2)
{
$count = 0;
$str1 = preg_replace("[^a-z]", ' ', strtolower($str1));
while (strstr($str1, ' ')) {
$str1 = str_replace(' ', ' ', $str1);
}
$str1 = explode(' ', $str1);
$str2 = preg_replace("[^a-z]", ' ', strtolower($str2));
while (strstr($str2, ' ')) {
$str2 = str_replace(' ', ' ', $str2);
}
$str2 = explode(' ', $str2);
if (count($str1) < count($str2)) {
$tmp = $str1;
$str1 = $str2;
$str2 = $tmp;
unset($tmp);
}
for ($i = 0; $i < count($str1); $i++) {
if (in_array($str1[$i], $str2)) {
$count++;
}
}
return $count / count($str2) * 100;
}
$u = isset($_POST['u']) ? $_POST['u'] : $_GET['u'];
$max_scoring_summary = 20;
$max_penalty_summary = 25;
//SECURITY CHECK - SEE IF USERNAME EXISTS
if ($u) {
include ('../../../config.php');
$open = mysql_connect($hostname, $user, $password);
mysql_select_db("$db", $open);
$teams = mysql_query("SELECT * FROM teams WHERE username = '$u'");
$timeloggedin = mysql_result($teams, 0, "logtime");
$loggedin = mysql_result($teams, 0, "loggedin");
$sessionid = mysql_result($teams, 0, "sessionid");
$leagueinfo = mysql_query("SELECT timelength FROM leagueinfo");
$logtime = mysql_result($leagueinfo, 0, "timelength");
$sessid = isset($_POST['sessid']) ? $_POST['sessid'] : $_GET['sessid'];
if ($loggedin == "1" && $sessid == $sessionid) {
$cktime = $timeloggedin + ($logtime * 60);
$ctime = date("U");
if ($ctime < $cktime) {
$tsql = "UPDATE teams SET logtime = '" . date("U") . "' WHERE username = '$u'";
$tdone = mysql_query($tsql);
if (!$tdone) {
echo mysql_errno() . ": " . mysql_error() . "<br>";
}
?>
<html>
<head>
<title>Edit Game</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../../includes/leaguestyle.css">
<style type="text/css">
<!--
a { color: #990000; text-decoration: none}
a:hover { color: #990000; text-decoration: underline}
-->
</style>
<script language="JavaScript" src="../../../date-picker.js"></script>
</head>
<body bgcolor="#FFFFFF" leftmargin="10" topmargin="10" marginwidth="0" marginheight="0">
<?
//SEE IF INTER-DIVISION PLAY IS ALLOWED AND GET USER PERMISSIONS
$result_edit = mysql_query("SELECT edit FROM leagueinfo");
$sedit = mysql_result($result_edit, 0, "edit");
if ($u == 'admin' && $sedit == 0) {
$sedit = 1;
} elseif ($u != 'admin' && $sedit == 0) {
$sedit = 0;
} else {
$sedit = 1;
}
$edit = $_POST['edit'];
if ($edit == "yes") {
$thisdiv = $_POST['thisdiv'];
$selectteam = $_POST['selectteam'];
$season = $_POST['season'];
$gameid = $_POST['gameid'];
$date = $_POST['date'];
$time = $_POST['time'];
$location = $_POST['location'];
$arena = $_POST['arena'];
$team1_score = $_POST['team1_score'];
$team2_score = $_POST['team2_score'];
$game_ot = $_POST['game_ot'];
$gametype = $_POST['gametype'];
$league = $_POST['league'];
$team1_ppgf = $_POST['team1_ppgf'];
$team1_ppo = $_POST['team1_ppo'];
$team1_pkga = $_POST['team1_pkga'];
$team1_pka = $_POST['team1_pka'];
$team2_ppgf = $_POST['team2_ppgf'];
$team2_ppo = $_POST['team2_ppo'];
$team2_pkga = $_POST['team2_pkga'];
$team2_pka = $_POST['team2_pka'];
$goals = $_POST['goals'];
$assists = $_POST['assists'];
$goalsa = $_POST['goalsa'];
$shotsa = $_POST['shotsa'];
$minutes = $_POST['minutes'];
$xtra1 = $_POST['xtra1'];
$xtra2 = $_POST['xtra2'];
$xtra3 = $_POST['xtra3'];
$xtra4 = $_POST['xtra4'];
$xtra5 = $_POST['xtra5'];
$gminutes = $_POST['gminutes'];
$gseconds = $_POST['gseconds'];
$played = $_POST['played'];
$sstime = $_POST['sstime'];
$ssperiod = $_POST['ssperiod'];
$ssplayer = $_POST['ssplayer'];
$sstype = $_POST['sstype'];
$ssassist1 = $_POST['ssassist1'];
$ssassist2 = $_POST['ssassist2'];
$sspic = $_POST['sspic'];
$pstime = $_POST['pstime'];
$psperiod = $_POST['psperiod'];
$psplayer = $_POST['psplayer'];
$pstype = $_POST['pstype'];
$psminutes = $_POST['psminutes'];
$pspic = $_POST['pspic'];
mysql_query("DELETE FROM goalinfo WHERE gameid=$gameid");
mysql_query("DELETE FROM penaltyinfo WHERE gameid=$gameid");
for ($x = 0; $x < $max_scoring_summary; $x++) {
//GET THE USER'S TEAM
$userteam = $selectteam;
if ($team1_score1) {
$team1_score = $team1_score1 . "," . $team1_score2 . "," . $team1_score3;
$team2_score = $team2_score1 . "," . $team2_score2 . "," . $team2_score3;
}
if (($location == "" || $arena == "" || $time == "" || $date == "") && $sedit ==
1) {
echo "
<p class=warning align=center>NO NEW TEAM ADDED:<br>YOU DID NOT COMPLETE THE FORM.</p>\n\r
<p class=header align=center>GO <a href='javascript:history.go(-1)'><u>BACK</u></a> AND TRY AGAIN.</p>";
} else {
$today = date("Y-m-d");
if (($today < $newdate) || $newteam1_score == "" || $newteam2_score == "") {
$newteam1_score = "---";
$newteam2_score = "---";
}
//EDIT INFORMATION
if ($sedit == 0 && $u != "admin") {
$sql = "UPDATE schedule_scores SET team1_score = '$team1_score', team2_score = '$team2_score' WHERE id = '$gameid'";
} else {