Entschuldigung.
Wenn man auf die Seite kommt steht dort diese Fehlermeldung:
Code:
Nicht alle Felder ausgefullt PDO::errorInfo(): Array ( [0] => 00000 [1] => [2] => )
Das, denke ich mal, steht deswegen dort, weil in dem formular was man ja noch nicht sieht nichts drin steht.
Der Code von der Seite: (sehr lang...)
PHP-Code:
<html>
<head>
<style type="text/css">
#content {
width: 800px;
padding: 50px;
margin: 0 auto;
display: block;
font-size: 1.2em;
}
#content h2 {
line-height: 1.5em;
}
/* Add curved borders to various elements */
#contactForm, .statusMessage, input[type="submit"], input[type="button"] {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
/* Style for the contact form and status messages */
#contactForm, .statusMessage {
color: #666;
background-color: #ebedf2;
background: -webkit-gradient( linear, left bottom, left top, color-stop(0,#dfe1e5), color-stop(1, #ebedf2) );
background: -moz-linear-gradient( center bottom, #dfe1e5 0%, #ebedf2 100% );
border: 1px solid #aaa;
-moz-box-shadow: 0 0 1em rgba(0, 0, 0, .5);
-webkit-box-shadow: 0 0 1em rgba(0, 0, 0, .5);
box-shadow: 0 0 1em rgba(0, 0, 0, .5);
opacity: .95;
}
/* The form dimensions */
#contactForm {
width: 40em;
height: 33em;
padding: 0 1.5em 1.5em 1.5em;
margin: 0 auto;
}
/* Position the form in the middle of the window (if JavaScript is enabled) */
#contactForm.positioned {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin-top: auto;
margin-bottom: auto;
}
/* Dimensions and position of the status messages */
.statusMessage {
display: none;
margin: auto;
width: 30em;
height: 2em;
padding: 1.5em;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.statusMessage p {
text-align: center;
margin: 0;
padding: 0;
}
/* The header at the top of the form */
#contactForm h2 {
font-size: 2em;
font-style: italic;
letter-spacing: .05em;
margin: 0 0 1em -.75em;
padding: 1em;
width: 19.5em;
color: #aeb6aa;
background: #dfe0e5 url('images/stamp.jpg') no-repeat 15em -3em; /* http://morguefile.com/archive/display/606433 */
border-bottom: 1px solid #aaa;
-moz-border-radius: 10px 10px 0 0;
-webkit-border-radius: 10px 10px 0 0;
border-radius: 10px 10px 0 0;
}
/* Give form elements consistent margin, padding and line height */
#contactForm ul {
list-style: none;
margin: 0;
padding: 0;
}
#contactForm ul li {
margin: .9em 0 0 0;
padding: 0;
}
#contactForm input, #contactForm label {
line-height: 1em;
}
/* The field labels */
label {
display: block;
float: left;
clear: left;
text-align: right;
width: 28%;
padding: .4em 0 0 0;
margin: .15em .5em 0 0;
font-weight: bold;
}
/* The fields */
input, textarea {
display: block;
margin: 0;
padding: .4em;
width: 67%;
font-family: "Georgia", serif;
font-size: 1em;
border: 1px solid #aaa;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: rgba(0,0,0,.2) 0 1px 4px inset;
-webkit-box-shadow: rgba(0,0,0,.2) 0 1px 4px inset;
box-shadow: rgba(0,0,0,.2) 0 1px 4px inset;
background: #fff;
}
textarea {
height: 13em;
line-height: 1.5em;
resize: none;
}
/* Place a border around focused fields, and hide the inner shadow */
#contactForm *:focus {
border: 1px solid #66f;
outline: none;
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
}
/* Display correctly filled-in fields with a green background */
input:valid, textarea:valid {
background: #dfd;
}
/* The Send and Cancel buttons */
input[type="submit"], input[type="button"] {
float: right;
margin: 2em 1em 0 1em;
width: 10em;
padding: .5em;
border: 1px solid #666;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
-moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
-webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
color: #fff;
background: #0a0;
font-size: 1em;
line-height: 1em;
font-weight: bold;
opacity: .7;
-webkit-appearance: none;
-moz-transition: opacity .5s;
-webkit-transition: opacity .5s;
-o-transition: opacity .5s;
transition: opacity .5s;
}
input[type="submit"]:hover,
input[type="submit"]:active,
input[type="button"]:hover,
input[type="button"]:active {
cursor: pointer;
opacity: 1;
}
input[type="submit"]:active, input[type="button"]:active {
color: #333;
background: #eee;
-moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
-webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
}
input[type="button"] {
background: #f33;
}
</style>
<!-- Some IE7 hacks and workarounds -->
<!--[if lt IE 8]>
<style>
/* IE7 needs the fields to be floated as well as the labels */
input, textarea {
float: right;
}
#formButtons {
clear: both;
}
/*
IE7 needs an ickier approach to vertical/horizontal centring with fixed positioning.
The negative margins are half the element's width/height.
*/
#contactForm.positioned, .statusMessage {
left: 50%;
top: 50%;
}
#contactForm.positioned {
margin-left: -20em;
margin-top: -16.5em;
}
.statusMessage {
margin-left: -15em;
margin-top: -1em;
}
</style>
<![endif]-->
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
var messageDelay = 2000; // How long to display status messages (in milliseconds)
// Init the form once the document is ready
$( init );
// Initialize the form
function init() {
// Hide the form initially.
// Make submitForm() the form's submit handler.
// Position the form so it sits in the centre of the browser window.
$('#contactForm').hide().submit( submitForm ).addClass( 'positioned' );
// When the "Send us an email" link is clicked:
// 1. Fade the content out
// 2. Display the form
// 3. Move focus to the first field
// 4. Prevent the link being followed
$('a[href="#contactForm"]').click( function() {
$('#content').fadeTo( 'slow', .2 );
$('#contactForm').fadeIn( 'slow', function() {
$('#senderName').focus();
} )
return false;
} );
// When the "Cancel" button is clicked, close the form
$('#cancel').click( function() {
$('#contactForm').fadeOut();
$('#content').fadeTo( 'slow', 1 );
} );
// When the "Escape" key is pressed, close the form
$('#contactForm').keydown( function( event ) {
if ( event.which == 27 ) {
$('#contactForm').fadeOut();
$('#content').fadeTo( 'slow', 1 );
}
} );
}
// Submit the form via Ajax
function submitForm() {
var contactForm = $(this);
// Are all the fields filled in?
if ( !$('#senderName').val() || !$('#senderEmail').val() || !$('#message').val() ) {
// No; display a warning message and return to the form
$('#incompleteMessage').fadeIn().delay(messageDelay).fadeOut();
contactForm.fadeOut().delay(messageDelay).fadeIn();
} else {
// Yes; submit the form to the PHP script via Ajax
$('#sendingMessage').fadeIn();
contactForm.fadeOut();
$.ajax( {
url: contactForm.attr( 'action' ) + "?ajax=true",
type: contactForm.attr( 'method' ),
data: contactForm.serialize(),
success: submitFinished
} );
}
// Prevent the default form submission occurring
return false;
}
// Handle the Ajax response
function submitFinished( response ) {
response = $.trim( response );
$('#sendingMessage').fadeOut();
if ( response == "success" ) {
// Form submitted successfully:
// 1. Display the success message
// 2. Clear the form fields
// 3. Fade the content back in
$('#successMessage').fadeIn().delay(messageDelay).fadeOut();
$('#senderName').val( "" );
$('#senderEmail').val( "" );
$('#message').val( "" );
$('#content').delay(messageDelay+500).fadeTo( 'slow', 1 );
} else {
// Form submission failed: Display the failure message,
// then redisplay the form
$('#failureMessage').fadeIn().delay(messageDelay).fadeOut();
$('#contactForm').delay(messageDelay+500).fadeIn();
}
}
</script>
<script>
function einloggen() {
var pass = 0;
while(pass!=="Fredigonzales"){
pass = prompt('Gebe ein was du willst:');
}
document.location="./einloggen.php";
}
</script>
<title>Daniel</title>
<link rel="stylesheet" type="text/css" href="./Start.css">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link rel="stylesheet" type="text/css" href="boss.css">
</head>
<body bgcolor="#2FCDE5">
<h1 class="h1"><a href="./index.html" class="link-daniel"><br/>Daniel</a></h1>
<ul class="ul">
<li class="ulli"><a href="./Schule.html">Schule</a></li>
<li class="ulli"><a href="./Privat.php">Privat</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./index.html">-</a></li>
<li class="ulli"><a href="./impressum.html">Impressum</a></li>
</ul>
<ul class="ul2" style="float:left;">
<li><a href="./button.html">Button</a></li>
<li><a href="./adressbuch.html">AdressBuch</a></li>
<li><a href="./rechner.html">Taschen-<br/>rechner</a></li>
<li><a href="./index.html">-</a></li>
<li><a href="./index.html">-</a></li>
<li><a href="./index.html">-</a></li>
<li><a onclick="einloggen()">.</a></li>
<li><a href="./index.html">-</a></li>
<li><a href="#contactForm">_</a></li>
</ul><a name="top" id="top">
<div class="codrops-top">
<a class="codrops-icon" style="float:left;" href="#top">nach OBEN</a>
<a class="codrops-icon" style="float:right;" href="./index.html">Start</a>
</div>
<h2 class="menu" style="padding-top:0.5cm"> Alles was ich zuhause mache.</h2>
<br/>
<br/>
<form id="contactForm" action="./Privat.php" method="get">
<h2>Einloggen</h2>
<ul>
<li>
<label for="name">Dein Username</label>
<input type="text" name="name" id="senderName" placeholder="Schreibe bitte hier deinen Username rein..." required="required" maxlength="40" />
</li>
<li>
<label for="email">Passwort:</label>
<input type="password" name="pass1" id="senderEmail" placeholder="Schreibe bitte hier dein Passwort rein..." required="required" maxlength="50" />
</li>
<li>
<label for="sms" style="padding-top: .5em;">Passwort:</label>
<input type="password" name="pass2" id="senderEmail" placeholder="Schreibe bitte hier dein Passwort rein..." required="required" maxlength="50" />
</li>
<li>
<label for="message" style="padding-top: .5em;">-></label>
<input type="checkbox" name="message" id="message" required="required" >
</li>
</ul>
<div id="formButtons">
<input type="submit" id="sendMessage" name="sendMessage" value="Send Email" />
<input type="button" id="cancel" name="cancel" value="Cancel" />
</div>
</form>
<div id="sendingMessage" class="statusMessage"><p>Dankeschön! Haben Sie ein Moment Geduld.</p></div>
<div id="successMessage" class="statusMessage"><p>Dankeschön! Haben Sie ein Moment Geduld.</p></div>
<div id="failureMessage" class="statusMessage"><p>Dankeschön! Haben Sie ein Moment Geduld.</p></div>
<div id="incompleteMessage" class="statusMessage"><p>Dankeschön! Haben Sie ein Moment Geduld.</p></div>
<?php
$server = 'mysql:dbname=danpre;host=localhost; port=3333';
$user = 'danpre';
$password = 'dawdawda';
$options = array
(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
);
$pdo = new PDO($server, $user, $password, $options);
@$name=$_GET['name'];
@$pass1=$_GET['pass1'];
@$pass2=$_GET['pass2'];
if (($name!="") && ($pass1!="") && ($pass2!="")){
$statement = $pdo->prepare("INSERT INTO danpre(name, pass1, pass2)
VALUES(:first, :second, :third)");
$statement->execute(array(
"first" => "$name",
"second" => "$pass1",
"third" => "$pass2"
));}
else {
echo
"Nicht alle Felder ausgefullt";}
if (!$statement) {
echo "\nPDO::errorInfo():\n";
print_r($pdo->errorInfo());
}
?>
</body>
</html>
Das ist der Code von der Hauptseite in dem Fall.
Ich hoffe das das der Code ist den du brauchst um mir helfen zu können
<!-- Das ist nur neben Sachen:
PS: an einer Stelle steht ja:
<div id="sendingMessage" class="statusMessage"><p>Dankeschön! Haben Sie ein Moment Geduld.</p></div>
<div id="successMessage" class="statusMessage"><p>Dankeschön! Haben Sie ein Moment Geduld.</p></div>
<div id="failureMessage" class="statusMessage"><p>Dankeschön! Haben Sie ein Moment Geduld.</p></div>
<div id="incompleteMessage" class="statusMessage"><p>Dankeschön! Haben Sie ein Moment Geduld.</p></div>
Das ist die Meldung die kommt wenn man auf senden gedrückt hat...
(Das ist aus einem LayOut)
Ich habe nicht wirklich überblick über das JS Script und kann das deshalb nicht bearbeiten...
Ich möchte eig das danur iene erfolgreiche meldung kommt wenn das Senden funktioniert hat oder eine Meldung das man wieder alles einfüllen muss und das dann wieder das Formular kommt...
--!>