Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysql_connect('localhost', '', '');
- mysql_select_db('test');
- mysql_query("SET NAMES 'UTF8'") or die(mysql_error());
- $no = 0;
- $file = fopen("inkpass.txt","r");
- while(! feof($file))
- {
- $line = fgets($file);
- $line = iconv('ISO-8859-1', 'UTF-8', $line);
- //id | username | nickname | email | sex | bornyear | tlf | password (MD5)
- list($id, $username, $nickname, $email, $sex, $bornyear, $tlf, $password) = explode('|', $line, 8);
- $id = trim($id);
- $username = trim($username);
- if ($username == ""){$username = "NULL";}
- $nickname = trim($nickname);
- if ($nickname == ""){$nickname = "NULL";}
- $nickname = addslashes($nickname);
- $email = trim($email);
- if ($email == ""){$email = "NULL";}
- $sex = trim($sex);
- if ($sex == ""){$sex = "NULL";}
- $bornyear = trim($bornyear);
- if ($bornyear == ""){$bornyear = "NULL";}
- $tlf = trim($tlf);
- if ($tlf == ""){$tlf = "NULL";}
- $password = trim($password);
- if ($password == ""){$password = "NULL";}
- mysql_query("INSERT INTO hemmelig_users2 (id, username, nickname, email, sex, bornyear, tlf, password)
- VALUES ('$id', '$username', '$nickname', '$email', '$sex', '$bornyear', '$tlf', '$password')");
- $no++;
- echo $no . "\n";
- }
- fclose($file);
- mysql_close($con);
- ?>
Add Comment
Please, Sign In to add comment