did a little work to clean your code up. not sure why you want to create another table with one thing in it, why not just add a column to the users table.
<html>
<head>
<title>ReH-0.1--Create a Session</title>
</head>
<body bgcolor="#575757">
<center>
<?php
try {
// Connect and select
$connect = mysql_connect("localhost","root","");
if(!$connect) {
throw new Exception( mysql_error() );
}
mysql_select_db( "reh_temp", $connect );
// verify post-data
if( isset( $_POST['session'] ) && !empty( $_POST['session'] ) ) {
if( strlen( $_POST['session'] ) < 4 ) {
throw new Exception('Session must be longer than four characters');
}
$session = mysql_real_escape_string($_POST['session']);
} else {
throw new Exception( 'Session Required' );
}
if(isset($_POST['session_conf']) && !empty($_POST['session_conf'])) {
if( strlen( $_POST['session_conf'] ) < 4 ) {
throw new Exception('Session confirmation must be longer than four characters');
}
$session_conf = mysql_real_escape_string($_POST['session_conf']);
} else {
throw new Exception( 'Session Confirmation Required' );
}
// Query post data
$query = mysql_query("SELECT * FROM users WHERE users='${session}'");
if( mysql_num_rows( $query ) != 0 ) {
//Check for Match
if ( $session != $session_conf ) {
throw new Exception('Session does not match confirmation');
}
//Insert value into users table
if( !@mysql_query( "INSERT INTO users VALUES ( '${session}' )" ) ) {
throw new Exception( mysql_error() );
}
// if this executes the script is complete
print '<font color="#0F0">Success</font>';
} catch(Exception $objException) {
print '<font color="#f00">' . $obj->Exception->getMessage() . '</font><br/>';
}
?>
<font color="#fff">Before encrypting your password, a session must be started. We need you to enter a personal session name that you will remember so that you password is protected by this session.</font><br />
<form action="ReH-0.1.php" method="POST">
<label for="session" style="color: #fff;">Session Name:
<input type="text" maxlength="10" size="10" name="session"></label><br />
<label for="session_conf" style="color: #fff;">Session Name Confirmation:
<input type="text" maxlength="10" size="10" name="session_conf"></label><br />
<input type="submit" value="Create Session">
</form>
</center>
</body>
</html>