Ir ao conteúdo

Erros PHP


Clobs

Posts recomendados

Postado

O erro:

Notice: Undefined variable: person in C:\xampp\htdocs\desktop\GorillaGab\gorilla.php on line 35

Notice: Undefined variable: talk_back in C:\xampp\htdocs\desktop\GorillaGab\gorilla.php on line 57

Notice: Undefined variable: message in C:\xampp\htdocs\desktop\GorillaGab\gorilla.php on line 76

Notice: Undefined variable: message in C:\xampp\htdocs\desktop\GorillaGab\gorilla.php on line 78

Notice: Undefined variable: pic in C:\xampp\htdocs\desktop\GorillaGab\gorilla.php on line 89

O codigo:


<html>
<head><Title>
Gorilla Gab
</title><meta name="pragma" content="no-cache"></head>
<body TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" bgcolor="#666666">
<td height="20"><font size="5" color="#EFEFEF"><b> Gorilla Gab Ver 1.5</b></font>
<?
/*Dat file name. Make sure it is in the same folder*/
$talk_back_ok = "msg.txt";
/*Webmasters Image Location(put url not path)*/
$webmaster_image = ".../image/kmoo.gif";
/*Webmasters Name*/
$webmaster_name = "CLobs";
/*Webmasters Password*/
$pass = "pass";
/*messages displayed*/
$help_lenght = 20;
/*Home Long can the lake each message*/
$max_single_msg_lenght = 100000;
$max_file_size = $help_lenght * $max_single_msg_lenght;
?></b></i>

</td></tr>
<tr bgcolor="#FFCC66">
<td><img src="pix.gif" width="1" height="4" alt=""></td>
</tr></TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0 bgcolor="#EFEFEF">
<tr bgcolor="#666666"><td align="left">
<TABLE width="100%" height="500" border=0 cellspacing=0 cellpadding=0 bgcolor="#EFEFEF">
<tr align="left"><td valign="top"><font size="-1" color="#666666">

<?php
$person = str_replace ("\n"," ", $person);
$person = str_replace ("<", " ", $person);
$person = str_replace (">", " ", $person);
$person = stripslashes ($person);
?>
<table width="100%" border="0">
<TR><form action="gorilla.php" method="post"><TD align="left">
<FONT SIZE="-1">Name:</FONT><BR><input type="text" name="person" size="25" maxlength="80" value="<? echo $person; ?>"><SELECT NAME="pic">
<option value="empty.gif">choose</option>
<option value="smile1.gif">Smiley</option>
<option value="smile2.gif">Winkey</option>
<option value="smile3.gif">Tongue</option>
<option value="smile4.gif">Sad</option>
<option value="smile5.gif">Cool</option>
</SELECT><br>
<FONT SIZE="-1">Question:</FONT><BR> <textarea name="message" rows="2" cols="32"></textarea>
<BR><input type="submit" value="Click To chat!">
</TD></form></TR>
<?php

/* check if file size is over maximum*/

$file_size= filesize($talk_back);


if ($file_size > $max_file_size) {

$lines = file($talk_back_ok);

$a = count($lines);

$u = $a - $help_lenght;
for($i = $a; $i >= $u ;$i--){
$msg_old = $lines[$i] . $msg_old;
}
$deleted = unlink($talk_back_ok);
$fp = fopen($talk_back_ok, "a+");
$fw = fwrite($fp, $msg_old);
fclose($fp);
}

$msg = str_replace ("\n"," ", $message);

$msg = str_replace ("\n"," ", $message);
$msg = str_replace ("<", " ", $msg);
$msg = str_replace (">", " ", $msg);
$msg = stripslashes ($msg);

if($person == $pass)
{
$sign = (" $webmaster_name <img src='image/$webmaster_image'>");
}
else
{
$sign = (" $person <img src='image/$pic'>");
}

if ($msg != "" && $person != ""){
$time = gmDate("h:i");
$fp = fopen($talk_back_ok, "a+");
$fw = fwrite($fp, "\n<tr><td><FONT SIZE=\"+1\"><b> $sign :</b></FONT><FONT SIZE=\"-2\" color=\"red\"><I>$time</I></FONT> :<FONT SIZE=\"-1\"> $msg<br></FONT></td></tr>");
fclose($fp);
}



?>
</table>
</CENTER>
</font></td></tr></TABLE></td></tr></TABLE>
</body></html>

  • Moderador
Postado

todos os erros são de variáveis indefinidas.

Ou use a supressão de erros com error_reporting()

ou teste a as variáveis com isset() para ver se ela tem algum valor.

de onde vem os dados destas variáveis?

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

LANÇAMENTO!

eletronica2025-popup.jpg


CLIQUE AQUI E BAIXE AGORA MESMO!