Mi lehet a baj php?
Sziasztok az lenne a baj hogy kaptam egy Játék motort (web)
és van egy két hiba valaki tudna seíteni?
1.Belépésnél rá katintok a belépésre úgy hogy nem töltöm ki az adatokat és belép!
2.Regisztrációnál nincs semmien hiba üzenet semmi!
Ez a két hibám van
Login.php
<table width="400px" cellpadding="0" cellspacing="0">
<tr>
<td width="400px" height="80px" colspan="2">
<form name="login" method="POST" action="main.php">
</td>
</tr>
<tr>
<td align="center" valign="center" colspan="2">
<?php echo "<img src="$login_header" width="300px" height="30px" border="0">"; ?>
</td>
</tr>
<tr>
<td width="400px" colspan="2">
<table width="400px" cellpadding="0" cellspacing="0">
<tr>
<td width="100px" height="20px"></td>
<td width="300px" height="20px"></td>
</tr>
<tr>
<td width="150px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$login_user" width="150px" border="0">"; ?>
</td>
<td width="250px" height="20px" align="center" valign="center">
<input name="username" type="text" class="login_text">
</td>
</tr>
<tr>
<td width="100px" height="5px">
</td>
<td width="300px" height="5px"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$login_pass" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center">
<input name="password" type="password" class="login_text">
</td>
</tr>
<tr>
<td width="100px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="400px" height="30px" colspan="2" align="right" valign="center">
<?php echo "<input type="submit" name="login" class="login_submit" value="$login_submit">"; ?>
</td>
</tr>
<tr>
<td width="100px" height="5px" colspan="2"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="400px" height="3px" bgcolor="" colspan="2"></form></td>
</tr>
<tr>
<td width="400px" height="20px" colspan="2" align="right" valign="center">
<b><a href="index.php?cmd=register"><font color=yellow><?php echo "$login_reg"; ?></font></a><font color=deepskyblue> |</font> <a href="index.php?cmd=lostpassword"><font color=lime><?php echo "$login_forgotten"; ?></font></a></b>
</td>
</tr>
</table>
register.php
<?
$reg = $_SESSION['k1'] . $_SESSION['k2'] . $_SESSION['k3'] . $_SESSION['k4'] . $_SESSION['k5'];
$_SESSION['reg'] = $reg;
if(!empty($_POST['hitelesites']))
{
if($_SESSION['reg'] == $_POST['hitelesites'])
{
if($pw1 != $pw2)
{
echo "$regerror7";
}
else
{
$username = mysql_real_escape_string($_POST['username']);
$pw1 = mysql_real_escape_string($_POST['password']);
$pw2 = mysql_real_escape_string($_POST['password2']);
$email = mysql_real_escape_string($_POST['email']);
$hitelesites = mysql_real_escape_string($_POST['hitelesites']);
$berlet = $_POST['berlet'];
$username = addslashes($username);
$pw1 = addslashes($pw1);
$pw2 = addslashes($pw2);
$email = addslashes($email);
$username = quotemeta($username);
$pw1 = quotemeta($pw1);
$pw2 = quotemeta($pw2);
$email = quotemeta($email);
$password = sha1(md5("maffia".$pw1."$username"));
leker_user_adatlap1($username);
if($user1_username == $username)
{
echo "$regerror3";
}
else
{
$sql_user = mysql_query("SELECT * FROM users WHERE email='$email'");
$num_email = mysql_num_rows($sql_user);
if($num_email>0)
{
echo "$regerror4";
}
else
{
$ip = getenv("REMOTE_ADDR");
$ip_online = time();
$reg_date = date("Y-m-d G:i:s");
$sql = "SELECT * FROM users WHERE ip='$ip'";
$ered_sql = mysql_query($sql);
while($tip = mysql_fetch_array($ered_sql))
{
$online_ip = $tip['online'];
$tipi = $tip['ip'];
}
$ip_online2 = $online_ip+300;
if(($ip == $tipi) and ($ip_online2 >= $ip_online))
{
echo "$regerror5";
}
else
{
$smstime = time()+604800;
$mysql = "INSERT INTO users(username, regkod, password, email, ip, sms_time, reg_date, active, item, alvas) VALUES('$username', '$ip_online', '$password', '$email', '$ip', '$smstime', '$reg_date', '1', '31', 'alvas')";
if(mysql_query($mysql))
{
mkdir( "user_images/$username", 0777);
if($berlet == "1honap")
{
$ar = "200 HUF";
}
elseif($berlet == "3honap")
{
$ar = "500 HUF";
}
elseif($berlet = "6honap")
{
$ar = "1000 HUF";
}
else
{
$ar = "2000 HUF";
}
leker_user_adatlap1($username);
$regkod = $user1_regkod;
$to = $email;
// subject
$subject = 'Offline Maffia Regisztráció';
// message
$message = '
<html>
<head>
<style>
body{
background:url(/images/bg3.png) #000000;
}
</style>
<script language=javascript>
var rev = "fwd";
function titlebar(val)
{
var msg = "Offline Maffia Regisztráció";
var res = " ";
var speed = 180;
var pos = val;
msg = ""+msg+"";
var le = msg.length;
if(rev == "fwd"){
if(pos < le){
pos = pos+1;
scroll = msg.substr(0,pos);
document.title = scroll;
timer = window.setTimeout("titlebar("+pos+")",speed);
}
else{
rev = "bwd";
timer = window.setTimeout("titlebar("+pos+")",speed);
}
}
else{
if(pos > 0){
pos = pos-1;
var ale = le-pos;
scrol = msg.substr(ale,le);
document.title = scrol;
timer = window.setTimeout("titlebar("+pos+")",speed);
}
else{
rev = "fwd";
timer = window.setTimeout("titlebar("+pos+")",speed);
}
}
}
titlebar(0);
</script>
</head>
<body>
<h1>Üdvözlünk az Offline Maffián!</h1>
<strong>A játék stílusa:</strong>
<br />
Online szövegen alapuló,böngészőben játszható MMORPG maffiózós játék.
<strong>A játék lényege: </strong>
<br />
Karaktereddel piti bűnözőként kezded,amit a játék során,fel kell fejlesztened,minél nagyobb szintre,hogy Te legyél a legnagyobb,legmenőbb maffiózó!A játék során figyelned kell kiben bízhatsz meg,mert sokan a pénzedre életedre törnek majd,amit később,mikor már te vagy a jobb megbosszulhatsz!Egy idő után,saját maffia családot alapíthatsz,melyben meghívhatsz tagokat,hogy velük együtt szerezzetek meg mindent,ezzel Ti uraljátok az adott területet.Lényeges,hogy kondizni mindig menj el,ugyanis a későbbi harcok során,nagy jelentősége lesz a statisztikádnak!A lényeg,hogy fejleszd a karaktered!
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: '.$username.' <'.$email.'> Üdv:Offline Maffia<sz.szilard95##kukac##gmail.com>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
//////////////////////
//////// user_weapons sor ///////////
///////////
///////////
//////
$sql_uw1 = "SELECT * FROM users WHERE username='$username' ";
$query_uw1 = mysql_query($sql_uw1);
$array_uw1 = mysql_fetch_array($query_uw1);
$sql_uw2 = "INSERT INTO
user_weapons(u_id, item, pistol, pistol_ammo, handgun, handgun_ammo, shotgun, shotgun_ammo, rifle, rifle_ammo, powergun, powergun_ammo, grenade, molotov, teargas)
VALUES ('".$array_uw1['id']."', '31', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0') ";
$query_uw2 = mysql_query($sql_uw2);
header("Location:index.php?cmd=login®accept=1");
}
else
{
echo "$regerror6";
}
}
}
}
}
}
else
{
echo "$regerror1";
}
}
else
{
if($cmd != "register")
{
echo "$regerror2";
}
}
include "reg_kever.php";
$_SESSION['k1'] = $karakter[$kever1];
$_SESSION['k2'] = $karakter[$kever2];
$_SESSION['k3'] = $karakter[$kever3];
$_SESSION['k4'] = $karakter[$kever4];
$_SESSION['k5'] = $karakter[$kever5];
include "reg_kep.php";
?>
<form name="login" method="POST" action="index.php?cmd=new_user">
<table width="400px" height="250px" cellpadding="0" cellspacing="0">
<tr>
<td width="400px" height="20px" align="center" valign="center" colspan="2">
<?php echo "<img src="$reg_header" width="300px" height="30px" border="0">"; ?>
</td>
</tr>
<tr>
<td width="400px" height="230px" colspan="2">
<table width="400px" height="230px" cellpadding="0" cellspacing="0">
<tr>
<td width="400px" height="20px" colspan="2"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$reg_user" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center" bgcolor="e70c0c">
<input name="username" type="text" class="login_text">
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$reg_pass" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center" bgcolor="">
<input name="password" type="password" class="login_text">
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$reg_pass2" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center" bgcolor="">
<input name="password2" type="password" class="login_text">
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$reg_email" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center" bgcolor="">
<input name="email" type="text" class="login_text">
</td>
</tr>
<tr>
<td width="100px" height="40px" align="center" valign="center">
<img src="tmp/reg_kep.png" width="100">
</td>
<td width="300px" height="65px" align="center" valign="center">
<input name="hitelesites" type="text" class="login_text">
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="400px" height="20px" colspan="2" align="right" valign="center">
<?php echo "<input type="submit" name="register" class="login_submit" value="$reg_submit">"; ?>
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="400px" height="3px" bgcolor="" colspan="2"></td>
</tr>
</table>
</form>
■ és van egy két hiba valaki tudna seíteni?
1.Belépésnél rá katintok a belépésre úgy hogy nem töltöm ki az adatokat és belép!
2.Regisztrációnál nincs semmien hiba üzenet semmi!
Ez a két hibám van
Login.php
<table width="400px" cellpadding="0" cellspacing="0">
<tr>
<td width="400px" height="80px" colspan="2">
<form name="login" method="POST" action="main.php">
</td>
</tr>
<tr>
<td align="center" valign="center" colspan="2">
<?php echo "<img src="$login_header" width="300px" height="30px" border="0">"; ?>
</td>
</tr>
<tr>
<td width="400px" colspan="2">
<table width="400px" cellpadding="0" cellspacing="0">
<tr>
<td width="100px" height="20px"></td>
<td width="300px" height="20px"></td>
</tr>
<tr>
<td width="150px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$login_user" width="150px" border="0">"; ?>
</td>
<td width="250px" height="20px" align="center" valign="center">
<input name="username" type="text" class="login_text">
</td>
</tr>
<tr>
<td width="100px" height="5px">
</td>
<td width="300px" height="5px"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$login_pass" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center">
<input name="password" type="password" class="login_text">
</td>
</tr>
<tr>
<td width="100px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="400px" height="30px" colspan="2" align="right" valign="center">
<?php echo "<input type="submit" name="login" class="login_submit" value="$login_submit">"; ?>
</td>
</tr>
<tr>
<td width="100px" height="5px" colspan="2"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="400px" height="3px" bgcolor="" colspan="2"></form></td>
</tr>
<tr>
<td width="400px" height="20px" colspan="2" align="right" valign="center">
<b><a href="index.php?cmd=register"><font color=yellow><?php echo "$login_reg"; ?></font></a><font color=deepskyblue> |</font> <a href="index.php?cmd=lostpassword"><font color=lime><?php echo "$login_forgotten"; ?></font></a></b>
</td>
</tr>
</table>
register.php
<?
$reg = $_SESSION['k1'] . $_SESSION['k2'] . $_SESSION['k3'] . $_SESSION['k4'] . $_SESSION['k5'];
$_SESSION['reg'] = $reg;
if(!empty($_POST['hitelesites']))
{
if($_SESSION['reg'] == $_POST['hitelesites'])
{
if($pw1 != $pw2)
{
echo "$regerror7";
}
else
{
$username = mysql_real_escape_string($_POST['username']);
$pw1 = mysql_real_escape_string($_POST['password']);
$pw2 = mysql_real_escape_string($_POST['password2']);
$email = mysql_real_escape_string($_POST['email']);
$hitelesites = mysql_real_escape_string($_POST['hitelesites']);
$berlet = $_POST['berlet'];
$username = addslashes($username);
$pw1 = addslashes($pw1);
$pw2 = addslashes($pw2);
$email = addslashes($email);
$username = quotemeta($username);
$pw1 = quotemeta($pw1);
$pw2 = quotemeta($pw2);
$email = quotemeta($email);
$password = sha1(md5("maffia".$pw1."$username"));
leker_user_adatlap1($username);
if($user1_username == $username)
{
echo "$regerror3";
}
else
{
$sql_user = mysql_query("SELECT * FROM users WHERE email='$email'");
$num_email = mysql_num_rows($sql_user);
if($num_email>0)
{
echo "$regerror4";
}
else
{
$ip = getenv("REMOTE_ADDR");
$ip_online = time();
$reg_date = date("Y-m-d G:i:s");
$sql = "SELECT * FROM users WHERE ip='$ip'";
$ered_sql = mysql_query($sql);
while($tip = mysql_fetch_array($ered_sql))
{
$online_ip = $tip['online'];
$tipi = $tip['ip'];
}
$ip_online2 = $online_ip+300;
if(($ip == $tipi) and ($ip_online2 >= $ip_online))
{
echo "$regerror5";
}
else
{
$smstime = time()+604800;
$mysql = "INSERT INTO users(username, regkod, password, email, ip, sms_time, reg_date, active, item, alvas) VALUES('$username', '$ip_online', '$password', '$email', '$ip', '$smstime', '$reg_date', '1', '31', 'alvas')";
if(mysql_query($mysql))
{
mkdir( "user_images/$username", 0777);
if($berlet == "1honap")
{
$ar = "200 HUF";
}
elseif($berlet == "3honap")
{
$ar = "500 HUF";
}
elseif($berlet = "6honap")
{
$ar = "1000 HUF";
}
else
{
$ar = "2000 HUF";
}
leker_user_adatlap1($username);
$regkod = $user1_regkod;
$to = $email;
// subject
$subject = 'Offline Maffia Regisztráció';
// message
$message = '
<html>
<head>
<style>
body{
background:url(/images/bg3.png) #000000;
}
</style>
<script language=javascript>
var rev = "fwd";
function titlebar(val)
{
var msg = "Offline Maffia Regisztráció";
var res = " ";
var speed = 180;
var pos = val;
msg = ""+msg+"";
var le = msg.length;
if(rev == "fwd"){
if(pos < le){
pos = pos+1;
scroll = msg.substr(0,pos);
document.title = scroll;
timer = window.setTimeout("titlebar("+pos+")",speed);
}
else{
rev = "bwd";
timer = window.setTimeout("titlebar("+pos+")",speed);
}
}
else{
if(pos > 0){
pos = pos-1;
var ale = le-pos;
scrol = msg.substr(ale,le);
document.title = scrol;
timer = window.setTimeout("titlebar("+pos+")",speed);
}
else{
rev = "fwd";
timer = window.setTimeout("titlebar("+pos+")",speed);
}
}
}
titlebar(0);
</script>
</head>
<body>
<h1>Üdvözlünk az Offline Maffián!</h1>
<strong>A játék stílusa:</strong>
<br />
Online szövegen alapuló,böngészőben játszható MMORPG maffiózós játék.
<strong>A játék lényege: </strong>
<br />
Karaktereddel piti bűnözőként kezded,amit a játék során,fel kell fejlesztened,minél nagyobb szintre,hogy Te legyél a legnagyobb,legmenőbb maffiózó!A játék során figyelned kell kiben bízhatsz meg,mert sokan a pénzedre életedre törnek majd,amit később,mikor már te vagy a jobb megbosszulhatsz!Egy idő után,saját maffia családot alapíthatsz,melyben meghívhatsz tagokat,hogy velük együtt szerezzetek meg mindent,ezzel Ti uraljátok az adott területet.Lényeges,hogy kondizni mindig menj el,ugyanis a későbbi harcok során,nagy jelentősége lesz a statisztikádnak!A lényeg,hogy fejleszd a karaktered!
</body>
</html>
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: '.$username.' <'.$email.'> Üdv:Offline Maffia<sz.szilard95##kukac##gmail.com>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
//////////////////////
//////// user_weapons sor ///////////
///////////
///////////
//////
$sql_uw1 = "SELECT * FROM users WHERE username='$username' ";
$query_uw1 = mysql_query($sql_uw1);
$array_uw1 = mysql_fetch_array($query_uw1);
$sql_uw2 = "INSERT INTO
user_weapons(u_id, item, pistol, pistol_ammo, handgun, handgun_ammo, shotgun, shotgun_ammo, rifle, rifle_ammo, powergun, powergun_ammo, grenade, molotov, teargas)
VALUES ('".$array_uw1['id']."', '31', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0') ";
$query_uw2 = mysql_query($sql_uw2);
header("Location:index.php?cmd=login®accept=1");
}
else
{
echo "$regerror6";
}
}
}
}
}
}
else
{
echo "$regerror1";
}
}
else
{
if($cmd != "register")
{
echo "$regerror2";
}
}
include "reg_kever.php";
$_SESSION['k1'] = $karakter[$kever1];
$_SESSION['k2'] = $karakter[$kever2];
$_SESSION['k3'] = $karakter[$kever3];
$_SESSION['k4'] = $karakter[$kever4];
$_SESSION['k5'] = $karakter[$kever5];
include "reg_kep.php";
?>
<form name="login" method="POST" action="index.php?cmd=new_user">
<table width="400px" height="250px" cellpadding="0" cellspacing="0">
<tr>
<td width="400px" height="20px" align="center" valign="center" colspan="2">
<?php echo "<img src="$reg_header" width="300px" height="30px" border="0">"; ?>
</td>
</tr>
<tr>
<td width="400px" height="230px" colspan="2">
<table width="400px" height="230px" cellpadding="0" cellspacing="0">
<tr>
<td width="400px" height="20px" colspan="2"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$reg_user" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center" bgcolor="e70c0c">
<input name="username" type="text" class="login_text">
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$reg_pass" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center" bgcolor="">
<input name="password" type="password" class="login_text">
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$reg_pass2" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center" bgcolor="">
<input name="password2" type="password" class="login_text">
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="100px" height="20px" bgcolor="" align="center" valign="center">
<?php echo "<img src="$reg_email" width="150px" border="0">"; ?>
</td>
<td width="300px" height="20px" align="center" valign="center" bgcolor="">
<input name="email" type="text" class="login_text">
</td>
</tr>
<tr>
<td width="100px" height="40px" align="center" valign="center">
<img src="tmp/reg_kep.png" width="100">
</td>
<td width="300px" height="65px" align="center" valign="center">
<input name="hitelesites" type="text" class="login_text">
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
<tr>
<td width="400px" height="20px" colspan="2" align="right" valign="center">
<?php echo "<input type="submit" name="register" class="login_submit" value="$reg_submit">"; ?>
</td>
</tr>
<tr>
<td width="400px" height="5px" colspan="2"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="400px" height="3px" bgcolor="" colspan="2"></td>
</tr>
</table>
</form>
Ezt komolyan
Használj kód színezőt és ne csak így, ilyen igénytelenül szórd be a kódot.
Sajnos az a helyzet, hogy ez
2.Regisztrációnál nincs
kriszrap reloaded
Se egy normális témacím, azt sem tudod, mi a problémád, vagy hogy hol keresd, így segíteni sem lehet!