Hey, undzwar habe ich ein register problem folgende errors:
ZitatAlles anzeigenotice: Undefined index: submit in C:\Users\***\Desktop\Maurice\XAMPP\htdocs\com\pages\register.php on line 6
Notice: Undefined index: nickname in C:\Users\***\Desktop\Maurice\XAMPP\htdocs\com\pages\register.php on line 8
Notice: Undefined index: password in C:\Users\***\Desktop\Maurice\XAMPP\htdocs\com\pages\register.php on line 9
Notice: Undefined index: email in C:\Users\***\Desktop\Maurice\XAMPP\htdocs\com\pages\register.php on line 10
Code:
PHP
<?php
include("../include/allgemein.php");
session_start();
$submit = $_POST['submit'];
$nickname = sanitize($_POST['nickname']);
$password = sanitize($_POST['password']);
$email = sanitize($_POST['email']);
if($submit)
{
if($nickname && $password && $email)
{
$query = mysql_query("INSERT INTO `users` (`nickname`,`password`,`email`) VALUES ('$nickname','$password','$email')");
$_SESSION['nickname'] = $nickname;
echo header('location: index.php');
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= $A_TITLE?></title>
<!-- Core CSS - Include with every page -->
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../font-awesome/css/font-awesome.css" rel="stylesheet">
<!-- SB Admin CSS - Include with every page -->
<link href="../css/sb-admin.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Registrieren</h3>
</div>
<div class="panel-body">
<div class="alert alert-info" role="alert">Um alle Funktionen benutzen zu können, benötigen sie ein Account. Bitte fülle alle Felder aus!</div>
<form role="form">
<fieldset>
<p>Nickname:</p>
<div class="form-group">
<input class="form-control" placeholder="Nickname" name="nickname" type="nickname" autofocus>
</div>
<br>
<p>Password:</p>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password" value="">
</div>
<br>
<p>E-Mail:</p>
<div class="form-group">
<input class="form-control" placeholder="E-Mail" name="email" type="email" value="">
</div>
<!-- Change this to a button or input when using this as a form -->
<input class="btn btn-lg btn-success btn-block" type="submit" name="submit" value="Registrieren" >
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Core Scripts - Include with every page -->
<script src="../js/jquery-1.10.2.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/plugins/metisMenu/jquery.metisMenu.js"></script>
<!-- SB Admin Scripts - Include with every page -->
<script src="../js/sb-admin.js"></script>
</body>
</html>
Alles anzeigen