|
|
Latest News |
Latest Threads |
|
|
55.296 Posts & 4.945 Themen in 78 Foren |
|
|
|
|
Forensuche |
|
Suchbegriff |
Benutzerauswahl |
Ergebnisse anzeigen |
|
|
Regestierungsseite 9 Beiträge in diesem Thema |
|
|
|
|
|
|
|
|
27.08.2012 - 13:08 Uhr |
|
|
|
Hi,
neues Problem gefunden.
Ich möchte ein Script in meine Webseite einbinden.
Es ist eine Account Page, wo man sich Regestieren kann z.b. für ein Spiel oder Co. um ein Account zu Erstellen (Name, Passwort, Version)
Das Problem ist jetzt, es Funktioniert nicht im Verzeichnis von phpkit.
Wenn ich die Seite (http://localhost/include.php?path=sites/acc.php ) wird mir alles angezeigt, style passt auch, nur wenn ich mein Name und Passwort eingebe, funktioniert es nicht. Es werden keine Daten an die Externe MySql geschickt. MySql Funktioniert ebenso, siehe Beispiel 2
Beispiel 2:
Sollte ich die Webseite ohne phpkit aufrufen (http://localhost/include.php?path=sites/acc.php) funktioniert die Account Erstellen seite Natürlich.
In der Datenbank werden die Daten Übernommen. Nur bei Beispiel 1 ist kein Eintrag vorhanden.
Das Script und eine DB Tabelle ist im Anhang hinzugefügt.
-------------------------
Frage 2:
Gibt es für phpkit 1.6.1 noch die Möglichkeit oder ein AddOn, für die User und Member, Moderatoren, Administratoren die Farbig zu machen. Das Nicknamen Farbig sind in der Navigation und im Forum ??
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von inspireDe - 27.08.2012 - 13:38 Uhr |
|
|
|
|
|
|
|
|
|
|
27.08.2012 - 16:35 Uhr |
|
|
|
Öffne die Datei acc.php und ändere es so ab:
---
Öffne die Datei function.php und ändere es so ab:
Hier klicken zum aufklappen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | | PHP-Quelltext
<?php
ini_set('display_errors', 'Off');
function Error($Error)
{
echo "<br /><br /><br /><br /><br /><br /><center><b><span style='color:#CD0000;'> " . $Error . "</span></b></center>";
}
function ConnectMysql()
{
include("configs.php");
$link=mysql_connect("" . $mysql_host . "","" . $mysql_user . "","" . $mysql_pass . "");
if(!$link) {
echo "Cannot connect to database!";
}else{
mysql_select_db("". $mysql_db . "",$link);
}
}
function register()
{
include('configs.php');
global $phpkit_path;
if($core == 1) {
if(isset($_POST['flags'])) {
if($_POST['flags'] == "24") {
$flags = "2";
}elseif($_POST['flags'] == "32") {
$flags = "3";
}
}else{ echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please select an expansion.";</script>'; exit(); }
ConnectMysql();
$user_chars = "#[^a-zA-Z0-9_\-]#";
if ((empty($_POST["user"]))||(empty($_POST["password"])) ) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=You did not enter all the required information.";</script>';
} else {
$username = strtoupper($_POST["user"]);
$password = strtoupper($_POST["password"]);
if (strlen($username) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Username is too short.";</script>';
exit();
};
if (strlen($username) > 30) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Username is too long.";</script>';
exit();
};
if (strlen($password) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Password is too short.";</script>';
exit();
};
if (strlen($password) > 30) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Password is too long.";</script>';
exit();
};
if (preg_match($user_chars,$username)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please only use A-Z and 0-9.";</script>';
exit();
};
if (preg_match($user_chars,$password)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please only use A-Z and 0-9.";</script>';
exit();
};
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$qry = mysql_query("SELECT username FROM ".$mysql_dbname." WHERE username = '" . $username . "'");
if (!$qry) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Error querying database.";</script>';
exit();
};
if ($existing_username = mysql_fetch_assoc($qry)) {
foreach ($existing_username as $key => $value) {
$existing_username = $value;
};
};
$existing_username = strtoupper($existing_username);
if ($existing_username == strtoupper($_POST['user'])) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Chosen username is already taken!";</script>';
exit();
};
unset($qry);
$sha_pass_hash = sha1(strtoupper($username) . ":" . strtoupper($password));
$register_sql = "INSERT INTO ".$mysql_dbname." (username, sha_pass_hash, expansion) VALUES ('" . $username . "','" . $sha_pass_hash . "','" . $flags . "')";
$qry = mysql_query($register_sql);
if (!$qry) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Error creating account.";</script>';
exit();
};
echo '<br /><br /><br /><br /><br /><br /><center><span style="color:#41d600;">Your Account was successfully created!<br /></span></center>';
};
}elseif($core == 2) {
if(isset($_POST['flags'])) { $flags = "" . $_POST['flags'] . ""; }else{ echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please select an expansion.";</script>'; exit(); }
ConnectMysql();
$user_chars = "#[^a-zA-Z0-9_\-]#";
if ((empty($_POST["user"]))||(empty($_POST["password"])) ) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=You did not enter all the required information.";</script>';
} else {
$username = strtoupper($_POST["user"]);
$password = strtoupper($_POST["password"]);
if (strlen($username) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Username is too short.";</script>';
exit();
};
if (strlen($username) > 30) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Username is too long.";</script>';
exit();
};
if (strlen($password) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Password is too short.";</script>';
exit();
};
if (strlen($password) > 30) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Password is too long.";</script>';
exit();
};
if (preg_match($user_chars,$username)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please only use A-Z and 0-9.";</script>';
exit();
};
if (preg_match($user_chars,$password)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please only use A-Z and 0-9.";</script>';
exit();
};
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$qry = mysql_query("SELECT login FROM ".$mysql_dbname." WHERE login = '" . $username . "'");
if (!$qry) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Error querying database.";</script>';
exit();
};
if ($existing_username = mysql_fetch_assoc($qry)) {
foreach ($existing_username as $key => $value) {
$existing_username = $value;
};
};
$existing_username = strtoupper($existing_username);
if ($existing_username == strtoupper($_POST['user'])) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Chosen username has already been taken.";</script>';
exit();
};
unset($qry);
$register_sql = "INSERT INTO ".$mysql_dbname." (login, password, flags) VALUES ('" . $username . "','" . $password . "','" . $flags . "')";
$qry = mysql_query($register_sql);
if (!$qry) {
echo '<script type="text/javascript">window.location = "acc.php?error=Error creating account.";</script>';
exit();
};
echo '<br /><br /><br /><br /><br /><br /><center><span style="color:#00FFFF;">Congrats, Your account was successfully created!<br /></span></center>';
};
}
}
?> | | |
---
Öffne die Datei configs.php und suche das:
| PHP-Quelltext $core = "1"; // 1 | |
Und füge darunter das ein:
| PHP-Quelltext $mysql_dbname ='account'; | |
---
Bei mir geht es ohne Probleme. Keine Ahnung wer das gemacht hat, aber dieser hat vergessen die Tabellen-Namen (Alt: de_account1 bzw. de_account1s) mit dem gleichzusetzen, was in der .sql drin steht (nämlich: account).
Logisch, das keine Einträge gemacht werden können.
Desweiteren wurden die Fehlermeldungen auf eine index.php-Datei geleitet (so hies die Datei acc.php wohl vorher). Es hätte also immer eine Meldung des Browsers kommen müssen, das die Datei index.php nicht existiert.
---
Zu dem mit den User-Namen farbig.
Es gab glaub ich mal ein Addon, das dies bewerkstelligte. Allerdings sind die meisten Seiten offline und somit kein Download möglich
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von k!r!ka - 27.08.2012 - 16:37 Uhr |
|
|
|
|
|
|
|
|
|
|
27.08.2012 - 17:14 Uhr |
|
|
|
War würde ich nur ohne dich machen, glaube ganz viel verzweifeln und meinen Kopf gegen die Wand Stupsen.
Jetzt hab ich noch eine Frage, kann man das Script evtl auch so erweitern. Das z.b. der Webseiten Nickname Unterdrückt wird und eingefügt wird in den Nicknamen Feld?
Also das man den Nicknamen auf der Webseite, automatisch gleich für die Regestierung hat? Und ob man noch die E-Mail Adresse von der Webseite Automatisch auch eingeblendet bekommt?
Weil ich würde gerne das so machen oder das es Funktioniert das der Webseiten Account bzw. Nickname ebenso auf der Account Tabelle übertragen wird. Und die E-Mail noch Hinzufügt. Beideshalt unterdrückbar das man die net ändern kann und Automatisch eingefügt sind.
Ich hoffe das ist dir nicht zuviel arbeit
|
|
|
|
|
|
|
|
|
|
27.08.2012 - 18:09 Uhr |
|
|
|
Versuch es mal damit:
acc.php
---
function.php
Hier klicken zum aufklappen 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | | PHP-Quelltext <b><?php
ini_set('display_errors', 'Off');
function Error($Error)
{
echo "<br /><br /><br /><br /><br /><br /><center><b><span style='color:#CD0000;'> " . $Error . "</span></b></center>";
}
function ConnectMysql()
{
include("configs.php");
$link=mysql_connect("" . $mysql_host . "","" . $mysql_user . "","" . $mysql_pass . "");
if(!$link) {
echo "Cannot connect to database!";
}else{
mysql_select_db("". $mysql_db . "",$link);
}
}
function register()
{
include('configs.php');
global $phpkit_path;
if($core == 1) {
if(isset($_POST['flags'])) {
if($_POST['flags'] == "24") {
$flags = "2";
}elseif($_POST['flags'] == "32") {
$flags = "3";
}
}else{ echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please select an expansion.";</script>'; exit(); }
ConnectMysql();
$user_chars = "#[^a-zA-Z0-9_\-\!]#";
if ((empty($_POST["user"]))||(empty($_POST["email"]))||(empty($_POST["password"])) ) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=You did not enter all the required information.";</script>';
} else {
$username = strtoupper($_POST["user"]);
$email = strtoupper($_POST["email"]);
$password = strtoupper($_POST["password"]);
if (strlen($username) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Username is too short.";</script>';
exit();
};
if (strlen($username) > 30) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Username is too long.";</script>';
exit();
};
if (strlen($email) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=e-Mail is too short.";</script>';
exit();
};
if (strlen($password) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Password is too short.";</script>';
exit();
};
if (strlen($password) > 30) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Password is too long.";</script>';
exit();
};
if (preg_match($user_chars,$username)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please only use A-Z and 0-9.";</script>';
exit();
};
if (preg_match($user_chars,$password)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please only use A-Z and 0-9.";</script>';
exit();
};
if (!emailcheck($email)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=input is not a regular e-Mail";</script>';
exit();
};
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$email = mysql_real_escape_string($email);
$qry = mysql_query("SELECT username FROM ".$mysql_dbname." WHERE username = '" . $username . "'");
if (!$qry) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Error querying database.";</script>';
exit();
};
if ($existing_username = mysql_fetch_assoc($qry)) {
foreach ($existing_username as $key => $value) {
$existing_username = $value;
};
};
$existing_username = strtoupper($existing_username);
if ($existing_username == strtoupper($_POST['user'])) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Chosen username is already taken!";</script>';
exit();
};
unset($qry);
$sha_pass_hash = sha1(strtoupper($username) . ":" . strtoupper($password));
$register_sql = "INSERT INTO ".$mysql_dbname." (username, sha_pass_hash, expansion, email) VALUES ('" . $username . "','" . $sha_pass_hash . "','" . $flags . "','".$email."')";
$qry = mysql_query($register_sql);
if (!$qry) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Error creating account.";</script>';
exit();
};
echo '<br /><br /><br /><br /><br /><br /><center><span style="color:#41d600;">Your Account was successfully created!<br /></span></center>';
};
}elseif($core == 2) {
if(isset($_POST['flags'])) { $flags = "" . $_POST['flags'] . ""; }else{ echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please select an expansion.";</script>'; exit(); }
ConnectMysql();
$user_chars = "#[^a-zA-Z0-9_\-\!]#";
if ((empty($_POST["user"]))||(empty($_POST["email"]))||(empty($_POST["password"])) ) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=You did not enter all the required information.";</script>';
} else {
$username = strtoupper($_POST["user"]);
$email = strtoupper($_POST["email"]);
$password = strtoupper($_POST["password"]);
if (strlen($username) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Username is too short.";</script>';
exit();
};
if (strlen($username) > 30) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Username is too long.";</script>';
exit();
};
if (strlen($email) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=e-Mail is too short.";</script>';
exit();
};
if (strlen($password) < 3) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Password is too short.";</script>';
exit();
};
if (strlen($password) > 30) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Password is too long.";</script>';
exit();
};
if (preg_match($user_chars,$username)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please only use A-Z and 0-9.";</script>';
exit();
};
if (preg_match($user_chars,$password)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Please only use A-Z and 0-9.";</script>';
exit();
};
if (!emailcheck($email)) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=input is not a regular e-Mail";</script>';
exit();
};
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$email = mysql_real_escape_string($email);
$qry = mysql_query("SELECT login FROM ".$mysql_dbname." WHERE login = '" . $username . "'");
if (!$qry) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Error querying database.";</script>';
exit();
};
if ($existing_username = mysql_fetch_assoc($qry)) {
foreach ($existing_username as $key => $value) {
$existing_username = $value;
};
};
$existing_username = strtoupper($existing_username);
if ($existing_username == strtoupper($_POST['user'])) {
echo '<script type="text/javascript">window.location = "'.$phpkit_path.'error=Chosen username has already been taken.";</script>';
exit();
};
unset($qry);
$register_sql = "INSERT INTO ".$mysql_dbname." (login, password, flags, email) VALUES ('" . $username . "','" . $password . "','" . $flags . "','".$email."')";
$qry = mysql_query($register_sql);
if (!$qry) {
echo '<script type="text/javascript">window.location = "acc.php?error=Error creating account.";</script>';
exit();
};
echo '<br /><br /><br /><br /><br /><br /><center><span style="color:#00FFFF;">Congrats, Your account was successfully created!<br /></span></center>';
};
}
}
?> </b> | | |
Funktioniert zumindest bei mir.
---
---
//edit
Ach ja, was die Sache mit den Userfarben angeht:
Öffne das Template templates/member_showprofil_textlink.htm und ändere es so um:
| PHP-Quelltext <a class="$userinfo[user_status]" href="include.php?path=login/userinfo.php&id=$userinfo[user_id]">$userinfo[user_nick]</a> | |
Öffne das Template templates/member_showprofil_textlink.small.htm und ändere es so um:
| PHP-Quelltext <a class="small $userinfo[user_status]" href="include.php?path=login/userinfo.php&id=$userinfo[user_id]">$userinfo[user_nick]</a> | |
Jetzt gehst du in dein AdminCenter. Dort gehst du hier hin: Sonstiges > Styles > das aktive Style auswählen (ist dick gedruckt)
Es erscheint der Einstellungsbereich für oben ausgewählte Style. Hier gibt es ganz oben ein großes Eingabefeld. Dort packst du folgenden Code ein:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | | PHP-Quelltext .user,
a.user
{
color: #ff0000; /* rot */
}
.member,
a.member
{
color: #ffffff; /* weiss */
}
.mod,
a.mod
{
color: #000000; /* schwarz */
}
.admin,
a.admin
{
color: #ff00ff; /* pink ;p */
} | |
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von k!r!ka - 27.08.2012 - 18:39 Uhr |
|
|
|
|
|
|
|
|
|
|
27.08.2012 - 19:08 Uhr |
|
|
|
Supi, klappt.
Noch kleine Frage wie mach ich das E-Mail Feld etwas kleiner von der breite, weil des zieht die Webseite so auseinander.
|
|
|
|
|
|
|
|
|
|
27.08.2012 - 19:44 Uhr |
|
|
|
Suppiiii, ... klappt wunderbar.
Jetzt muss mir nurnoch einfallen, bzw. für ne seite wo man das Passwort ändern kann
|
|
|
|
|
|
|
|
|
|
28.08.2012 - 14:34 Uhr |
|
|
|
Ich nochmal
Hab da leider noch ein kleines Anliegen, gibt es die Möglichkeit in diesen Script es einzufügen, das nur Members sich einen Account Erstellen können?
Ich weis das über das Admin Menü die Möglichkeit gibt, aber es gibt ja auch leute die phpkit kennen, und es wissen wie man es austrixen kann.
|
|
|
|
|
|
|
|
|
|
|
Ähnliche Themen |
|
Es wurden keine ähnlichen Themen gefunden.
|
|
|
|
|
|
|
|
|
|