[PHP] Re: PHP Error logging

2011-01-18 Thread Carlos Medina

Am 18.01.2011 01:33, schrieb Jimmy Stewpot:

Hello,

I currently have a strange issue where we are seeing 'random errors' being 
displayed to end users. What I find most interesting is that in the php.ini 
file we have the following error settings.

error_reporting  =  E_ALL  ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
track_errors = Off

I thought that if we had dislay_errors = Off then end users should never see 
errors displayed on the web page. However at apparently random times we do 
still see errors being reported, its not consistent at all. To give a better 
idea of the problem we have 8 web servers, they all run an identical copy of 
the site which is stored on a common netapp nfs filer. At apparently random 
times we see that 1 out of 8 servers will reported strange errors like 'use of 
undefined constant' or 'Undefined variable'. What's most strange about these 
errors is that if the code was faulty wouldn't we expect to see the errors on 
all web servers? and secondly wouldn't we expect to see the errors constantly 
rather than at apparently random intervals?

The php.ini files have a modify time of mid 2010 and yet this problem has only 
started in the last few weeks. Has anyone else experienced similar problems in 
the past and if so what was the root cause?

Regards,

Jimmy

Hi,
i think some developer has setting the display_errors with 
ini_set('display_errors', true);

this is why your become the problems now. Maybe this is a idea?

regards

Carlos

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Php error

2009-01-24 Thread Carlos Medina

mattias schrieb:

ERR_DB_NO_DB_PASS
What will this meen?



The Database is a foreign DB without passport

