Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 16:45

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[PHP] Session Fehler bei Login Script

Discussion on [PHP] Session Fehler bei Login Script within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2009
Posts: 502
Received Thanks: 111
[PHP] Session Fehler bei Login Script

So ich hab mir mal ein kleines Login Script erstellt(teilweile online toturial teilweilse hilfe von kumpel) so nur will das mit den session nicht so ganz hinhauen.

die login.php
PHP Code:
<?php
session_start 
();
$Username=$_POST["Username"];
$Password=$_POST["Password"];
$Connect=mysql_connect ("localhost""root""");
mysql_select_db("account");
$Query="SELECT * FROM account WHERE login='$Username' and password=password('$Password')";
mysql_query("set names big5");
mysql_query("set CHARACTER big5");
$Result=mysql_query($Query) or die(mysql_error()); 
while(
$row=mysql_fetch_array($Result)) 
$data mysql_fetch_array ($result);
$_SESSION["Username"] = $data["Username"]; 
$_SESSION["Password"] = $data["Password"];  

  
header ("Location: accountverwaltung.html"); 

else 

  
header ("Location: accountverwaltung.htmlfehler=1"); 

?>
checkuser.php
PHP Code:
<?php 
session_start 
(); 
if (!isset (
$_SESSION["Username"])) 
if (!isset (
$_SESSION["Password"])) 

  
header ("Location: login.html"); 

?>
accountverwaltung.html
PHP Code:
<?php 
include ("checkuser.php"); 
?>  

Erfolg
login.html
PHP Code:
<?php session_start (); ?>
<html> 
<head> 
  <title>Login</title> 
</head> 

<body> 
<?php 
if (isset ($_REQUEST["fehler"])) 

  echo 
"Die Zugangsdaten waren ungültig."

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<body>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<link rel="stylesheet" href="style/style.css" type="text/css" media="all" />
<title>PerfektMetin2 | German PServer</title>
<meta name="author" content="Tobias">
<meta name="editor" content="html-editor phase 5">
</head>
</body>
</html>
<body bgcolor="#FFFFFF">
</body>
<div id="header1">
<img src="style/images/Bannerweb.jpg" alt="" border="0" width="100%" height="100">
</div>


<div id="mbox">
 <tr>
               <META content="MSHTML 6.00.6000.16788" name=GENERATOR></HEAD>
<BODY>
<TABLE width="586" border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
</TR></TBODY></TABLE>
<TABLE width="586" height=250 border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD vAlign=top align=left>
      <TABLE cellSpacing=0 cellPadding=0 width="96%" align=center border=0>
        <TBODY>
        <TR>
          <TD height=30><table width="560" border="0" align="center" cellpadding="1" cellspacing="2" class="news">
            <form  id="form2" name="form2" method="post" action="login.php" onSubmit="return CheckValid(this)">
              <tr>
                <td height="23" colspan="2"><b><font color="#FF0000">Login</font></b>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="" height="1">
                      <tr>
                        <td></td>
                      </tr>
                  </table></td>
              </tr>
              <tr> </tr>
              <tr>
                <td width="110"><div align="right">User ID</div></td>
                <td width="370" align="left"><input name="UserID" type="text" id="Username" size="16" maxlength="16" value="" class="inputbox2" onFocus="change(1)"><br>

                  </fon></td>
              </tr>
              <tr>
                <td width="110"><div align="right">Password:</div></td>
                <td width="370" align="left"><input name="Password" type="password" id="Password" size="16" maxlength="16"  class="inputbox2" onFocus="change(2)">
       </td>
              </tr>
                              <td width="110"><b>
                  <input type="hidden" name="act" value="send">
                  &nbsp;</b></td>
                <td width="370" align="left"><b>
                  <input type="image" border="0" name="imageField" src="http://www.elitepvpers.com/forum/images/submitbutton.gif" >
                </b></td>
              </tr>
            </form>
          </table></TD>
        </TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</BODY></HTML>

</div>

<div id="mleiste">
<a href="index1.html"><img src="style/images/Home.jpg" width="160" height="34" border="0"alt="Home"></a>
<a href="register.html"><img src="style/images/reg.jpg" width="160" height="34" border="0"alt="Registriern"></a>
<a href="login.html"><img src="style/images/login.jpg" width="160" height="34" border="0"alt="Login"></a>
<a href="down.html"><img src="style/images/down.jpg" width="160" height="34" border="0"alt="Download"></a>
<a href="Itemshop.html"><img src="style/images/IS.jpg" width="160" height="34" border="0"alt="Itemshop"></a>
<a href="/Forum"><img src="style/images/forum.jpg" width="160" height="34" border="0"alt="Forum"></a>
</div>

€dit:Sorry gerade aufgefallen das das eig falsches forum ist bitte verschieben (hatte ja eig richtiges forum gewählt !?)
SecretDead is offline  
Old 08/29/2009, 15:03   #2
 
elite*gold: 0
Join Date: Dec 2008
Posts: 367
Received Thanks: 217
Was kommt denn für ein Fehler?
.MrBurns is offline  
Old 08/29/2009, 15:35   #3
 
