Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require("funzioni.php");
- error_reporting(E_ALL);
- ini_set('display_errors', '1');
- $new_user = $_POST['new_user']; // new user
- $new_pass = $_POST['new_pass']; // new pass
- $confirm = $_POST['conferma_pass']; // pass confirm
- $new_email = $_POST['email']; // user email
- ?>
- <html>
- <head>
- <title>Fridle-Register</title>
- </head>
- <body>
- <?php
- pageTop();
- ?>
- <!-- Header -->
- <h1 align="center">Registrazione utente</h1>
- <!-- Register form -->
- <form method="post" action="register.php">
- <table align="center">
- <tr>
- <th align="left">Password</th>
- <th><input type="password" name="new_pass" maxlength="20"></th>
- </tr>
- <tr>
- <th align="left">Conferma password</th>
- <th><input type="password" name="conferma_pass" maxlength="20"></th>
- </tr>
- <tr>
- <th align="left">Email</th>
- <th><input type="text" name="email" maxlength="30"></th>
- </tr>
- </table>
- </br>
- <div align="center">
- <input type="submit" value="confirm">
- </div>
- <?php
- //controllo se sono inseriti i campi
- if(!empty($new_email) && !empty($new_pass) && !empty($confirm)){
- if ( $new_pass == $confirm ){
- $cryptedPass = sha1($new_pass);
- $query = " select MAX(login) from utenti ";
- $conn = connect();
- $result = mysql_query($query, $conn) or die ( "query fallita! Register.php");
- echo "$result ";
- while ( $row = mysql_fetch_array($result)){
- $out1 = $row[0];
- $new_user= $out1 + 00001;
- if ( registerNewUser( $new_user, $cryptedPass, $new_email)) {
- $a = "$new_email";
- $oggetto = " Registrazione fridle ";
- $messaggio = " Grazie \"$user\"";
- mail($new_mail,$oggetto,$messaggio);
- echo "\"$a\"";
- header ('Location: register_redirect.php');
- }
- else {
- echo "<p align=center><h2>Riscontrato un errore durante la registrazione. Contattare un amministratore</h2></p>";
- }
- }
- }
- else {
- echo "<p align=center> Le password inserite non combaciano!</p>";
- }
- }
- else {
- echo "<p align=center> I campi <b>\"Password\"</b>, <b>\"Conferma Password\"</b> e <b>\"Email\"</b>, non possono essere vuoti</p>";
- }
- ?>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment