You last visited: Today at 17:04
Advertisement
Homepage Problem
Discussion on Homepage Problem within the Metin2 Private Server forum part of the Metin2 category.
02/07/2013, 17:22
#1
elite*gold: 47
Join Date: Feb 2012
Posts: 2,282
Received Thanks: 2,579
Homepage Problem
Hallo liebe Community,
ich habe für meinen Server nun eine Homepage eingerichtet. Nun treten 2 Probleme auf:
1. Ich kann mich nicht einloggen (Daten stimmen; Die Verbindung zum Gameserver steht; Keine Fehlermeldung).
2. Bei der Registrierung wird kein Captcha angezeigt.
Die register und captcha.php:
Captcha.php
PHP Code:
<?PHP
session_name ( "m2hp" );
session_start ();
header ( "Content-Type: image/png" ); // Sets the Content of this file to an PNG-Image
$ttf = "./franconi.ttf" ; //Schriftart
$_SESSION [ "captcha_id" ] = "" ; // Clears the old value
$zufallszahl = mt_rand ( 50000 , 60000 ); // Generates a random number between 50000 and 60000
$_SESSION [ "captcha_id" ] = $zufallszahl ; // Sets the value of the session
$bild = imagecreatefromgif ( "bg.gif" ); // Creates a new image from background file
$weisser = imagecolorallocate ( $bild , 255 , 255 , 255 ); // Sets white text color
imagettftext ( $bild , 11 , 10 , 5 , 20 , $weisser , $ttf , $_SESSION [ "captcha_id" ]);
//imagestring($bild, 3, 8, 6, $_SESSION["captcha_id"], $weisser); // Prints the random number von the image
ImagePNG ( $bild ); // Output for the generated image
?>
register.php
PHP Code:
<div id="con-top">Registration</div>
<div id="con-mid">
<?PHP
$regCoins = 0 ; // Startcoins
$laufZeit = 365 ; //Tage autoloot,safebox
$calcLZ = ( 60 * 60 * 24 )* 365 ;
$expireStamp = time ()+ $calcLZ ;
$expireDate = date ( "Y-m-d H:i:s" , $expireStamp );
if( $serverSettings [ 'register_on' ] && (!isset( $_SESSION [ 'user_admin' ]))) {
if(isset( $_POST [ 'submit' ]) && $_POST [ 'submit' ]== "registrieren" ) {
if(( checkAnum ( $_POST [ 'account' ]) && strlen ( $_POST [ 'account' ])>= 8 && strlen ( $_POST [ 'account' ])<= 16 ) && checkAnum ( $_POST [ 'pass' ]) && strlen ( $_POST [ 'pass' ])>= 8 && strlen ( $_POST [ 'pass2' ])<= 16 && !empty( $_POST [ 'pass2' ]) && ( checkName ( $_POST [ 'uname' ]) && strlen ( $_POST [ 'uname' ])>= 3 && strlen ( $_POST [ 'uname' ])<= 20 ) && $_POST [ 'pass' ]== $_POST [ 'pass2' ] && checkMail ( $_POST [ 'email' ]) && strlen ( $_POST [ 'email' ])<= 40 && $_POST [ 'captcha' ]== $_SESSION [ 'captcha_id' ] && $_POST [ 'email' ]== $_POST [ 'email2' ] && ( checkAnum ( $_POST [ 'sicherheitsa' ]) && strlen ( $_POST [ 'sicherheitsa' ])>= 3 && strlen ( $_POST [ 'sicherheitsa' ])<= 16 ) && checkInt ( $_POST [ 'sicherheitsf' ]) && ( checkAnum ( $_POST [ 'loeschcode' ]) && strlen ( $_POST [ 'loeschcode' ])== 7 )) {
$hashSF = md5 ( $_POST [ 'sicherheitsa' ]);
$sfNum = mysql_real_escape_string ( $_POST [ 'sicherheitsf' ]);
$lcode = mysql_real_escape_string ( $_POST [ 'loeschcode' ]);
$zuFall = rand ( 99999 , 999999999 );
$userpass = mysql_real_escape_string ( $_POST [ 'pass' ]);
$aktivHash = ( $serverSettings [ 'mail_activation' ]) ? md5 ( $zuFall ): '' ;
$accountStatus = ( $serverSettings [ 'mail_activation' ]) ? 'BLOCK' : 'OK' ;
$sqlCmd = "INSERT INTO account.account
(login,password,real_name,email,social_id,question1,answer1,create_time,status,coins,autoloot_expire,safebox_expire,web_aktiviert)
VALUES
('" . $_POST [ 'account' ]. "',PASSWORD('" . $userpass . "'),'" . mysql_real_escape_string ( $_POST [ 'uname' ]). "','" . mysql_real_escape_string ( $_POST [ 'email' ]). "','" . $lcode . "','" . $sfNum . "','" . $hashSF . "','" . $sqlZeit . "','" . $accountStatus . "','" . $regCoins . "','" . $expireDate . "','" . $expireDate . "','" . $aktivHash . "')" ;
$sqlQry = mysql_query ( $sqlCmd , $sqlServ );
if( $sqlQry ) {
$absender = $serverSettings [ 'titel' ]. " Registration" ;
$email = $serverSettings [ 'reg_mail' ];
$empfaenger = $_POST [ 'email' ];
$mail_body = "Hallo " . $_POST [ 'uname' ]. ",
deine Registration auf " . $serverSettings [ 'titel' ]. " war erfolgreich! Um auch auf dem Server spielen zu können, musst du deinen Account aktivieren.
Das kannst du über den folgenden Link tun:
" . $serverSettings [ 'url' ]. "/index.php?s=login&do=aktivieren&hash=" . $aktivHash . "
Deine Daten sind:
Account: " . $_POST [ 'account' ]. "
Passwort: " . $userpass . "
Löschcode: " . $lcode . "
Sicherheitsfrage: " . $sFrage [ $sfNum ]. "
Antwort: " . $_POST [ 'sicherheitsa' ]. "
Viel Spaß beim Spielen,
Dein " . $serverSettings [ 'titel' ]. "-Team
Diese E-Mail wurde automatisch generiert. Bitte keine Antworten an diese Adresse schicken." ;
$titel = "Registrierung auf " . $serverSettings [ 'titel' ];
$header = "X-Priority: 3\n" ;
$header .= "X-Mailer: " . $serverSettings [ 'titel' ]. " Homepage Mailer\n" ;
$header .= "MIME-Version: 1.0\n" ;
$header .= "From: " . $absender . " <" . $serverSettings [ 'reg_mail' ]. ">\n" ;
$header .= "Reply-To: " . $serverSettings [ 'reg_mail' ]. "\n" ;
$header .= "Content-Type: text/plain; charset=iso-8859-1\n" ;
if( $serverSettings [ 'mail_activation' ]) {
mail ( $empfaenger , $titel , $mail_body , $header );
echo '<p class="meldung">Account erfolgreich angelegt. Bitte überprüfen Sie Ihr Postfach, um die Registrierung zu bestätigen.</p>' ;
}
else {
echo '<p class="meldung">Account erfolgreich angelegt. Sie können sich nun anmelden.</p>' ;
}
}
else {
echo '<p class="meldung">Registrierung fehlgeschlagen: Der Account existiert bereits.</p>' ;
}
}
else {
echo '<p class="meldung">Registrierung fehlgeschlagen: bitte alle Felder richtig angeben</p>' ;
}
}
?>
<p>Alle Felder sind Pflichtfelder und müssen ausgefüllt werden.<?PHP if( $serverSettings [ 'mail_activation' ]) { echo '<br/><b>Der Account wird per E-Mail aktiviert, also eine richtige E-Mail eingeben!</b>' ; } ?> </p>
<form action="index.php?s=register" method="POST">
<table>
<tr>
<th class="topLine">Account:</th>
<td class="tdunkel"><input type="text" name="account" maxlength="16" size="16"/> 8-16 Zeichen (nur a-Z,0-9)</td>
</tr>
<tr>
<th class="topLine">Name:</th>
<td class="thell"><input type="text" name="uname" maxlength="16" size="16"/> 3-20 Zeichen (nur a-Z,0-9)</td>
</tr>
<tr>
<th class="topLine">Password:</th>
<td class="tdunkel"><input type="password" name="pass" maxlength="16" size="16"/> 8-16 Zeichen (nur a-Z,0-9)</td>
</tr>
<tr>
<th class="topLine">Password wiederholen:</th>
<td class="thell"><input type="password" name="pass2" maxlength="16" size="16"/></td>
</tr>
<tr>
<th class="topLine">E-Mail:</th>
<td class="tdunkel"><input type="text" name="email" maxlength="50" size="25"/> max. 40 Zeichen</td>
</tr>
<tr>
<th class="topLine">E-Mail wiederholen:</th>
<td class="thell"><input type="text" name="email2" maxlength="50" size="25"/></td>
</tr>
<tr>
<th class="topLine">Löschcode:</th>
<td class="tdunkel"><input type="text" name="loeschcode" maxlength="7" size="7"/> 7 Zeichen (nur a-Z,0-9)</td>
</tr>
<tr>
<th class="topLine">Sicherheitsfrage:</th>
<td class="thell">
<select name="sicherheitsf">
<?PHP
foreach( $sFrage AS $fragew => $frage ) {
echo '<option value="' . $fragew . '">' . $frage . '</option>' ;
}
?>
</select>
<input type="text" name="sicherheitsa" maxlength="16" size="16"/> 3-16 Zeichen (nur a-Z,0-9)
</td>
</tr>
<tr>
<th class="topLine">Captcha:</th>
<td class="tdunkel"><img src="./captcha/captcha.php" title="Captcha"/> <input type="text" name="captcha" maxlength="5" size="5"/></td>
</tr>
<tr>
<th class="topLine" style="text-align:center;" colspan="2"><input type="submit" name="submit" value="registrieren"/> • <input type="reset" value="zurücksetzen"/></th>
</tr>
</table>
</form>
<?PHP
}
else {
echo '<p class="meldung">Die Registration ist deaktiviert oder Sie sind bereits angemeldet. Es kann kein weiterer Account erstellt werden.</p>' ;
}
?>
</div>
<div id="con-bot"></div>
Hoffe auf eure Hilfe!
MfG
02/07/2013, 17:32
#2
elite*gold: 2
Join Date: Mar 2011
Posts: 1,797
Received Thanks: 335
Kann man die Captcha.php nicht von einer anderen HP nemmen ?
02/07/2013, 17:50
#3
elite*gold: 2500
Join Date: Feb 2010
Posts: 692
Received Thanks: 63
Denke mal dass die Verlinkungen zur table falsch sind (war zumindestens bei mir so)
Zum captcha kann es sein franconi.ttf fehlt ?
02/07/2013, 18:05
#4
elite*gold: 0
Join Date: Jul 2012
Posts: 24,492
Received Thanks: 3,215
Die index.php wäre auch nicht schlecht
Die Login.php auch nicht..
Vielleicht hilft dir diese regiserclass und register.php
02/07/2013, 18:09
#5
elite*gold: 47
Join Date: Feb 2012
Posts: 2,282
Received Thanks: 2,579
franconi.ttf ist vorhanden und die Verlinkung stimmt auch.
Wenn ich mal direkt in das Captcha Verzeichnis und dann die captcha.php öffne (Browser), dann kommt das: "Die Grafik "http://...../captcha/captcha.php" konnte nicht angezeigt werden, weil sie Fehler enthält."
€dit:
Index.php
PHP Code:
<?PHP ERROR_REPORTING ( E_ALL ); if(! file_exists ( './inc/config.inc.php' )) { header ( 'Location: install.php' ); } session_name ( "m2hp" ); session_start (); require( "./inc/config.inc.php" ); require( "./inc/rights.inc.php" ); require( "./inc/functions.inc.php" ); $sqlHp = mysql_connect ( SQL_HP_HOST , SQL_HP_USER , SQL_HP_PASS ); $sqlServ = mysql_connect ( SQL_HOST , SQL_USER , SQL_PASS ); if(! is_resource ( $sqlServ ) OR ! is_resource ( $sqlHp )) { exit( "Verbindung zur Datenbank fehlgeschlagen: Abbruch" ); } require( "./inc/head.inc.php" ); ?> <!DOCTYPE html> <html> <head> <title><?PHP echo $serverSettings [ 'titel_page' ]; ?> </title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="style.css" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" src="custom.js"></script> <script type="text/javascript" src="slider.jquery.js"></script> </head> <body> <div style="margin-top:-10px;"> <div id="navi"> <ul> <li><a href="./">Startseite</a></li> <?PHP if(isset( $_SESSION [ 'user_admin' ]) && checkInt ( $_SESSION [ 'user_admin' ]) && $_SESSION [ 'user_admin' ]>= 0 ) { echo '<li><a href="?s=itemshop">Itemshop</a></li>' ; echo '<li><a href="?s=spenden">Spenden</a></li>' ; } else { echo '<li><a href="?s=register">Registration</a></li>' ; echo '<li><a href="?s=login">Userpanel</a></li>' ; } ?> <li><a href="?s=ranking_chars">Rangliste</a></li> <li><a href="?s=downloads">Download</a></li> <li><a href="./forum">Forum</a></li> </ul> </div> </div> <div id="header"><div id="logo"><a href="./"></a></div></div> <div id="container"> <div id="sb_l"> <div class="sb-top">Login</div> <div class="sb-mid"> <?php require( 'inc/loginbar.inc.php' ); ?> </div> <div class="sb-bot"></div> <br> <a href="./forum"><div id="comm"></div></a> </br> <a href="?s=vote"><div id="vote"></div></a> </br> <div class="sb-top">Trailer</div> <div class="sb-mid"> <div style="margin-left:-10px;"><iframe width="230" height="200" src="http://www.youtube.com/embed/aHjpOzsQ9YI" frameborder="0" allowfullscreen></iframe></div> </div> <div class="sb-bot"></div> </div> <div id="sb_r"> <a href="?s=downloads"><div id="dl"></div></a> </br> <div class="sb-top2">Rangliste</div> <div class="sb-mid2"> <?php require( 'inc/top.php' ); ?> </div> <div class="sb-bot2"></div> <br/> <div class="sb-top2">Serverstatus</div> <div class="sb-mid2"> <?php require( 'inc/status.inc.php' ); ?> </div> <div class="sb-bot2"></div> <br/> <div class="sb-top2">Werbung</div> <div class="sb-mid2"> <?php require( 'inc/werbung.inc.php' ); ?> </div> <div class="sb-bot2"></div> </div> <div id="content"> <div id="slider-bg"> <span id="prevBtn"><a href="javascript :void(0);"></a></span> <span id="nextBtn"><a href="javascript :void(0);"></a></span> <div id="slider"> <ul> <li><img src="img/slide_1.png"></li> <li><img src="img/slide_1.png"></li> <li><img src="img/slide_1.png"></li> <li><img src="img/slide_1.png"></li> </ul> </div> </div> <br/> <?php $includeDir = "." . DIRECTORY_SEPARATOR . "pages" . DIRECTORY_SEPARATOR ; $includeDefault = $includeDir . "home.php" ; if(isset( $_GET [ 's' ]) && !empty( $_GET [ 's' ])) { $_GET [ 's' ] = str_replace ( "\0" , '' , $_GET [ 's' ]); $includeFile = basename ( realpath ( $includeDir . $_GET [ 's' ]. ".php" )); $includePath = $includeDir . $includeFile ; if(!empty( $includeFile ) && file_exists ( $includePath )) { include( $includePath ); } else { include( $includeDefault ); } } else { include( $includeDefault ); } ?> </div> <div class="clear"></div> </div> <br/> <div id="bg_footer"> <div id="footer"> Copyright ©2012 <a href="#"><u><?php echo $serverSettings [ 'titel' ]; ?> </u></a>. All Rights Reserved. Design & Script by <a href="http://www.elitepvpers.com/forum/metin2-trading/1913887-service-ca-designs-hot.html" target="_blank"><u>CA-Design</u></a>. </div> </div> </body> </html><?PHP mysql_close (); ?>
Login.php
PHP Code:
<div id="con-top">UserCP</div> <div id="con-mid"><?PHP if(isset( $_GET [ 'do' ]) && $_GET [ 'do' ]== "aktivieren" && isset( $_GET [ 'hash' ]) && !empty( $_GET [ 'hash' ])) { if( strlen ( $_GET [ 'hash' ])== 32 && $_GET [ 'hash' ]!= 1 && checkAnum ( $_GET [ 'hash' ])) { $cmdHash = "SELECT id,web_aktiviert FROM account.account WHERE web_aktiviert='" . $_GET [ 'hash' ]. "' AND web_aktiviert!='1' LIMIT 1;" ; $qryHash = mysql_query ( $cmdHash , $sqlServ ); if( mysql_num_rows ( $qryHash )) { $getData = mysql_fetch_object ( $qryHash ); $userUpdate = "UPDATE account.account SET web_aktiviert='1',status='OK' WHERE id='" . $getData -> id . "' LIMIT 1;" ; $updateQry = mysql_query ( $userUpdate , $sqlServ ); if( $updateQry ) { echo '<p class="meldung">Ihr Account wurde erfolgreich aktiviert. Sie können sich nun einloggen.</p>' ; echo '<meta http-equiv="refresh" content="1; URL=index.php?s=login"> ' ; } else { echo '<p class="meldung">Query fehlgeschlagen. Bitte einen Admin kontaktieren!</p>' ; } } else { echo '<p class="meldung">Es wurde kein passender Eintrag gefunden. Aktivierung fehlgeschlagen.</p>' ; } } else { echo '<p class="meldung">Kein valider Hash!</p>' ; } } if(!empty( $_SESSION [ 'user_id' ])) { $cmdStats = "SELECT SUM( player.playtime ) AS ges_spielzeit, COUNT( * ) AS ges_chars, player_index.empire FROM player.player INNER JOIN player.player_index ON player_index.id = player.account_id WHERE player.account_id = '" . $_SESSION [ 'user_id' ]. "' LIMIT 1" ; $qryStats = mysql_query ( $cmdStats , $sqlServ ); $getStats = mysql_fetch_object ( $qryStats ); if(!empty( $getStats -> empire )) { $reich = '<img src="img/reiche/' . $getStats -> empire . '.png" title="Reich" alt="Reich"/>' ; } else { $reich = 'kein Reich ausgewählt' ; } echo '<table> <tr> <th class="topLine">Account:</th> <td class="tdunkel">' . $_SESSION [ 'user_name' ]. '</td> </tr> <tr> <th class="topLine">Reich:</th> <td class="thell">' . $reich . '</td> </tr> <tr> <th class="topLine">Charaktere:</th> <td class="tdunkel">' . $getStats -> ges_chars . '</td> </tr> <tr> <th class="topLine">Gesamte Spielzeit:</th> <td class="thell">' . $getStats -> ges_spielzeit . ' Minuten</td> </tr>' ; $sqlAcc = "SELECT account.social_id AS loeschcode, safebox.password AS lagerpw FROM account.account LEFT JOIN player.safebox ON account.id=safebox.account_id WHERE account.id='" . $_SESSION [ 'user_id' ]. "'" ; $qryAcc = mysql_query ( $sqlAcc ) or die( mysql_error ()); $getAcc = mysql_fetch_object ( $qryAcc ); if(empty( $getAcc -> lagerpw )) $getAcc -> lagerpw = '000000' ; echo '<tr> <th class="topLine">Löschcode:</th> <td class="tdunkel">' . $getAcc -> loeschcode . '</td> </tr> </table>' ; } else { ?> <h2>Login</h2> <form action="index.php?s=login" method="POST"> <table> <tr> <th class="topLine">User ID:</th> <td class="tdunkel"><input type="text" name="userid" maxlength="16" size="20"/></td> </tr> <tr> <th class="topLine">Passwort:</th> <td class="thell"><input type="password" name="userpass" maxlength="16" size="20"/></td> </tr> <tr> <td class="topLine" style="text-align:center;" colspan="2"><input type="submit" name="submit" value="Login"/></td> </tr> </table> <p><a href="index.php?s=register">Registrierung</a> • <a href="index.php?s=lostpw">Passwort vergessen</a></p> </form> <?PHP } ?> </div> <div id="con-bot"></div>
02/07/2013, 18:10
#6
elite*gold: 0
Join Date: Jul 2012
Posts: 24,492
Received Thanks: 3,215
Poste mal die login.php & Welches Script benutzt du?
02/07/2013, 18:27
#7
elite*gold: 47
Join Date: Feb 2012
Posts: 2,282
Received Thanks: 2,579
Ich benutze das Script von !hen mit dieser Homepage:
Also ich denke es ist das von !hen...
MfG
02/07/2013, 18:32
#8
elite*gold: 0
Join Date: Jul 2012
Posts: 24,492
Received Thanks: 3,215
Wenn ich dir bzw. wir dir helfen sollen, dann poste doch bitte die login.php
02/07/2013, 18:49
#9
elite*gold: 550
Join Date: Oct 2009
Posts: 269
Received Thanks: 98
Bei FreeBSD cd /usr/ports/www/apache22/php5-extensions
muss GDLib installiert sein, sonst tut kein einziges Captcha Script.
Ausserdem vermute ich, dass du Session nicht mit installiert hast, was fürs einloggen notwendig ist.
Ansonsten schau, ob du Cookies aktiviert hast.
Hab dir mal ne kleine Grafik von mein Root hinterlassen.
Attached Images
epvp.jpg
(19.2 KB, 19 views)
02/07/2013, 19:32
#10
elite*gold: 47
Join Date: Feb 2012
Posts: 2,282
Received Thanks: 2,579
Sullivan habe die Login an meinen letzten Post draneditiert. Ems Bahn danke werde morgen ml dchauen
02/07/2013, 19:42
#11
elite*gold: 0
Join Date: Jul 2012
Posts: 24,492
Received Thanks: 3,215
Also an der login.php ist meiner Meinung nach nichts falsches, muss also wie gesagt am Problem liegen welches EmsBahm gepostet hat.
Similar Threads
Homepage Problem
12/20/2012 - Metin2 Private Server - 8 Replies
Hey, ich bräuchte 5 Minuten Hilfe für meine Homepage.
Bei mir kommt immer dieser Fehler:
Warning: mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /var/customers/webs/ni118732_3/homepage/index.php on line 15 Warning: mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /var/customers/webs/ni118732_3/homepage/index.php on line 16 Verbindung zur Datenbank fehlgeschlagen:...
[Problem] Homepage...
08/13/2012 - Metin2 PServer Guides & Strategies - 12 Replies
Habe ein Problem mit der Homepage.. ( xampp wäre schön wenn mir jemand helfen könnte ... ) also ich habe das problem dass ich dieses design nicht mehr wollte somit habe ich das einfach alles gelöscht und dann eine andere rein getahn aber diese korrekt installiert doch die alte homepage ist immer noch da :( Directupload.net - cicikgqd.png aber wenn ich nich über hamachi ip sondern über h tt p://127.0.0.1/ kommt das richtige design was tuhen :?
bitte um schnelle hilfe
ps: Die...
Homepage problem
01/05/2012 - Flyff Private Server - 3 Replies
Hey Leute habe mal ne Frage.
Undzwar hatte ich ne releaste hp eingerichtet und jz kommt nach dem registrieren und bei der zeitanzeige auf der hp folgender error:
It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST'...
Homepage Problem!
11/22/2011 - Metin2 Private Server - 4 Replies
Ich habe Folgendes Problem:
http://img202.imageshack.us/img202/2549/34287500. png
Kann mir mal einer helfen
Homepage Problem
06/08/2010 - Metin2 Private Server - 0 Replies
Hallo Community also hab gesten noch
meine Hp bearbeitet und als ich heute in meine http:5.... rein ging kommt immer das:mad:
http://img203.imageshack.us/img203/3446/unbenannt ity.jpg
All times are GMT +2. The time now is 17:05 .