elite*gold: 115
Join Date: Oct 2007
Posts: 9,390
Received Thanks: 12,345
Quote:
Originally Posted by SecretDead View Post
PHP Code:
$_SESSION["Username"] = $data["Username"]; 
$_SESSION["Password"] = $data["Password"];  

  
header ("Location: accountverwaltung.html"); 

else 

  
header ("Location: accountverwaltung.htmlfehler=1"); 

?> 
Irgendwie fehlt da was. :O
ms​ is offline  
Old 08/29/2009, 15:53   #4
 
elite*gold: 0
Join Date: Mar 2009
Posts: 502
Received Thanks: 111
Quote:
Originally Posted by Disconnect View Post
Irgendwie fehlt da was. :O
und was fehlt o.O?sorry wie schon gesagt bin darin völliger noob xD
SecretDead is offline  
Old 08/29/2009, 16:08   #5
 
elite*gold: 115
Join Date: Oct 2007
Posts: 9,390
Received Thanks: 12,345
Na das if-Statement.
ms​ is offline  
Old 08/29/2009, 23:35   #6
 
elite*gold: 0
Join Date: Mar 2009
Posts: 502
Received Thanks: 111
Quote:
Originally Posted by Disconnect View Post
Na das if-Statement.
sorry könntest mir ma zeigen wie das meinst?xD wie schon gesagt kaum ne ahnung davon
SecretDead is offline  
Old 08/31/2009, 04:16   #7
 
elite*gold: 0
Join Date: Sep 2006
Posts: 248
Received Thanks: 110


...
backo is offline  
Old 08/31/2009, 05:25   #8
 
elite*gold: 0
Join Date: Jan 2008
Posts: 3,026
Received Thanks: 4,504
PHP Code:
if ($_SESSION["Username"] = $data["Username"])
{
   if (
$_SESSION["Password"] = $data["Password"])
   {
      
header ("Location: accountverwaltung.html"); 
    }
else
    {
       
header ("Location: accountverwaltung.htmlfehler=1");   
     } 
  }
else 

  
header ("Location: accountverwaltung.htmlfehler=1"); 

?> 

weiß grade netmehr wie das mit 2 sachen gign xD
Daunenjacke is offline  
Old 08/31/2009, 11:36   #9
 
elite*gold: 0
Join Date: Mar 2009
Posts: 502
Received Thanks: 111
danke aber ich hat ncoh eine datei vergessen nähmlich die login.html
SecretDead is offline  
Old 09/01/2009, 10:40   #10
 
elite*gold: 0
Join Date: Mar 2009
Posts: 502
Received Thanks: 111
*push*
SecretDead is offline  
Old 09/01/2009, 12:36   #11
 
elite*gold: 0
Join Date: Jan 2008
Posts: 3,026
Received Thanks: 4,504
[warum machst du eigtl session o.o mach doch cookies]


...der fehler wurde gepotet...die loggin sollte damit eigtl nix zu tun haben
Daunenjacke is offline  
Old 09/01/2009, 13:37   #12
 
elite*gold: 0
Join Date: Dec 2008
Posts: 367
Received Thanks: 217
warum pushst du?^^
.MrBurns is offline  
Old 09/01/2009, 13:49   #13
 
elite*gold: 0
Join Date: Mar 2009
Posts: 502
Received Thanks: 111
weil keiner mehr geantwortet hat und ich leider noch noob in sowas bin und ich am besten lern wenn mir mal einer meinen fehler gleich verbessert. Und nein ich sag das jetzt net nur einfach das ich keine arbeit mehr hab
SecretDead is offline  
Old 09/08/2009, 14:58   #14

 
LordKill's Avatar
 
elite*gold: 41
Join Date: Oct 2007
Posts: 1,950
Received Thanks: 3,120
ehm du hasts mit der mt2 db verknüpft
oder irre ich mich
weil die art ist ja chinesisch da mit big 5 und so =o
achja geht auch viel einfacher^^ nja ich habe es mit einer ganz anderen struktur gemacht =o
LordKill is offline  
Reply


Similar Threads Similar Threads
Session Server Closes After Login
06/26/2010 - Dekaron Private Server - 10 Replies
hello i login then it says disconnected from server and the event log shows CRITICAL ERROR : SP_LOGIN_FLAG_SET PROC CALL FAIL in using the new files posted http://i47.tinypic.com/2yzldfp.png
login fehler ???????
03/04/2010 - Metin2 Private Server - 3 Replies
also ich habe mir nen eigenen pserver gemacht hat auch alles geklappt bis er kaputt gegangen is :( hab also alles neu installiert, hier mein prob.: wenn ich mich einloggen möchte mit "rain" dann werde ich imer verbunden und dann stürzt Mt2 ab und es kommt sone fehlermeldung mit nur fragezeichen... pls helft mir
Login and Session server error!!!help!!
12/25/2009 - Dekaron Private Server - 9 Replies
i have problem with my Login and Session server... i'm using win xp pro sp2... I would like to know if someone could help me, Everytime i run the Session Server i get an Error and then it Auto closes, its the same error seen here: 552: Session Server Ready 552: Provider::initialize() Microsoft OLE DB Provider for SQL Server: SQL Server does not exist or access denied. 552: >> CRITICAL ERROR : SP_LOGIN_FLAG_SET PROC CALL FAIL 552: File: .\Config\Provider.cpp, Line: 79



All times are GMT +1. The time now is 16:46.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.