Subversion Repositories ALCASAR

Rev

Rev 861 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 861 Rev 870
Line 149... Line 149...
149
		if ($tab) // file isn't empty
149
		if ($tab) // file isn't empty
150
			{
150
			{
151
			foreach ($tab as $line) // test if IP address doesn't already exist
151
			foreach ($tab as $line) // test if IP address doesn't already exist
152
				{
152
				{
153
				$IP_f=explode(" ", $line);
153
				$IP_f=explode(" ", $line);
154
				if (trim($_POST['add_ip']) == trim(trim($IP_f[0],"#"))) {$insert = false;}
154
				if (strcmp (trim($_POST['add_ip']),trim(trim($IP_f[0],"#"))) == 0)
-
 
155
					{
-
 
156
					$insert = false;
-
 
157
					break;
-
 
158
					}
155
				}
159
				}
156
			}
160
			}
157
		if ($insert == true) 
161
		if ($insert == true) 
158
			{
162
			{
159
			$line ="\n" . "#".trim($_POST['add_ip']) . " " . trim($_POST['add_comment']);
163
			$line ="\n" . "#".trim($_POST['add_ip']) . " " . trim($_POST['add_comment']);