salve sto lavorando ad un sito web, ma la query della registrazione non mi dà risultati sulla tabella utenti del databse my_graphicsdeisgn appartenente al mio sito qualcuno mi potrebbe gentilmente dare un'occhiata al mio codice?
code:
<?php
define('DB_HOST', 'localhost');
define('DB_NAME', 'my_graphicsdesign');
define('DB_USER','root');
define('DB_PASSWORD','');
$con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD)
or die("Failed to connect to MySQL: " .
mysql_error()); $db=mysql_select_db(DB_NAME,$con)
or die("Failed to connect to MySQL: " .
mysql_error());
function NewUser() {
$fullname = $_GET['fullname'];
$userName = $_GET['userName'];
$email = $_GET['email'];
$pass = $_GET['pass'];
$query="INSERT INTO utenti (fullname, userName, email, pass) VALUES (".$fullname.", "".$userName."", "".$email."", "".$pass."")";
$data = mysql_query ($query)or die(mysql_error());
if($data) { echo "YOUR REGISTRATION IS COMPLETED..."; } }
header("location: /home.php");
function SignUp() {
if(!empty($_POST['userName']))
{
$query = mysql_query("SELECT * FROM utenti WHERE userName = '$userName' AND pass = '$pass'")
or die(mysql_error()); if(!$row = mysql_fetch_array($query) or die(mysql_error())) { newuser();
}
else { echo "SORRY...YOU ARE ALREADY REGISTERED USER..."; } } } if(isset($_POST['submit'])) { SignUp(); }
?>
grazie in anticipo