Autor Zpráva
MCmini.net
Profil *
Pozrite sa na moj chat:
www-3.mcmini.net
a prihlaste sa ako demo:
nick: demo
heslo: demo
potom napiste nejaku spravu a ten formular z dola zmizne.. chcem aby tam ostal tak mi prosim pomozte spravit to.. tu je moj index.php toho chatu:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<title>MCmini | .chat</title>
</head>
<body>
<form method="post" action="index.php">
Nick: <input type="text" name="login"> Heslo: <input type="password" name="pass">
<input type="submit" name="Vstup" value="Vstúpiť">
<br>
<a class="refresh" target="spravy" href="javascript:location.reload()"><b>REFRESH</b></a> (každých 5 sekúnd)
<iframe class="iframe" src="spravy.html" name="spravy" scrolling="auto" width="93%" height="50%"></iframe><p>
<?php
$login = $_POST['login'];
$pass = $_POST['pass'];
$JMENO="demo";
$HESLO="demo";

if ($login==$JMENO AND $pass==$HESLO){
echo "<form action='spravy.html' target='spravy' method='POST'>
<b>Nick*:</b> <input size='15' maxlength='10' type='text' value='demo' name='meno' readonly>
<b>Správa*:</b> <input size='50' maxlength='65' type='text' name='sprava'>
<b>Email:</b> <input size='15' maxlength='50' type='text' name='email'>
<b>Web:</b> <input size='15' maxlength='50' type='text' value='http://' name='www'>
<input type='submit' name='OK' value='odoslať'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;© 2008 Chat vytvoril <a href='http://www-3.mcmini.net'>Brainiac</a>
</form><p><a href='logout.php'>Odhlásiť</a>";
}
else
{
echo "Pre napísanie správy sa musíte prihlásiť!<p>
Pre demo prihlásenie napíš:<br>
Nick: demo<br>
Heslo: demo<p>
Demo login môže napísať max. 65 znakov do správy, ostatný 255 znakov.
<p>Pre vytvorenie vlastného loginu musíte počkať.";
}
?>

