You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
925 B
48 lines
925 B
<!doctype html> |
|
|
|
<?php |
|
$usr=$_GET['usr']; |
|
$data="999"; |
|
if($usr=='') exit(); |
|
|
|
$mydbhost = "localhost"; |
|
$mydbuser = "yimian"; |
|
$mydbpass = 'lymian0904'; |
|
$conn = mysqli_connect($mydbhost, $mydbuser, $mydbpass); |
|
if(! $conn){ |
|
die("connect error: " . mysqli_error($conn)); |
|
} |
|
mysqli_select_db( $conn, 'yimian'); |
|
|
|
$sql = "SELECT * FROM as2 where usr='$usr'"; |
|
$result = $conn->query($sql); |
|
|
|
|
|
if ($result->num_rows < 1) |
|
{ |
|
|
|
$sql="insert INTO as2 set usr='$usr'"; |
|
|
|
|
|
if ($conn->query($sql) === TRUE) {} else { |
|
echo "Error: " . $sql . "<br>" . $conn->error; |
|
} |
|
} |
|
mysqli_close($conn); |
|
|
|
|
|
$myfile = fopen("data/$usr.as2", "w+") or die("Unable to open file!"); |
|
|
|
fwrite($myfile, $data); |
|
|
|
fclose($myfile); |
|
?> |
|
<html> |
|
<head> |
|
<meta charset="utf-8"> |
|
<title>data</title> |
|
</head> |
|
|
|
<body> |
|
</body> |
|
</html>
|