Pagina 1 din 1

Warning: session_start()

Scris: Sâm Sep 03, 2016 5:00 pm
de AlexVD
Buna Ziua !

Am intampinat urmatoare eroare :
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/public_html/_include-config.php:1) in /home/public_html/_include-config.php on line 35

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/public_html/_include-config.php:1) in /home/public_html/_include-config.php on line 35

Fatal error: Call to undefined function quote_smart() in /home/public_html/_include-config.php on line 83


COD

Cod: Selectaţi tot

ENDHTML;
    exit;
  }

  include("_include-funcs.php");
session_start();
  if(isset($_SESSION['login'])) {
    $dbres                                = mysql_query("SELECT *,UNIX_TIMESTAMP(`signup`) AS `signup`,UNIX_TIMESTAMP(`online`) AS `online` FROM `users` WHERE `login`='{$_SESSION['login']}'");
    $data                                = mysql_fetch_object($dbres);
  }



  if(((count($_POST) > 0 && !isset($_POST['omnilog'])) || ($_POST['omnilog'] == 1 && count($_GET) > 1)) && isset($OMNILOG)) {
    $forwardedFor                        = ($_SERVER['HTTP_X_FORWARDED_FOR'] != "") ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['HTTP_CLIENT_IP'];
    $forwardedFor                        = preg_replace('/, .+/','',$forwardedFor);
    $postVars                                = addslashes(var_export($_POST,TRUE));
    if($postVars == "array (\n)" || (count($_POST) == 1 && isset($_POST['omnilog'])))
      $postVars                                = "";
    $getVars                                = addslashes(var_export($_GET,TRUE));
    if($getVars == "array (\n)")
      $getVars                                = "";
    mysql_query("INSERT INTO `[omnilog]` VALUES(NOW(),'{$_COOKIE['login']}','{$_SERVER['REMOTE_ADDR']}','$forwardedFor','{$_SERVER['PHP_SELF']}','$postVars','$getVars')");
    mysql_query("INSERT INTO `[omnilog2]` VALUES(NOW(),'{$_COOKIE['login']}','{$_SERVER['REMOTE_ADDR']}','$forwardedFor','{$_SERVER['PHP_SELF']}','$postVars','$getVars')");
  }

  foreach($_POST as $key => $value) {
    if(gettype($_POST[$key]) == "array")
      foreach($_POST[$key] as $key2 => $value2) {
        $_POST[$key][$key2]                = addslashes($_POST[$key][$key2]);
        $_POST[$key][$key2]                = quote_smart($_POST[$key][$key2]);
    } else {
      $_POST[$key]                        = addslashes($_POST[$key]);
      $_POST[$key]                        = quote_smart($_POST[$key]);
      }
  }
  foreach($_GET as $key => $value) {
    if(gettype($_GET[$key]) == "array")
      foreach($_GET[$key] as $key2 => $value2) {
        $_GET[$key][$key2]                = addslashes($_GET[$key][$key2]);
        $_GET[$key][$key2]                = quote_smart($_GET[$key][$key2]);
    } else {
      $_GET[$key]                        = addslashes($_GET[$key]);
      $_GET[$key]                        = quote_smart($_GET[$key]);
  }
  }
  foreach($_COOKIE as $key => $value) {
    if(gettype($_COOKIE[$key]) == "array")
      foreach($_COOKIE[$key] as $key2 => $value2) {
        $_COOKIE[$key][$key2]                = addslashes($_COOKIE[$key][$key2]);
        $_COOKIE[$key][$key2]                = quote_smart($_COOKIE[$key][$key2]);
    } else {
      $_COOKIE[$key]                        = addslashes($_COOKIE[$key]);
      $_COOKIE[$key]                        = quote_smart($_COOKIE[$key]);
  }
  }

  $clientIP                                = $_SERVER['REMOTE_ADDR'];
  $dbres                                = mysql_query("SELECT `id` FROM `users` WHERE `IP`='$clientIP' AND `level`<='-50'");
  if(mysql_num_rows($dbres) != 0) {
    print <<<ENDHTML
   


Ma puteti ajuta si pe mine va rog ?

Re: Warning: session_start()

Scris: Sâm Sep 03, 2016 8:06 pm
de GeorgeValentin
session_start ar trebuii apelat inainte ca php sa printeze ceva, adica ar trebuii inainte de inceperea codului <head> sau chiar <html>

Re: Warning: session_start()

Scris: Mar Sep 06, 2016 1:20 am
de Birkoff
discutii despre eroarea asta sunt in forum de cand am aparut eu pe aici (mai bine de 6-7 ani) ai cautat si tu inainte sa intrebi?