Homepage

03/06/2011 21:30 iKyroja :>#16
Quote:
Originally Posted by yym3 View Post
So sieht ein Registrationsscript aus:

PHP Code:
<form method="post" action="">
Benutzername: <input type="text" name="loginName" /><br />
Passwort: <input type="password" name="passwort" /><br/>
Passwort Wiederholen: <input type="password" name="passwort2" /><br/>
<input type="submit" name="registrieren" value="Register" />
</form>


<?php

if(isset($_POST["registrieren"]) && $_POST["registrieren"] == "Register")
{

if(
$_POST["loginName"] == "" && $_POST["passwort"] == "" && $_POST["passwort2"] == "")
{
echo 
"Sie müssen alle Felder ausfüllen.";
}
else
{
if(
$_POST["passwort"] == $_POST["passwort2"])
{
$loschcode "1234567";
mysql_query("INSERT INTO account.account (login, password, social_id) VALUES ('".$_POST["loginName"]."', '".$_POST["passwort"]."', '".$loschcode.')");
echo "Registrierung erfolgreich!";
}
else
{
echo "Die Passwöärter stimmen nicht überein";
}
}
}

?>
Auf die Schnelle getippt, unübersichtlich unsave.
PHP Code:
mysql_query("INSERT INTO account.account (login, password, social_id) VALUES ('".$_POST["loginName"]."', '".$_POST["passwort"]."', '1234567')"); 
Ich würde es so machen, die Variable ist umständlich
03/06/2011 21:42 yym3#17
Quote:
Originally Posted by iKyroja :> View Post
PHP Code:
mysql_query("INSERT INTO account.account (login, password, social_id) VALUES ('".$_POST["loginName"]."', '".$_POST["passwort"]."', '1234567')"); 
Ich würde es so machen, die Variable ist umständlich
jo ist auch ne möglichkeit, ist ja ansich aber egal^^. Mit der Variable ist es etwas übersichtliche, und da er ja anscheinend keine KEnntnisse hat evtl. b esser.
03/07/2011 14:25 .iXream.#18
Quote:
jo ist auch ne möglichkeit, ist ja ansich aber egal^^. Mit der Variable ist es etwas übersichtliche, und da er ja anscheinend keine KEnntnisse hat evtl. b esser.
Stimmt aber nur bei der Regi weil ich css angepasst hab usw. nur fehlt nur noch php.Html hab ich fertig