Blame view

checkCreds.php 526 Bytes
bb6a08e5   Jean Wasilewski   Added full creds ...
1
  <?php
14540574   Jean Wasilewski   Fixed inclusion d...
2
  require_once("creds.php");
bb6a08e5   Jean Wasilewski   Added full creds ...
3
  
bb6a08e5   Jean Wasilewski   Added full creds ...
4
5
6
7
8
9
10
  if(!(isset($_GET["user"])&&isset($_GET["pass"])))
  	die("Nop");
  
  $link = mysql_connect(__MYSQL_HOSTNAME__, __MYSQL_USERNAME__, __MYSQL_PASSWORD__)
  	or die("Nop");
  
  if(!mysql_select_db('crep', $link))
f42e5a0f   Jean Wasilewski   Fixed issue with die
11
  	die('Nop');
bb6a08e5   Jean Wasilewski   Added full creds ...
12
  
e9bec98f   Jean Wasilewski   Issue tracking - ...
13
  $requete = 'SELECT pk, admin FROM users WHERE username=\''.$_GET["user"].'\' AND password=\''.$_GET["pass"].'\'';
bb6a08e5   Jean Wasilewski   Added full creds ...
14
15
16
17
18
  $resultat = mysql_query($requete);
  	
  if (!$resultat)
  	die("Nop");
  	
b3d7ea05   Jean Wasilewski   Minor fix
19
  if($row = mysql_fetch_assoc($resultat))
bb6a08e5   Jean Wasilewski   Added full creds ...
20
21
22
23
24
25
26
  	echo 'Yep';
  else
  	echo 'Nop';
  
  	
  mysql_close($link);
  ?>