Ir para conteúdo
Fórum Script Brasil
  • 0

Configurando script php4 para php5


Thiago Lira

Pergunta

Sou leigo mais estou tentando configurar provavelmente tem muita coisa errada mais quem poder me ajudar ficarei grato..

Está dizendo que está dando um erro na linha 75 abaixo segue o código, vejam se tem algo errado ou se está tudo errado ou se esse pelo menos é o caminho para alterar esse script..

<?php include "conexao.php"; 

if ($_POST['Inserir']== "ok") { 

mysql_query("INSERT INTO categorias (categoria) VALUES ('txt_categoria')"); 
} 

if ($_POST['Alterar'] =="ok") { 

mysql_query("UPDATE categorias SET categoria='$txt_categoria' WHERE id_categoria = $id"); 
} 

if ($_POST['Excluir'] =="ok") { 

mysql_query("DELETE FROM categorias WHERE id_categoria = $id"); 
} 

?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<title>Sua Loja Virtual</title> 
<style type="text/css"> 
<!-- 
.style4 {font-size: 12px; font-weight: bold; color: #000000; } 
--> 
</style> 
</head> 
<body> 
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> 
<tr> 
<td colspan="2"><?php include "cabecalho.php"; ?></td> 
</tr> 
<tr> 
<td width="180"><?php include "menu.php"; ?></td> 
<td width="570"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
<tr> 
<td>&nbsp;</td> 
</tr> 
<tr> 
<td><div align="center"> <span class="style1"> 
</span> 
<p class="style4">Categorias</p> 

<?php if ($_POST['acao'] != "") { 

$_POST['sql'] = mysql_query (" SELECT * from Categorias Where id_categoria = $id"); ?> 

<form id="form1" name="form1" method="post" action="<?php echo ($_SERVER['PHP_SELF']) ?>"> 
<table width="300" border="1" align="center" cellpadding="2" cellspacing="0"> 
<tr> 
<td width="67" class="style4">Categoria</td> 
<td width="233"><input name="txt_categoria" type="text" id="txt_categoria" size="35" value = "<?php echo @mysql_result($_POST['sql,0,categoria']); ?> " /></td> 
</tr> 
<tr> 
<td colspan="2"><label> 
<div align="center"> 
<input type="hidden" name="id" value= " <?php echo ($_POST['id']); ?>" /> 
<input type="hidden" name="<?php echo ($_POST['acao']) ?>" value = "ok" /> 
<input type="submit" name="Submit" value="OK" /> 
</div> 
</label></td> 
</tr> 
</table> 
</form> 
<?php } else { ?> 
</span> 
<table width="99%" border="0" cellspacing="0" cellpadding="0"> 
<tr> 
<td width="86%" bgcolor="#E6E6E6"><div align="center" class="style4">Categorias</div></td> 
<td colspan="2" bgcolor="#E6E6E6"><div align="center" class="style4">A&ccedil;&atilde;o</div></td> 
</tr> 
<?php $_POST['sql'] = mysql_query("select * from categorias"); 
////// A linha 75 é essa ///// while $_POST['coluna'] = mysql_fetch_array $_POST['sql'] { ?> 

<tr> 
<td><?php echo ($_POST['coluna']['categoria']) ?></td> 
<td width="7%"><a href="?acao=Alterar&id= <?php echo ($_POST['coluna']['id_categoria']); ?> " > <div align="center"><img src="imagens/alterar.gif" width="15" height="17" border = "0"/></div></a></td> 
<td width="7%"><a href="?Excluir=ok?id= <?php echo ($_POST['coluna']['id_categoria']); ?> " > <div align="center"><img src="imagens/excluir.gif" width="15" height="13" border = "0"/></div></a></td> 
</tr> 
<?php } ?> 
<tr> 
<td colspan="3" bgcolor="#0E3266"><a href="?acao=Inserir"> <div align="right"><img src="imagens/inserir.jpg" width="78" height="31" border = "0"/></div></a></td> 
</tr> 
</table> 
<?php } ?> 
<p>&nbsp;</p> 
</span></div></td> 
</tr> 
</table></td> 
</tr> 
<tr> 
<td colspan="2"><?php include "rodape.php"; ?></td> 
</tr> 
</table> 
</body> 
</html>

Quem poder me ajudar ficarei grato

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...