You try to use ur register page on a free webhosting mysql ? that will never work
if no then use the scripts i post
try my scripts maby will work for you to
index.php
PHP Code:
<?php
/**
* Registration handling
*
* @author Claus Jørgensen <thedeathart@gmail.com>
* @category Common
* @package Kalonline Registration
* @copyright Copyright (c) 2006 Claus Jørgensen (http://dragons-lair.org)
* @license MIT License
*/
include 'Password.php'; // password class
include 'Captcha.php'; // captcha class
session_start(); // required for captcha to work
// error reporting
error_reporting(E_ALL);
ini_set('display_errors','Off');
// configuration
$config = array(
'db_username' => 'sa', // database username
'db_password' => '*******', // database password
'db_dsn' => 'kal_auth', // system DSN to the database
'template' => 'registration.tpl', // registration template path/filename
'debug' => false, // show SQL errors if true
);
// HTML error
define('UI_ERROR','<span class="error">%s</span>');
// if we need to output a captcha
if(isset($_GET['captcha'])) {
$captcha = new Captcha(120,40,6);
}
// if submitted
if(strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
$username = $_POST['username'];
$password = $_POST['password'];
$captcha = $_POST['captcha'];
$error = array();
// validate username
if(!ctype_alnum($username)) {
$error['username'] = sprintf(UI_ERROR,'Illigal characters in the username');
}
// validate password
if(!ctype_alnum($password)) {
$error['password'] = sprintf(UI_ERROR,'Illigal characters in the password');
}
// validate captcha
if($captcha != $_SESSION['captcha']) {
$error['captcha'] = sprintf(UI_ERROR,'Wrong security code');
}
// no errors, continue to username check
if(empty($error)) {
// db connect
$conn = odbc_connect($config['db_dsn'],
$config['db_username'],
$config['db_password']);
// check about account name is taken
$check = "SELECT
[ID] FROM [Login]
WHERE
[ID]='%s'
OR
[ID]='%s'
OR
[ID]='%s'
OR
[ID]='%s'
";
$check = sprintf($check,$username,
strtolower($username),
strtoupper($username),
ucfirst($username)
);
$exec = odbc_exec($conn,$check);
// check for errors
if(!$exec && ($config['debug'] === true)) {
echo odbc_errormsg($conn);
die();
}
// is the account registered?
$data = odbc_fetch_array($exec);
if($data !== false) {
$error['username'] = sprintf(UI_ERROR,'Account allready registered,
please choose another name');
} else { // else continue
// encode password
$password = Password::encode($password);
// prepare sql
$sql = "INSERT INTO
[Login] ([ID],[PWD],[Birth],[Type],[ExpTime],[Info])
VALUES
('".$username."',".$password.",'19190101',0,4000,0)
";
// insert user
$result = odbc_exec($conn,$sql);
if(!$result && ($config['debug'] === true)) {
echo odbc_errormsg($conn);
die();
}
}
}
}
// display template
include $config['template'];
?>
Captcha.php
PHP Code:
<?php
class Captcha
{
private $font = 'arial.ttf';
function generateCode($characters) {
$possible = '23456789bcdfghjkmnpqrstvwxyz';
$code = '';
for($i=0;$i<$characters;$i++) {
$code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
}
return $code;
}
function __construct($width='30',$height='20',$characters='6') {
$code = $this->generateCode($characters);
$_SESSION['captcha'] = $code;
$font_size = $height * 0.30;
$image = imagecreate($width, $height);
$background_color = imagecolorallocate($image, 19,26,25);
$text_color = imagecolorallocate($image, 255, 255, 255);
$noise_color = imagecolorallocate($image, 19,26,25);
for($i=0; $i<($width*$height)/3;$i++) {
imagefilledellipse($image,mt_rand(0,$width)
,mt_rand(0,$height)
,1,1
,$noise_color);
}
for($i=0;$i<($width*$height)/150;$i++) {
imageline($image,mt_rand(0,$width)
,mt_rand(0,$height)
,mt_rand(0,$width)
,mt_rand(0,$height)
,$noise_color);
}
$textbox = imagettfbbox($font_size, 0, $this->font, $code);
$x = ($width - $textbox[4])/2;
$y = ($height - $textbox[5])/2;
imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code);
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
}
}
?>

Originally Posted by
break
If you wana be a smart ass then show us that you ar
PHP Code:
<script LANGUAGE="JavaScript">
<!--
function apply()
{
document.break.sub.disabled=true;
if(document.break.smartass.checked==true)
{
document.break.sub.disabled=false;
}
if(document.break.smartass.checked==false)
{
document.break.sub.enabled=false;
}
}
// -->
</script>
PHP Code:
<form action="" method="post" id=break name=break>
<input name='smartass' type='checkbox' onclick='apply()'>
I agree with the <a href="rules.html">Server Rules</a>.
<input type="submit" onclick="return confirmSubmit()" Value="Register" name=sub disabled>
<input type="reset" class="control" value="Reset">