Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $user = "prog";
- $password = "515253a";
- $db = "prog";
- header("Content-Type: text/html; charset=utf-8");
- if (!$conn = mysql_connect($host, $user, $password))
- {
- echo "<h2>MySQL Error!</h2>";
- exit;
- }
- $phone=mysql_real_escape_string($_POST['phone']);
- $surname=mysql_real_escape_string($_POST['surname']);
- $Street=mysql_real_escape_string($_POST['Street']);
- mysql_select_db($db);
- $result = mysql_query("INSERT INTO `prog`.`directory` ('phone', 'surname' , ' Street') VALUES('$phone', '$surname', '$Street')");
- if ($result== true)
- {echo "Ваши данные успешно добавлены";}
- else{echo "Ваши данные не добавлены";}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment