CREATE TABLE `user` ( `id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT, `username` varchar(32) NOT NULL, `password` varchar(32) NOT NULL, `firstaname` text collate latin1_general_ci NOT NULL, `secondname` text collate latin1_general_ci NOT NULL, `aboutme` text collate latin1_general_ci NOT NULL, `level` int(4) NOT NULL DEFAULT '1', `dateofbirth` date NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;
no i w tym tutorialu byl ze trzeba zrobic database.php(jestem pewien ze jest dobrze ustawione bo zadne bledy nie wyskakuja) i reg.php no to go próbowałem trochę zmienić pod moja tabele i takie cos mi wyszlo
<?php require_once 'database.php'; ?> <h1><strong>Register</strong></h1> <form name="register" method="post" action="regcheck.php"> <p>Username* <input type="text" name="user" id="user"> <br> <label> Password* <input type="password" name="pass" id="pass"> <br /> </label> First Name* <input type="text" name="firstname" id="firstname"> <br /> </label> Second Name* <input type="text" name="secondname" id="secondname"> <br /> </label> About Me* <input type="text" name="aboutme" id="aboutme"> <br /> </label> Date of Birth(DD/MM/YYYY)* <input type="date" name="dateofbirth" id="dateofbirth"> <br /> </label> <label> <input type="submit" name="reg" id="reg" value="Register"> </label> </p> <p>*You need to fill them in.</p> </form> <label></label> <form name="Back" method="post" action="Login.php"> <input type="submit" name="back" id="back" value="Back to Home"> <p> </p>
no i potem bylo ze trzeba zrobic regcheck.php, no to tez troche probowalem cos zmienic i tak mi wyszlo
<?php if( ) { { } { } elseif( $_POST['pass'] == $_POST['user'] ) { } else { include( 'database.php' ); $sqlCheckForDuplicate = "SELECT username FROM user WHERE username = '". $username ."'"; { $sqlRegUser = "INSERT INTO user( username, password, firstname, secondname, aboutme, dateofbirth) VALUES( '". $username ."', '". $password ."' '". $firstname ."', '". $secondname ."', '". $aboutme ."', '". $dateofbirth ."', )"; { } else { $formUsername = $username; } } else { $formUsername = $username; } } } else { }
no i potem jak prubuje sie zarejestrowac to wyskakuje "You Could Not Register Because Of An Unexpected Error.", jezeli ktos byl by na tyle mily zeby mi wytlumaczyc co zrobilem zle to byl bym bardzo wdzieczny.

