Ir para conteúdo

POWERED BY:

Arquivado

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

troypunkrock

Update =/

Recommended Posts

Olá alguem poderia me ajudar?

<?php

include"com.php";
 
 $id = $_GET['id'];
   
$sql=mysql_query("SELECT * FROM tab_empresa WHERE id='$id'") or die (mysql_error());


?>





<!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=utf-8" />
<title>Documento sem título</title>
<link href="css/estilo.css" rel="stylesheet" type="text/css" />
</head>

<body>
 <div id="tudo">
   <form id="form1" name="form1" method="post" action="empresa_edit_db.php">
   <table  bgcolor="#CC3300" bordercolor="#000000" width="385" border="0"  align="center" cellpadding="1" cellspacing="1" class="texto_1_branco">
     <?php
while($array = mysql_fetch_array($sql))
{
 
?>
     <tr>
       <td width="85">Titulo:</td>
       <td width="284"><input name="e_titulo2" type="text" id="e_titulo2" value="<?php echo $array['titulo']; ?>" size="48"  />
       </td>
     </tr>
     <tr>
       <td>Comentario:</td>
       <td><textarea name="e_texto2" id="e_texto2" cols="45" rows="5"><?php echo $array['texto']; ?></textarea>
           </label></td>
     </tr>
     <tr>
       <td><input name="id2" type="hidden" id="id2" value="<?php echo $array['id']; ?>"   /></td>
       <td><input type="submit" name="button2" id="button2" value="Enviar" />
       </td>
     </tr>
     <?php  
  }
 ?>
   </table>
   </form>
 </div>
</body>
</html>

O codigo da paguina que tem q passar os valores para a paguina

 

<?php
//conecta com o db

	include "com.php";
//pega as variaveis do arquivo edit_empresa.php

	$id = $_GET['id2'];
	$titulo = $_POST['e_titulo2']; 
	$texto = $_POST['e_texto2'];
	

//faz update das informaçoes do arquivos ow pelo menos tenta 

mysql_query("UPDATE fox_db.tab_empresa SET titulo = '$texto', texto = '$titulo' WHERE tab_empresa.id = '$id'") or die(mysql_error()); 

//redireciona

echo "<script>window.location='painel_empresa.php';</script>" 


 ?>
para depois essa paguina poder fazer o update mais nao esta fundando =// alguem me ajudar !!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.