Carlos

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] RE:[[PHP] Error in Script!!!

2007-03-06 Thread Tijnema !

On 3/5/07, Helder Lopes [EMAIL PROTECTED] wrote:


Helder Lopes wrote:

?php
// Conexão com o banco de dados
include mysql.php;
// Inicia sessões
session_start();
// Recupera o login
$login = $_POST[username];
// Recupera a senha
$senha = $_POST[password];
// Usuário não forneceu a senha ou o login
if($login==   $senha= )
{
  echo Você deve digitar sua senha e login!;
  exit;
}
/*
* Executa a consulta no banco de dados.
* Caso o número de linhas retornadas seja 1 o login é válido,
* caso 0, inválido.
*/
echo $nome;
$sql = SELECT username,realname,gid FROM utilizador WHERE
username='$login';
$result_id = mysql_query($sql,$con) or die(brErro no banco de
dados!);//line 23

Where is $con defined???
-B

$total = mysql_num_rows($result_id);
// Caso o usuário tenha digitado um login válido o número de linhas será
1..


if($total)
{

  // Obtém os dados do usuário, para poder verificar a senha e passar os
demais dados para a sessão

  $dados = mysql_fetch_array($result_id);



  // Agora verifica a senha

  if(!strcmp($senha, $dados[password]))

  {
  // TUDO OK! Agora, passa os dados para a sessão e redireciona o
usuário
  $_SESSION[username]   = $dados[username];
  $_SESSION[realname]   = $dados[realname];
  $_SESSION[gid]= $dados[gid];
  require_once ('../utilizadores/listar.php');
  exit;
  }

  // Senha inválida
  else
  {
  echo Senha inválida!;
  exit;
  }
}
// Login inválido
else
{
  echo Error;
  exit;
}
?

Why this script give me a error:


**Warning**: mysql_query(): supplied argument is not a valid MySQL-Link
resource in **ver.php** on line *23*

in a file with a name mysql.php
the $con is correct
with the other that results



I don't know , but if you have only 1 mysql connection, there's no need to
use a MySQL link, you can just leave that out, and it will use the last
opened connection by mysql_connect.

Tijnema


[PHP] RE:[[PHP] Error in Script!!!

2007-03-05 Thread Helder Lopes

Helder Lopes wrote:

?php
// Conexão com o banco de dados
include mysql.php;
// Inicia sessões
session_start();
// Recupera o login
$login = $_POST[username];
// Recupera a senha
$senha = $_POST[password];
// Usuário não forneceu a senha ou o login
if($login==   $senha= )
{
  echo Você deve digitar sua senha e login!;
  exit;
}
/*
* Executa a consulta no banco de dados.
* Caso o número de linhas retornadas seja 1 o login é válido,
* caso 0, inválido.
*/
echo $nome;
$sql = SELECT username,realname,gid FROM utilizador WHERE
username='$login';
$result_id = mysql_query($sql,$con) or die(brErro no banco de
dados!);//line 23

Where is $con defined???
-B

$total = mysql_num_rows($result_id);
// Caso o usuário tenha digitado um login válido o número de linhas será 1..


if($total)
{

  // Obtém os dados do usuário, para poder verificar a senha e passar os
demais dados para a sessão

  $dados = mysql_fetch_array($result_id);



  // Agora verifica a senha

  if(!strcmp($senha, $dados[password]))

  {
  // TUDO OK! Agora, passa os dados para a sessão e redireciona o
usuário
  $_SESSION[username]   = $dados[username];
  $_SESSION[realname]   = $dados[realname];
  $_SESSION[gid]= $dados[gid];
  require_once ('../utilizadores/listar.php');
  exit;
  }

  // Senha inválida
  else
  {
  echo Senha inválida!;
  exit;
  }
}
// Login inválido
else
{
  echo Error;
  exit;
}
?

Why this script give me a error:


**Warning**: mysql_query(): supplied argument is not a valid MySQL-Link
resource in **ver.php** on line *23*

in a file with a name mysql.php
the $con is correct
with the other that results


[PHP] RE:[[PHP] Error in Script!!! - SOLVED

2007-03-05 Thread Helder Lopes

Thanxs for helping!

The error has that i was not calling the database, neither the connection!!

Im so stupid!  Sorry for your time lost!


[PHP] Re: php error message

2005-11-17 Thread Ben

Edward Martin said the following on 11/17/2005 04:27 PM:


Warning: Cannot modify header information - headers already sent by
(output started at
/usr/home/ecmartin/public_html/ethics06/calendarlogin.php:8) in
/usr/home/ecmartin/public_html/ethics06/sas.php on line 34


It means you are trying to change the page's headers after they have 
already been sent to the user's browser. You are probably trying to use 
the header() function after HTML/Javascript/what have you has already 
been sent to the browser.  If you need to use header() you should write 
any earlier output to a variable and only output it to the browser after 
any header() function use.


- Ben

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php error message

2005-11-17 Thread Chuck Anderson

Ben wrote:


Edward Martin said the following on 11/17/2005 04:27 PM:

 


Warning: Cannot modify header information - headers already sent by
(output started at
/usr/home/ecmartin/public_html/ethics06/calendarlogin.php:8) in
/usr/home/ecmartin/public_html/ethics06/sas.php on line 34
   



It means you are trying to change the page's headers after they have 
already been sent to the user's browser. You are probably trying to use 
the header() function after HTML/Javascript/what have you has already 
been sent to the browser.  If you need to use header() you should write 
any earlier output to a variable and only output it to the browser after 
any header() function use.


- Ben
 

Most likely that is exactly what's happening. To be even more clear - 
the solution is to use the header function before any HTML (before *any* 
output). I learned this when I had an include file that was all Php 
causing this problem. The end of the included file had a carriage return 
after the closing tag ?. That was a nasty one to locate. Now I always 
make sure there is no white space after the closing tag in files I might 
include somewhere else.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php error message

2005-11-17 Thread Jasper Bryant-Greene

Chuck Anderson wrote:

Ben wrote:


Edward Martin said the following on 11/17/2005 04:27 PM:


Warning: Cannot modify header information - headers already sent by
(output started at
/usr/home/ecmartin/public_html/ethics06/calendarlogin.php:8) in
/usr/home/ecmartin/public_html/ethics06/sas.php on line 34
  


It means you are trying to change the page's headers after they have 
already been sent to the user's browser. You are probably trying to 
use the header() function after HTML/Javascript/what have you has 
already been sent to the browser.  If you need to use header() you 
should write any earlier output to a variable and only output it to 
the browser after any header() function use.


- Ben
 
Most likely that is exactly what's happening. To be even more clear - 
the solution is to use the header function before any HTML (before *any* 
output). I learned this when I had an include file that was all Php 
causing this problem. The end of the included file had a carriage return 
after the closing tag ?. That was a nasty one to locate. Now I always 
make sure there is no white space after the closing tag in files I might 
include somewhere else.


An alternative solution is to just turn on output buffering, which will 
make sure no output gets sent until after all PHP has stopped processing 
(unless you specifically tell it to get sent earlier).


Jasper

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP error on form

2005-07-28 Thread Sonia
Hi

First some of your $_POST array variables are written like $POST['var'], you
need to change them
to $_POST['var']. Then because you are not using the dot operator in your
string variables and you
are using a associative array you must enclose the array variable in
{$arr['var']} tags!

// enclose with {...}

$msg .=Senders Name: {$_POST['senders_name']}\n;
$msg .=Senders E-MAIL: {$_POST['senders_email']}\n;
$msg .=Senders Name: {$_POST['message']}\n\n;
$mailheaders .=Reply-To: {$_POST['sender_email']}\n;

// or use the dot operator

$msg .=Senders Name:  . $_POST['senders_name'] . \n;
$msg .=Senders E-MAIL:  . $_POST['senders_email'] . \n;
$msg .=Senders Name:  . $_POST['message'] . \n\n;
$mailheaders .=Reply-To:  . $_POST['sender_email'] . \n;


Sonia

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP error on form

2005-07-28 Thread Bruce Gilbert
I made the suggestions mentioned by Mike and don't get any error, but
the form doesn't work properly. Check it out at
http://www.inspired-evolution.com/Contact_Form_test.php

the PHP form CODE I now have is:
?
$form_block = 
FORM METHOD=\POST\ ACTION=\$PHP_SELF\
pstrongYour Name:/strong/p
INPUT type=\text\ NAME=\senders_name\ SIZE=30/p
pstrongYour E-mail Address:/strongp
INPUT type=\text\ NAME=\senders_email\ SIZE=30/p
pstrongMessage:/strong/p
TEXTAREA NAME=\message\ COLS=30 ROWS=5 WRAP=virtual/TEXTAREA/p
INPUT type=\hidden\ name=\op\ value=\ds\
pINPUT TYPE=\submit\ NAME=\submit\ VALUE=\Send this Form\/p
/FORM;

if ($_POST['op'] !=ds) {
// they need to see the form
echo $form_block;
} else if ($_POST['op'] ==ds) {
//check value of $_POST['sender name']
if ($_POST['sender_name'] ==) {
$name_err = font color=redPlease enter your 
name!/fontbr /;
$send = no;
}
//check value of $_POST['sender_email']
if ($POST['sender_email'] ==) {
$email_err =font color=redPlease enter your email 
address!/fontbr /;
$send= no;
}
//check value of $_POST['message']
if ($POST['message'] ==) {
$message_err = font color=redPlease enter a 
message!/fontbr /;
$send =no;
}
if ($send !=no) {
//it's o.k to send, so build the mail
$msg =E-MAIL SENT FROM WWW SITE\n;
$msg .=Senders Name:   $POST{['senders_name']}\n;
$msg .=Senders E-MAIL: 
$POST{['senders_email']}\n;
$msg .=Senders Name:   {$POST['message']}\n\n;
$to =[EMAIL PROTECTED];
$subject = There has been a disturbance in the Force;
$mailheaders .=Reply-To: {$_POST['sender_email']}\n;
//send the mail
mail ($to, $subject, $msg, $mailheaders);
//display confirmation to user
echo pmail has been sent!/p;
} else if ($send ==no) {
//print error messages
echo $name_err;
echo $email_err;
echo $message_err;
echo $form_block;
}
}
?




On 7/28/05, Mike Johnson [EMAIL PROTECTED] wrote:
 From: Bruce Gilbert [mailto:[EMAIL PROTECTED] 
 
  Hello,
  
  I am trying to get a form to work integrating html with PHP.
  
  the code I have is:
  
  ?
  $form_block = 
  FORM METHOD=\POST\ ACTION=\$PHP_SELF\
  pstrongYour Name:/strong /br
  INPUT type=\text\ NAME=\senders_name\ SIZE=30/p
  pstrongpYour E-mail Address:/strong /br
  INPUT type=\text\ NAME=\senders_email\ SIZE=30/p
  pstrongMessage:/strong /br
  TEXTAREA NAME=\message\ COLS=30 ROWS=5 WRAP=virtual/TEXTAREA/p
  INPUT type=\hidden\ name=\op\ value=\ds\
  pINPUT TYPE=\submit\ NAME=\submit\ VALUE=\Send this 
  Form\/p
  /FORM;
  
  if ($_POST['op'] !=ds) {
  // they need to see the form
  echo $form_block;
  } else if ($_POST['op'] ==ds) {
  //check value of $_POST['sender name']
  if ($_POST['sender_name'] ==) {
  $name_err = font color=redPlease 
  enter your name!/font /br;
  $send =no;
  }
  //check value of $_POST['sender_email']
  if ($POST['sender_email'] ==) {
  $email_err =font color=redPlease enter your 
  email address!/font /br;
  $send= no;
  }
  //check value of $_POST['message']
  if ($POST['message'] ==) {
  $message_err = font color=redPlease enter a 
  message!/font /br;
  $send =no;
  }
  if ($send !=no) {
  //it's o.k to send, so build the mail
  $msg =E-MAIL SENT FROM WWW SITE\n;
  $msg .=Senders Name:   
  $POST['senders_name']\n;
  $msg .=Senders E-MAIL: 
  $POST['senders_email']\n;
  $msg .=Senders Name:   $POST['message']\n\n;
  $to =[EMAIL PROTECTED];
  $subject = There has been a disturbance in the Force;
  $mailheaders .=Reply-To: $_POST['sender_email']\n;
  //send the mail
  mail ($to, $subject, $msg, $mailheaders);
  //display confirmation to user
  echo pmail has been sent!/p;
  } else if ($send ==no) {
  //print error messages
  echo $name_err;
  echo $email_err;
  echo $message_err;
  echo $form_block;
  }
  }
  ?
  
  and the error I get is:
  
  Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
  expecting T_STRING or T_VARIABLE or T_NUM_STRING in
  /hsphere/local/home/bruceg/inspired-evolution.com/Contact_Form
  _test.php
  on line 58
  
  the above code is just the php form part of the page not the entire
  code, so it would be impossible to determine line 58, but I was hoping
  someone would be able to spot the problem or at least explain the
  error to a relative newbie.
  
  thanks
 
 I don't think your error message is indicative of this, but PHP /will/
 choke on your lines that include array key references 

RE: [PHP] Re: PHP error on form

2005-07-28 Thread Jay Blanchard
[snip]
I made the suggestions mentioned by Mike and don't get any error, but
the form doesn't work properly. Check it out at
http://www.inspired-evolution.com/Contact_Form_test.php
[/snip]

You never sent the first 60 lines of code or so, and your origianl post
doesn't have 58 lines in it. Please send 60-70 lines of the code (from
the beginning) and let us see if we can find something.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php error

2005-02-16 Thread Matthew Weier O'Phinney
* Stefan [EMAIL PROTECTED]:
 I've a strange problem
 When I try to send a form with method=POST to a php-file I always get an
 HTTP 404 error.
 I really don't know why, because the file exists on the server.

What are you setting the action attribute to? Should be the path to your
script. 

If the script is in the same directory as your form:

form action=script.php method=post/form

or, with a path absolute to the web document root:

form action=/path/to/script.php method=post/form

or, with an absolute URL:

form action=http://example.tld/path/to/script.php;
method=post/form

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP error catching....

2004-07-20 Thread Torsten Roehr
Scott Fletcher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 What are those php functions that catch the PHP errors, not display it and
 do something to it while the user load a webpage.   I don't remember what
 those are.  :-(

 FletchSOD

You can write your own error handling function (or static class method) and
let it deal with all errors triggered by PHP:
http://de2.php.net/set_error_handler

Regards, Torsten Roehr

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP error messages

2003-02-16 Thread Lord Loh.
That is not an error! It is a Warning...I got it the other day when the file
was empty (or did not exist or something).

Use @ prefix to make it disappear

?php
$ar=@file(http://www.something.com/the_filename.txt;);
?

Hope this helps...

Lord Loh.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php