[quote='mod-edit]
[ignore]
 tags toegevoegd[/ignore]
[/quote]

Hallo,

Ondanks dat ik error reporting aan heb staan krijg ik niets te zien, alleen een wit scherm als ik submit.

Verder word er ook niets in de database gezet.

Bvd,
Robin
[code]
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);

//Battle Quest Gaming System V2.0 - Copyright 2006 by Robin Peters

include('config/config.php');

if(isset($_SESSION['user_id'])) 
{
error_message("You can not create a second account.");
}
else{

if($_SERVER['REQUEST_METHOD'] == 'POST'){
	
	//Replace input
	$username = addslashes($_POST['username']);
	$password = addslashes($_POST['password']);
	$password1 = addslashes($_POST['password1']);
	$email = $_POST['email'];
	$email1 = $_POST['email1'];
	$website = $_POST['website'];
	$logo = $_POST['logo'];
	$ip = $_SERVER['REMOTE_ADDR'];
	$joidate = date("F j, Y, g:i a"); 
	
	//Random Activation Code Generator
	function NumcharGen($length, $caps)
	{
	if ($caps == 1)
	$letters = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ1234567890";
	else
	$letters = "abcdefghijklmnopqrstuvwxyz1234567890";
	
	for ($i = 1; $i <= $length; $i++)
	{
	$randnum = rand(0, strlen($letters));
	
	if ($i == 1)
	$randchar = substr($letters, $randnum, 1);
	else
	$randchar .= substr($letters, $randnum, 1);
	}
	
	return $randchar;
	}
	
	$activationcode = NumcharGen(10,1);
	

	
		if(empty($username))
        { 
        error_message("No username enetered.");    
        } 
		elseif(empty($password) || empty($password1))
        { 
        error_message("No password enetered.");    
        } 
		elseif(empty($email) || empty($email1))
        { 
        error_message("No email enetered.");    
        } 
		elseif(empty($website))
        { 
        $website = 'http://www.bq-gaming.com';    
        } 
		elseif(empty($logo))
		{
		$logo = 'http://www.bq-gaming.com/images/noplayerlogo.jpg';
		}
		elseif (empty($_POST['termsagreed']))
        { 
        error_message("You must fully agreed the Terms of Service to join this site."); 
        } 
    	elseif (empty($_POST['ageagreed']))
        { 
        error_message("You must be over years old to join this site."); 
        }
		elseif ($password != $password1)
		{
		error_message("Passwords do not match."); 
        }
		elseif ($email != $email1)
		{
		error_message("E-Mails do not match."); 
        }
		else
		{
			$sql_db = "SELECT username FROM members WHERE username = '$username'";
			$res_db = mysql_query($sql_db);
			
			$sql_db1 = "SELECT email FROM members WHERE email = '$email'";
			$res_db1 = mysql_query($sql_db1);
			
			$sql_db2 = "SELECT ip FROM members WHERE ip = '$ip'";
			$res_db2 = mysql_query($sql_db2);
			
			if (mysql_num_rows($res_db) >= 1)
			{
			error_message("This username is already in use.");
			}
			elseif (mysql_num_rows($res_db1) >= 1)
			{
			error_message("This e-mail address is already in use.");
			}			 	
			elseif (mysql_num_rows($res_db2) >= 1)
			{
			error_message("This IP address is already in use.");
			}
			else{
			
				$query = "INSERT INTO members (`username`, `password`, `email`, `website`, `logo`, `ip`, `joindate`, `activationcode`, `termsagreed`, `ageagreed`, 'active') 
						 VALUES ('$username', '$password', '$email', '$website', '$logo', '$ip', '$joindate', '$activationcode', '$termsagreed', 'ageagreed')";
				mysql_query($query) or die(mysql_error()); 
				
					if($query)
					{
					$to = $email; 
					$subject = "Account Activation "; 
					$from = "Webmaster <>"; 
					
					$msg = "===========================================\n"; 
					$msg .= "Account activation\n"; 
					$msg .= "===========================================\n\n"; 
					
					$msg .= "Your account has been created. It only has to be \n"; 
					$msg .= "activated.\n\n"; 
					
					$msg .= "Your callsign: '$callsign'\n"; 
					$msg .= "Your password: '$password'\n\n"; 
					
					$msg .= "Activation URL:\n"; 
					$msg .= "/validade.php&activationcde='$activationcode'&callsign='$callsign'\n\n"; 
					
					$msg .= "Thanks for registering on .\n\n"; 
					
					$msg .= "===========================================\n"; 
					$msg .= "End of automatic generated message\n"; 
					$msg .= "==========================================="; 
	
						// Check if e-mail can get sended, 
						if (mail($to, $subject, $msg, "From: $from")) 
						{ 
						echo "<font class='menutext'><p>Your account has been created but you cant login yet.</p></font>"; 
						echo "<font class='menutext'><p>There is an e-mail sended with an activation key to activate your account.</p></font>"; 
						}
					} 
				}
			}
		}
		
	else
{
?>

<!-- HTML FIELDS -->
<form action= "register_beta.php" method="post">
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="menuText">
  <tr>
    <td width="189">Username :</td>
    <td width="189"><input name="username" type="text" class="header" id="username" /></td>
  </tr>
  <tr>
    <td>Password :</td>
    <td><input name="password" type="password" class="header" id="password" /></td>
  </tr>
  <tr>
    <td>Password repeat : </td>
    <td><input name="password1" type="password" class="header" id="password1" /></td>
  </tr>
  <tr>
    <td>E-mail :</td>
    <td><input name="email" type="text" class="header" id="email" /></td>
  </tr>
  <tr>
    <td>E-mail repeat : </td>
    <td><input name="email1" type="text" class="header" id="email1" /></td>
  </tr>
  <tr>
    <td>Website : </td>
    <td><input name="website" type="text" class="header" id="website" /></td>
  </tr>
  <tr>
    <td>Logo : </td>
    <td><input name="logo" type="text" class="header" id="logo" /></td>
  </tr>
  <tr>
    <td>I fully agreed the Terms of Service : </td>
    <td><input name="termsagreed" type="checkbox" class="header" id="termsagreed" value="checkbox" checked="checked" /></td>
  </tr>
  <tr>
    <td>My age is over ' . $minjoinage . ':</td>
    <td><input name="ageagreed" type="checkbox" class="header" id="ageagreed" value="checkbox" /></td>
  </tr>
  <tr>
    <td colspan="2"><div align="center">
      <input name="submit" type="submit" class="header" id="submit" value="Register" />
    </div></td>
  </tr>
</table>
</form>
<?php
	}
}
?>
Je INSERT query klopt niet.
<?php
$query = "INSERT INTO members (`username`, `password`, `email`, `website`, `logo`, `ip`, `joindate`, `activationcode`, `termsagreed`, `ageagreed`, 'active')
VALUES ('$username', '$password', '$email', '$website', '$logo', '$ip', '$joindate', '$activationcode', '$termsagreed', 'ageagreed')";
?>
Voor VALUES heb je een veld 'active', maar daar geef je daarna geen variabele voor op.

Tip: haal die backtics (`) er uit. Dat is dialect dat alleen MySQL gebruikt.

Reageren