<?php
$meno = $_POST['meno'];
$sprava = $_POST['sprava'];
$ok = (isset($_POST["OK"]));
  if($meno!="" and $sprava!="" and $OK="odoslať")
  {
$ssprava = htmlspecialchars("{$_POST['sprava']}");
$chat = fopen("spravy.html", "a");
fwrite($chat, "<b>{$_POST['meno']} [<a href=\"mailto:{$_POST['email']}\" title=\"{$_POST['email']}\">@</a> | <a target=\"_blank\" href=\"{$_POST['www']}\" title=\"{$_POST['www']}\">www</a>]:</b> $ssprava<br>

");
fclose("spravy.html");
};
?>
</body>
</html>
Matty
Profil
MCmini.net
Nevím jak tobě, ale mě nezmizel.
OT: Jak suky již napsal jinde, nemáš ty náhodou BAN?
MCmini.net
Profil *
mozno mam ale co uz.. ale mne to zmizne hned ako odoslem spravu a musim sa zase prihlasit.. mam mozillu
MCmini.net
Profil *
poradite mi?
Mike8748
Profil
MCmini.net
v okamziku kdyz odesles formular, tak podminka if ($login==$JMENO AND $pass==$HESLO){
uz neplati, protoze ve formulari neposilas dany promeny. proto se formular znova nevypise
MCmini.net
Profil *
a ako spravim aby sa znova vipisal?
MCmini.net
Profil *
uz som si to pomenil teraz to mam takto:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<title>MCmini | .chat</title>
</head>
<body>
<form method="post" action="index.php">
Nick: <input type="text" id="loginMCmini" name="login"> Heslo: <input type="password" name="pass">
<script>
document.getElementById('loginMCmini').focus();
</script> 
<input type="submit" name="Vstup" value="Vstúpiť">
<br>
<hr>
<br>
<a class="refresh" target="spravy" href="javascript:location.reload()"><b>REFRESH</b></a> (každých 5 sekúnd)
<iframe class="iframe" src="spravy.html" name="spravy" scrolling="auto" width="93%" height="50%"></iframe><p>
<?php

//zoznam registrovaných
$login = $_POST['login'];
$pass = $_POST['pass'];
$demo = "demo";
$demo_pass = "demo";
$Admin = "Admin";
$Admin_pass = "***";
$system = "System";
$system_pass = "***";

//demo formulár
if ($login==$demo AND $pass==$demo_pass){
echo "<form method='POST'>
<b>Nick*:</b> <input size='15' maxlength='10' type='text' value='$login' name='meno' readonly>
<b>Správa*:</b> <input size='50' maxlength='65' type='text' name='sprava'>
<input type='submit' name='OK' value='odoslať'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;© 2008 Chat vytvoril <a href='http://www-3.mcmini.net'>Brainiac</a>
</form><p>Prihlásený ako <b>$login.</b> [ <a href='logout.php'>Odhlásiť</a> ]";
}
//admin formulár
if ($login==$Admin AND $pass==$Admin_pass){
echo "<form method='POST'>
<b>Nick*:</b> <input size='15' maxlength='10' type='text' value='$login' name='meno' readonly>
<b>Správa*:</b> <input size='50' maxlength='525' type='text' name='sprava'>
<b>Email:</b> <input size='15' maxlength='50' type='text' name='email'>
<b>Web:</b> <input size='15' maxlength='50' type='text' value='http://' name='www'>
<input type='submit' name='OK' value='odoslať'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;© 2008 Chat vytvoril <a href='http://www-3.mcmini.net'>Brainiac</a>
</form><p>Prihlásený ako <b>$login.</b> [ <a href='logout.php'>Odhlásiť</a> ]";
}
//system formular
if ($login==$system AND $pass==$system_pass){
echo "<form method='POST'>
<b>Nick*:</b> <input size='15' maxlength='10' type='text' value='$login' name='meno' readonly>
<b>Správa*:</b> <input size='50' maxlength='525' type='text' name='sprava'>
<b>Email:</b> <input size='15' maxlength='50' type='text' name='email'>
<b>Web:</b> <input size='15' maxlength='50' type='text' value='http://' name='www'>
<input type='submit' name='OK' value='odoslať'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;© 2008 Chat vytvoril <a href='http://www-3.mcmini.net'>Brainiac</a>
</form><p>Prihlásený ako <b>$login.</b> [ <a href='logout.php'>Odhlásiť</a> ]";
}
//koniec
?>
<br><b>Demo login:</b><br>
<u>Nick:</u> demo<br>
<u>Heslo:</u> demo<br>
<?php
//zoznam clenov
$system = "System";
$admin = "Admin";
$demo = "demo";
//konec zoznamu clenov

$datum = date("j.n.Y, G:i a");
$meno = $_POST['meno'];
$sprava = htmlspecialchars("{$_POST['sprava']}");
$OK = (isset($_POST["OK"]));

//
//systémové nastavenia
if($meno==$system and $sprava!="" and $OK="odoslať" or $meno==$Admin and $sprava!="" and $OK="odoslať")
  {
$chat = fopen("spravy.html", "a");
fwrite($chat, "<b><font color=\"orange\">{$_POST['meno']}:</font></b> $sprava<br>

");
fclose("spravy.html");
}
else
{
if($meno==$system and $sprava!="" and $OK="odoslať" or $meno==$Admin and $sprava!="" and $OK="odoslať")
$chat = fopen("spravy.html", "a");
fwrite($chat, "($datum) <b>{$_POST['meno']} [<a href=\"mailto:{$_POST['email']}\" title=\"{$_POST['email']}\">@</a> | <a target=\"_blank\" href=\"{$_POST['www']}\" title=\"{$_POST['www']}\">www</a>]:</b> $ssprava<br>

");
fclose("spravy.html");
};
?>
</body>
</html>

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: