Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host =
- $userName =
- $password =
- $dbName =
- $con = mysqli_connect($host, $userName, $password, $dbName);
- mysqli_query("SET NAMES utf8");
- $name = $_POST['name'];
- $surname = $_POST['surname'];
- $age = $_POST['age'];
- $sex = $_POST['sex'];
- $height = $_POST['height'];
- $weight = $_POST['weight'];
- $look = $_POST['look'];
- $personality = $_POST['personality'];
- $history = $_POST['history'];
- $img = $_POST['img'];
- $token = $_POST['token'];
- $query2 = mysqli_query($con, "SELECT userDISID FROM tokens WHERE token='".$token."'");
- $userDISID = mysqli_fetch_row($query2);
- $mysqli = new mysqli($host, $userName, $password, $dbName);
- $mysqli->set_charset("utf8");
- $query = mysqli_query($con, "SELECT * FROM tokens WHERE token='".$token."'");
- if (!$query)
- {
- die('Error: ' . mysqli_error($con));
- }
- else if(mysqli_num_rows($query) == 0){
- echo "Nieprawidłowy token.";
- }
- else{
- $userDISID2 = implode("|",$userDISID);
- $sql3 = "INSERT INTO kartyPostaci (token, userDISID, isVerified, name, surname, age, sex, height, weight, look, personality, history, img) VALUES ('$token', '$userDISID2', 'Nie', '$name', '$surname', '$age', '$sex', '$height', '$weight', '$look', '$personality', '$history', '$img')";
- $query3 = mysqli_query($con, $sql3);
- $sql4 = "DELETE FROM tokens WHERE token = '$token'";
- $query4 = mysqli_query($con, $sql4);
- $sql5 = "SET CHARSET utf8";
- $query5 = mysqli_query($con, $sql5);
- echo "Dodano kartę.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement