ID: 7365
Comment by: kosnarova dot alena at seznam dot cz
Reported By: alex-spam at rdc dot ru
Status: No Feedback
Bug Type: PHP options/info functions
Operating System: Linux
PHP Version: 4.1.1
New Comment:
Kachnovo CSS na HTML stránky.....
/* CSS Document */
body {text-align:center; }
#prezentace { width: 800px;
margin: auto;
}
#hlavicka { height: 100px;
width: 780px;
float: center;
clear: both;
}
#obsah { text-align: left;
width: 600px;
float: right;
background-color: white;
}
#menu { text-align: left;
width: 170px;
height: 500px;
float: left;
background-color: white;
border:solid;}
#paticka { width: 100%;
background-color: #0000cc;;
float: left;}
Previous Comments:
------------------------------------------------------------------------
[2007-05-15 20:15:22] kosnarova dot alena at seznam dot cz
CREATE TABLE `chat` (
`odesilatel` int(11) NOT NULL,
`adresat` int(11) NOT NULL,
`cas` varchar(8) collate utf8_czech_ci NOT NULL,
`time` bigint(20) NOT NULL,
`zprava` varchar(255) collate utf8_czech_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
-- --------------------------------------------------------
--
-- Struktura tabulky `uzivatele`
--
CREATE TABLE `uzivatele` (
`id` int(11) NOT NULL auto_increment,
`nick` varchar(30) collate utf8_czech_ci NOT NULL,
`heslo` varchar(50) collate utf8_czech_ci NOT NULL,
`stav` tinyint(1) NOT NULL,
`posledni_akce` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci
AUTO_INCREMENT=7 ;
------------------------------------------------------------------------
[2007-05-15 18:41:34] kosnarova dot alena at seznam dot cz
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head><!-- čřýČŘÝ -->
<meta name="generator" content="PSPad editor, www.pspad.com" />
<meta http-equiv="content-type" content="text/html; charset=utf-8"
/>
<title></title>
</head>
<?php
if($_GET["send"]) {
$Spojeni=mysql_connect("mysql.hustej.net", "hn_kosik",
"nazdar");
mysql_select_db("hn_kosik", $Spojeni);
// pracovat
$Dotaz = mysql_query("SELECT COUNT(*) AS pocet FROM uzivatele WHERE
nick = '".$_POST["nick"]."'", $Spojeni); // dotaz, jenz vrati pocet
uzivatelu
$vysledek = mysql_fetch_array($Dotaz);
if ($vysledek["pocet"]!= 0) {
Echo "Uzivatel jiz existuje";
} else if($_POST["nick"] == "") {
Echo "Neni zadan nick";
} else if($_POST["heslo"] == "") {
Echo "Neni zadane heslo";
} else if($_POST["heslo"] != $_POST["overeni_hesla"]) {
Echo "Spatne heslo";
} else {
mysql_query("INSERT INTO uzivatele (nick,heslo) VALUES
('".$_POST["nick"]."','".MD5($_POST["heslo"])."')", $Spojeni); // je
vytvoren novy zaznam
}
mysql_close($Spojeni);
}
?>
<body>
<form action="registrace.php?send=true" method="post">
<Table>
<tr><td>nick</td><td><input name="nick" type="text" /></td></tr>
<tr><td>heslo</td><td><input name="heslo" type="password"
/></td></tr>
<tr><td>overeni hesla</td><td><input name="overeni_hesla"
type="password" /></td></tr>
</Table>
<input type="submit" />
</form>
</body>
</html>
------------------------------------------------------------------------
[2007-05-15 18:37:23] kosnarova dot alena at seznam dot cz
<?php
session_start();
?>
hlavička XHTML!!!
<?php
$Spojeni = mysql_connect("mysql.hustej.net", "hn_kosik",
"nazdar");
mysql_select_db("hn_kosik", $Spojeni);
mysql_query("DELETE FROM chat WHERE time < ".(TIME()-600),
$Spojeni);
if ($_GET["logout"]) {
mysql_query("UPDATE uzivatele SET posledni_akce = ".(time()-600)."
WHERE id = '".$_SESSION["idUzivatele"]."'" , $Spojeni);
$_SESSION ["idUzivatele"] = "";
if($_GET["send"]) {
$Dotaz = mysql_query("SELECT id FROM uzivatele WHERE nick =
'".$_POST["nick"]."' AND heslo = '".MD5($_POST["heslo"])."'",
$Spojeni);
$vysledek = mysql_fetch_array($Dotaz);
if ($vysledek["id"] != "") {
$_SESSION ["idUzivatele"] = $vysledek["id"];
mysql_query("UPDATE uzivatele SET posledni_akce = ".time()."
WHERE id = '".$vysledek["id"]."'" , $Spojeni);
}
}
if ($_GET["message"]) {
mysql_query("INSERT INTO chat (odesilatel,adresat,cas,time,zprava)
VALUES (".$_SESSION["idUzivatele"].",
".$_POST["adresat"].",'".DATE("H:i:s")."',".TIME().",'".$_POST["zprava"]."')",$Spojeni);
mysql_query("UPDATE uzivatele SET posledni_akce = ".time()." WHERE
id = '".$vysledek["id"]."'" , $Spojeni);
}
if ($_SESSION["idUzivatele"] == "") {
?>
<form action="index.php?send=true" method="post">
<table>
<tr><td>Nick</td><td><input name="nick" type="text" /></td></tr>
<tr><td>Heslo</td><td><input name="heslo" type="password"
/></td></tr>
<tr><td><a href="registrace.php">Registrace</a></td><td><input
name="Registrace" type="submit" /></td></tr>
</table>
</form>
<?php
}
if ($_SESSION["idUzivatele"] != ""){
<div id="zpravy">
<?php
$Dotaz = mysql_query("SELECT uzivatele.nick,chat.cas,chat.zprava
FROM chat INNER JOIN uzivatele ON uzivatele.id = chat.odesilatel
WHERE chat.adresat = ".$_SESSION["idUzivatele"]." OR chat.adresat
= 0 ORDER BY time DESC", $Spojeni);
while ($vysledek = mysql_fetch_array($Dotaz)) {
Echo "<p>".$vysledek["cas"]."
".$vysledek["nick"].":".$vysledek["zprava"]."</p>";
}
?>
</div>
<div id="uzivatele">
<ul>
<?php
$Dotaz = mysql_query("SELECT nick FROM uzivatele WHERE
posledni_akce > ".(time()-600),$Spojeni);
while ($vysledek = mysql_fetch_array($Dotaz)) {
Echo "<li>".$vysledek["nick"]."</li>";
}
?>
<li><a href="index.php?logout=true">Odhlasit se</a></li>
</ul>
</div>
<div id="psani">
<form action="index.php?message=true" method="post">
<input name="zprava" type="text">
<select name="adresat">
<option value="0">vsem</option>
<?php
$Dotaz = mysql_query("SELECT id,nick FROM uzivatele WHERE
posledni_akce > ".(time()-600),$Spojeni);
while ($vysledek = mysql_fetch_array($Dotaz)) {
Echo "<option value =
\"".$vysledek["id"]."\">".$vysledek["nick"]."</option>";
}
?>
</select>
<input type="submit">
</form>
</div>
<?php
}
mysql_close($Spojeni);
?>
</body>
</html>
------------------------------------------------------------------------
[2002-04-01 00:00:03] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2002-02-28 19:41:09] [EMAIL PROTECTED]
error_reporting should be able to changed anywhere.
PHP_INI_ENTRY("error_reporting", NULL,
PHP_INI_ALL, OnUpdateErrorReporting)
Could you try snapshot to see if it helps?
http://snaps.php.net/
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/7365
--
Edit this bug report at http://bugs.php.net/?id=7365&edit=1