Jump to content


Photo

Parser Error


  • Faça o login para participar
3 replies to this topic

#1 Kamper

Kamper

    12 Horas

  • Usuários
  • 161 posts
  • Sexo:Não informado

Posted 18/03/2006, 10:29

Está dando este erro neste código, Parse error: parse error, unexpected T_WHILE in /home/cronus/public_html/top/editar_code.php on line 11:

<?
include 'config.php';
include 'partes.php';

   $nome             = $_POST['nome'];
   $senha            = $_POST['senha'];

   $y = mysql_query("
       SELECT * FROM servidores WHERE nome = '$nome'")

while($x = mysql_fetch_array($y)){
if($senha == $x['senha']) {
echo $inicio;
echo $meio;
echo '    <TH class=titlemedium align=middle width="93%" bgcolor="#C2CFDF">Editar Servidor</TH>
  </TR>
  <TR>
    <TD class=row4 align=middle>
      <form name=register onsubmit="return checkData()" method="POST" action="editar_sv_code.php?id='.$x['id'].'">
        <table border="0" width="100%">
          <tr>
            <td width="50%">
              <p align="right">Banner:</td>
            <td width="50%" align="left"><input name="banner" value="'.$x['banner'].'" size="20" style="font-size: 11 px">(Não
              Requerido) Tamanho: 468x60</td>
          </tr>
          <tr>
            <td width="50%">
              <p align="right">Site:</td>
            <td width="50%" align="left"><input class=myctl name="homepage" value="'.$x['homepage'].'" size="20" style="font-size: 11 px">Não coloque o "http://"</td>
          </tr>
          <tr>
            <td width="50%">
              <p align="right">Descrição:</td>
            <td width="50%" align="left"><!--webbot bot="Validation"
              B-Value-Required="TRUE" I-Maximum-Length="150" --><input class=myctl name="descricao" value="'.$x['descricao'].'" size="20" style="font-size: 11 px" maxlength="150"></td>
          </tr>
          <tr>
            <td width="50%"></td>
            <td width="50%" align="left"><input class=myctl type="submit" value="Registrar" name="action"></td>
           <script language=JavaScript>
<!--
function checkData () {
	// Validation functions obtained from:
	// http://www.devshed.com/c/a/JavaScript/Form-Validation-with-JavaScript/7/
	
	// check to see if input is numeric
	function isNumeric(val)
	{
  if (val.match(/^[0-9]+$/))
  {
 	 return true;
  }
  else
  {
 	 return false;
  }	
	}
	// check to see if input is alphanumeric
	function isAlphaNumeric(val)
	{
  if (val.match(/^[a-zA-Z0-9]+$/))
  {
 	 return true;
  }
  else
  {
 	 return false;
  }	
	}
	// check to see if input is a valid email address
	function isEmailAddress(val)
	{
  if (val.match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+/))
  {
 	 return true;
  }
  else
  {
 	 return false;
  }
	}
	banner = document.register.banner.value;
	homepage = document.register.homepage.value;
	descricao = document.register.descricao.value;
	if (!homepage || homepage.length < 10 || homepage.length > 80) {
  alert("O endereço do site precisa ter entre 10 e 80 caracteres.");
  return false;
	}
	if (!descricao || descricao.length < 30 || descricao.length > 400) {
  alert("A descrição precisa ter entre 30 e 400 caracteres.");
  return false;
	}
	return true;
}

// -->
</SCRIPT>
          </tr>
        </table>
      </form>';
echo $final;
}else{
echo $inicio;
echo $meio;
echo '    <TH class=titlemedium align=middle width="93%" bgcolor="#C2CFDF">Erro</TH>
  </TR>
  <TR>
    <TD class=row4 align=middle>
    <p align="center"><font color="#FF0000">Você digitou a senha incorretamente. Verifique o seu Caps Lock</a></font>';
echo $final;
}
?>

E alguem pode me ensinar a perimitir entrada no site uma vez por dia por IP?? e não por COOKIE...

Grato

#2 Goku Jr

Goku Jr

    Nilson

  • Usuários
  • 3757 posts
  • Sexo:Masculino

Posted 18/03/2006, 10:58

o erro está nesta LINHA:

$y = mysql_query("
      SELECT * FROM servidores WHERE nome = '$nome'")
Faltou o PONTO e VIRGULA no FINAL ;)

$y = mysql_query("SELECT * FROM servidores WHERE nome = '$nome'");

T+
-----------------------------------------------------------------------
PALMEIRAS - Primeiro campeão do mundo em 1951

#3 Kamper

Kamper

    12 Horas

  • Usuários
  • 161 posts
  • Sexo:Não informado

Posted 18/03/2006, 11:13

Funcionou, obrigao. Vou prestar mais atençao na próxima vez.

Mas sabe como permitir um Ip por dia??

Tpw pro meu Top, o cara só pode votar uma vez por dia...

#4 ViM

ViM

    Turista

  • Usuários
  • 51 posts
  • Sexo:Não informado
  • Localidade:SJC / SP

Posted 18/03/2006, 12:19

Se vc tiver usando bd, quando vc for gravar o ip, vc grava o dia tb... aí vc verifica se o dia é igual a hoje...
ou entao usa cookies

falow




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq