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:

<?php
 session_start();
?>
hlavi&#269;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>


Previous Comments:
------------------------------------------------------------------------

[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/

------------------------------------------------------------------------

[2002-02-28 12:47:45] norman at norman dot com dot br

I still get this problem with PHP 4.1.1, compiled as a DSO module:

This doesnt work in apache .conf files:
  php_value error_log "/tmp/phperr.log"
  php_value error_reporting 0     

Just this also doesnt work:
  php_value error_reporting 0

In both previous cases, I still get warnings shown...

But the flag WORKS:
  php_flag display_errors 0

Norman

------------------------------------------------------------------------

[2001-01-12 12:51:53] [EMAIL PROTECTED]

this seems to be fixed in both 4.0.4 and current CVS. if you experience
the same behavior after update, please reopen this bug report.

------------------------------------------------------------------------

[2000-10-20 07:27:31] alex-spam at rdc dot ru

PHP version 4.0.3, compiled as DSO module.
I want to disable warnings, so I have:

/www/conf/httpd.conf:
---
   php_value error_log "/tmp/phperr.log"
   php_value error_reporting 0     # disabled EVERYTHING
---

'faulty' code (line 120:
---
   if(is_array($messages[$seed]["replies"])){
---

In browser when I request the page, I get:
---
   Warning: Undefined index: replies in
/home/www-html/htdocs/forum/multi-threads.inc on line 120
---
, this is a warning I guess, but they should be disabled

phpinfo() says about my configuration:
---
error_log             /tmp/phperr.log       no value
error_reporting       0                     no value
---
, so it seems that config is read ok


/tmp/phperr.log doesn't get created. If I write
---
   php_flag display_errors 0
---

It disables all error reporting whatsoever, but it makes debugging
nearly impossible. Error log isn't created in this case as well.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=7365&edit=1

Reply via email to