Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="loggin.php" method="get">
- <p>Name</p><input type="text" name="user_name" size="20" /><br />
- <p>email</p><input type="text" name="email" size="20" /><br />
- <p>Album name</p><input type="text" name="album" size="20" /><br />
- <p>password</p><input type="password" name="password" size="20" /> <br />
- <p>retype pass</p><input type="password" name="password2" size="20" /> <br />
- <input type="hidden" name="secure" size="20" /> <br />
- <input type="submit" name="submit" value="submit" />
- </form>
- <?php
- ini_set ('display_errors', 1);
- error_reporting (E_ALL & ~E_NOTICE);
- require ('../user.php');
- if ($dbc = @mysql_connect ('localhost', $user, $password))
- {
- print '<p>Connected to database</p>';
- if (@mysql_select_db('Slide'))
- {
- print '<p>Database selected</p>';
- } else {
- # code...
- die('<p>no database selected:' . mysql_error() . '</p>');
- }
- if (isset ($_GET['submit'])) { //handle form
- if (empty({$_GET['user_name']})) {
- print "enter username";
- } else {
- $user = trim({$_GET['user_name']});
- }
- if (empty({$_GET['email']})) {
- print "enter email";
- } else {
- $email = trim({$_GET['email']});
- }
- if (empty({$_GET['album']})) {
- print "make an album";
- } else {
- $album = trim({$_GET['album']});
- }
- if (!empty({$_GET['password']})) {
- if({$_GET['password']} != {$_GET['password2']}) {
- }
- print "password missmatch";
- } else {
- print "enter a password";
- } else {
- $pass = trim({$_GET['password']});
- }
- $query = "INSERT INTO users (userid, user_name, password, album, email, reg_date) VALUES (0, '$user', '$pass', '$album','$email', NOW() )";
- if (@mysql_query($query)) {
- print '<p>User added</p>';
- } else {
- print '<p>error reason: ' . mysql_error() . $query . '</p>';
- }
- mysql_close();
- } else {
- die('<p>Please enter details<br /></p>');
- }
- } //end form
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement