<?php include "conn.inc.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-2" /> <title>php</title> <link href="style.css" type="text/css" rel="stylesheet" /> </head> <body> <?php if ($_POST['username'] != "" && $_POST['password'] != "" && $_POST['first_name'] != "" && $_POST['last_name'] != "" ) { $query = "SELECT username FROM user_info". "WHERE username = '" . $_POST['username'] . "';"; ?> Nazwa uzytkownika <form acrion="index.php" method="post"> Nazwa kierownika: <input type="text" name="username" /><br /> <input type="submit" name="submit" value="Zarejestruj" /> <input type="reset" value="Wyczysc" /> </form> <?php } else { $query= "INSERT INTO user_info (username, password, first_name, last_name)". "VALUES ( '".$_POST['username']."', (PASSWORD('".$_POST['password']."')), '".$_POST['first_name']."', '".$_POST['last_name']."')"; $_SESSION['user_logged'] = $_POST['username']; $_SESSION['user_password'] = $_POST['password']; ?> <?php } }else { ?> Należy wypelnic wszystkie pola! <form acrion="admin.php" method="post"> Nazwa kierownika: <input type="text" name="user" value="<?php echo $_POST['username']; ?>" /> <br /> <input type="submit" name="submit" value="Zarejestruj" /> <input type="reset" value="Wyczysc" /> </form> <?php } } else { ?> Należy podac login, hasla, imienia oraz nazwiska kierownika. <form acrion="admin.php" method="post"> Nazwa kierownika: <input type="text" name="username" /><br /> Haslo: <input type="password" name="password" /><br /> Imię: <input type="text" name="first_name" /><br /> Nazwisko: <input type="text" name="last_name" /><br /> <input type="submit" name="submit" value="Zarejestruj" /> <input type="reset" value="Wyczysc" /> </form> <?php } ?> </body> </html>
Problem polega na tym, ze zamiast dzialac wywala mi błąd Something is wrong in your syntax obok '= 'asdasd'' w linii 1. w bazie mam tabele user_info. HELP