
Dimitrov
Membros-
Total de itens
18 -
Registro em
-
Última visita
Sobre Dimitrov

Dimitrov's Achievements
0
Reputação
-
verdade copie errado o alterar ta ai... <a href="?acao=Alterar&id= <?php echo $coluna[id_categoria] ;?>"><img src="imagens/b_edit.gif" width="16" height="16" border = "0"/></a> valeu
-
é este <input name="txt_categoria" type="text" id="txt_categoria" size="35" value= "<?php echo @mysql_result($sql,0,categoria); ?>"/>
-
Gostaria de saber porque não consigo alterar meus dados no mysql,o codigo esta certo,aparentemente pelo menos,pois é pra clicar no botao alterar e depois ele ir para o input ,dai pra mim alterar o nome dele.mas ele ao clicar em alterar ele não esta indo para o input =/ por favor alguém me de uma ajuda ai. obrigado Categoria.php <?php include "conexao.php" ?> <!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>Untitled Document</title> </head> <body> <table width="750" border="0" align="center"> <tr> <td colspan="2"><?php include('cabecalho.php'); ?></td> </tr> <tr> <td width="200"><?php include('menu.php'); ?></td> <td width="583"><table width="100%" border="0"> <tr> <td> </td> </tr> <tr> <td align="center" style="font-size: 14px; text-align: center;"><p>categoria</p> <?php if ($acao != "") { $sql = mysql_query ("SELECT * from Categorias Where id_categoria = $id"); ?> <form id="form1" name="form1" method="post" action="<? echo $PHP_SELF ?>"> <table width="300" border="1" align="center" cellpadding="2" cellspacing="0"> <tr> <td width="143">Categoria</td> <td width="147"><label> <input name="txt_categoria" type="text" id="txt_categoria" size="35" value= "<?php echo @mysql_result($sql,0,categoria); ?>"/> </label></td> </tr> <tr> <td colspan="2" align="center"><label> <input type="submit" name="button" id="button" value="OK" /> </label></td> </tr> </table> </form> <?php } else { ?> <table width="99%" border="1"> <tr> <td width="90%" align="left">Categorias</td> <td colspan="2" align="center">Ação</td> </tr> <?php $sql = mysql_query ("SELECT * from categorias") or exit(mysql_error()); while ($coluna = mysql_fetch_array ($sql)) { ?> <tr> <td align="left"><?php echo $coluna[categoria] ?></td> <td width="5%"><a href="?acao=Alterar&id= <?php echo $coluna[id_categoria];?>"><img src="imagens/b_edit.gif" width="16" height="16" border = "0"/></a></td> <td width="5%"><img src="imagens/b_drop.gif" width="16" height="16" /></td> </tr> <?php } ?> <tr> <td colspan="3" align="right"><img src="imagens/b_insrow.gif" width="16" height="16" /><span style="font-size: 12px;">Inserir</span></td> </tr> </table> <?php } ?> <p> </p></td> </tr> </table></td> </tr> <tr> <td colspan="2"><?php include('rodape.php'); ?></td> </tr> </table> </body> </html> cabecalho.php <table width="779" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="9%"> </td> <td width="25%"><img src="imagens/logo.jpg" width="156" height="89" /></td> <td width="59%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"> </td> </tr> <tr> <td width="73%"> </td> <td width="27%"><img src="imagens/imagenadm.gif" width="169" height="40" /></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="33%"> login:</td> <td width="58%"><strong>Data:</strong><?php $dia_da_semana = array ("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"); $num_dia = date (w); $dia_extenso = $dia_da_semana[$num_dia]; echo $dia_extenso.", ".date("d/m/Y");?> - <b> Hora: </b> <?php echo date("H:i"); ?> - <b> IP: </b> <?php echo getenv ("REMOTE_ADDR"); ?> </td> <td width="9%"> </td> </tr> </table></td> </tr> <tr> <td colspan="2"><img src="imagens/menu.gif" width="623" height="34" /></td> </tr> </table></td> <td width="7%"> </td> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table> menu.php <table width="200" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="32"> </td> <td width="131"></td> <td width="37"> </td> </tr> <tr> <td> </td> <td><table width="178" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="imagens/menuu.gif" width="183" height="39" /></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%"> <tr> <td width="11%" height="51"> </td> <td width="89%" align="left" valign="top"> <a href="categoria.php">Categorias </a> <br /> <a href="subcategoria.php">Sub Categorias </a><br /> <a href="produtos.php">Produtos </a><br /> <a href="clientes.php">Cliente </a><br /> </td> </tr> </table></td> </tr> </table></td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> conexao.php <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_conexao = "localhost"; $database_conexao = "loja"; $username_conexao = "root"; $password_conexao = ""; $conexao = mysql_pconnect($hostname_conexao, $username_conexao, $password_conexao) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db( $database_conexao , $conexao ) or die( mysql_error() ); ?>
-
Opa muito obrigado romerito deu certo sim,mas você poderia me explicar porque tinha q colocar essa linha sendo q o banco já esta selecionado mais a cima?? valeu mesmo
-
Por favor me ajudem,estou com um problema serio,o erro "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\admin\categoria.php on line 51" dai coloquei o "mysql_error" ele da "no database selected" só que ai ta a questao pois o include do conexão esta na pagina =/ o codigo é este: categoria.php <?php include "conexao.php" ?> <!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>Untitled Document</title> </head> <body> <table width="750" border="0" align="center"> <tr> <td colspan="2"><?php include('cabecalho.php'); ?></td> </tr> <tr> <td width="200"><?php include('menu.php'); ?></td> <td width="583"><table width="100%" border="0"> <tr> <td> </td> </tr> <tr> <td align="center" style="font-size: 14px; text-align: center;"><p>categoria</p> <?php if ($acao != "") { $sql = mysql_query ("SELECT * from Categoria Where id_categoria = $id"); ?> <form id="form1" name="form1" method="post" action="<? echo $PHP_SELF ?>"> <table width="300" border="1" align="center" cellpadding="2"> <tr> <td width="143">Categoria</td> <td width="147"><label> <input name="txt_categoria" type="text" id="txt_categoria" size="35" /> </label></td> </tr> <tr> <td colspan="2" align="center"><label> <input type="submit" name="button" id="button" value="OK" /> </label></td> </tr> </table> </form> <?php } else { ?> <table width="99%" border="1"> <tr> <td width="90%">Categorias</td> <td colspan="2" align="center">Ação</td> </tr> <?php $sql = mysql_query ("SELECT * from categorias") or exit(mysql_error()); while ($coluna = mysql_fetch_array ($sql)) { ?> <tr> <td><?php echo $coluna[categoria] ?></td> <td width="5%"><img src="imagens/b_edit.gif" width="16" height="16" /></td> <td width="5%"><img src="imagens/b_drop.gif" width="16" height="16" /></td> </tr> <?php } ?> <tr> <td colspan="3" align="right"><img src="imagens/b_insrow.gif" width="16" height="16" /><span style="font-size: 12px;">Inserir</span></td> </tr> </table> <?php } ?> <p> </p></td> </tr> </table></td> </tr> <tr> <td colspan="2"><?php include('rodape.php'); ?></td> </tr> </table> </body> </html> conexao.php <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_conexao = "localhost"; $database_conexao = "loja"; $username_conexao = "root"; $password_conexao = ""; $conexao = mysql_pconnect($hostname_conexao, $username_conexao, $password_conexao) or trigger_error(mysql_error(),E_USER_ERROR); ?> por favor alguém me da uma luz ai =/
-
Brigado ai veio deu certo =D~
-
intao Norivan estou usando o CS4 e fica com essa tag amarela do <head> me ajude a resolver isso testa o codigo ai pra mim...obrigado ai e esse Commands>>>Aply Sourcer Format que você disse não funcionou não =/ obrigado
-
index.php <!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>Untitled Document</title> </head> <body> <table width="750" border="0" align="center"> <tr> <td colspan="2"><?php include "cabecalho.php"; ?></td> </tr> <tr> <td width="156" valign="top"><?php include "menu.php"; ?></td> <td width="584"> </td> </tr> <tr> <td colspan="2"><?php include "rodape.php"; ?></td> </tr> </table> </body> </html> cabecalho.php <!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>AUHhuahu</title> </head> <body> <table width="779" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="9%"> </td> <td width="25%"><img src="imagens/logo.jpg" width="156" height="89" /></td> <td width="59%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"><img src="/imagens/logo.jpg" width="156" height="89" /></td> </tr> <tr> <td width="73%"> </td> <td width="27%"><img src="imagens/imagenadm.gif" width="169" height="40" /></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="38%"> login:</td> <td width="48%"><strong>Data:</strong><?php $dia_da_semana = array ("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"); $num_dia = date (w); $dia_extenso = $dia_da_semana[$num_dia]; echo $dia_extenso.", ".date("d/m/Y");?> - <b> Hora: </b> <?php echo date("H:i"); ?> - <b> IP: </b> <?php echo getenv ("REMOTE_ADDR"); ?> </td> <td width="14%"> </td> </tr> </table></td> </tr> <tr> <td colspan="2"><img src="imagens/menu.gif" width="623" height="34" /></td> </tr> </table></td> <td width="7%"> </td> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table> </body> </html> brigado por inquanto ai Norivan
-
intao ele esta dando essa exclamação pelo cabecalho.php...dai aparece uma janelinha escrita "include ssi file" o que significa???
-
por favor o que significa esse erro? Warning: include(cabecalho.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\admin\index.php on line 11 Warning: include() [function.include]: Failed opening 'cabecalho.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\admin\index.php on line 11
-
não ele não se repete...não ele não da erro...mas só não consigo editar a tabela =/
-
alguém poderia me ajudar não sei porque ta aparecendo esse erro no dreamweaver...porque a tag </head> ta fechada normal...e se não sumir isso não consigo editar minha tabela...por favor me ajudem...
-
Rickayron, brigado ai mais não deu certo mas mesmo assim valer já tentei veio não deu =/ sim
-
A questão é que não sei mais o que fazer estou começando a programar,por isso sei o basico,mas esta acontecendo o seguinte,não consigo passar as variaveis do php pro html,por exempo se utilizo elas com o echo ou print beleza vai normal,só que tipo preciso repassar elas pra um select e não pega,e não é só no select pois qualquer parte do html tipo assim <?=$registro["nome"]?> não pega =/,não sei oque acontece pois já instalei php,apache,mysql por parte,já instalei o xampp tb nada e agora to utilizando o wamp tb nada... se alguém puder me de uma luz ai... valeu index.php <html> <head> <title> PHP </title> </head> <body> <table width = "100%" border = "1" cellspacing = "0" cellpadding = "0"> <tr> <td> <table width = "100%" border = "1" cellspacing = "0" cellpadding = "0"> <tr> <td colspan="2">Cabeçalho</td> </tr> <tr> <td width ="20%"> <table width = "100%" border = "1" cellspacing = "0" cellpadding = "0"> <tr> <td>Menu de opçoes </td></tr> <tr> <td><a href="index.php?link=1">Home </a></td></tr> <tr> <td><a href="index.php?link=2">Inserir</a> </td></tr> <tr> <td><a href="index.php?link=3">Alterar</a> </td></tr> <tr> <td>Excluir </td></tr> <tr> <td>Consultar </td></tr> </table> </td> <td> <table width = "100%" border = "1" cellspacing = "0" cellpadding = "0"> <tr><td> <?php $link=$_GET["link"]; $pag[1]="home.php"; $pag[2]="formcliente.php"; $pag[3]="selecionaalterar.php"; if (!empty ($link)) { if (file_exists($pag[$link])) { include $pag[$link]; } } else { print "a pagina não foi encontrada"; } ?> </td></td> </table> </td> </tr> </table> </td> </tr> </table> </body> </html> selecionaalterar.php <? include ("conexao.php");?> <html> <head> <title> TEste </title> </head> <body> <form name="alterar" method = "post" action ="index.php?link=3"> selecione um nome: <select name = "selecao" size "1" id="selecao" > <?php $sql= "SELECT nome FROM cliente order by nome"; $resultado = mysql_query($sql) or die ("não foi possível realizar a consulta, verifique a conexão"); While($registro=mysql_fetch_array($resultado)) { ?> <option > <?=$registro["nome"]?> </option> <?php } mysql_free_result($resultado); ?> </select> <input name="ok" type = "submit" value = "OK"> </form> </body> </html> O resto do programa ta beleza...só não consigo fazer pegar variavel nenhuma no html
-
brigado ai sergio mas mesmo assim não rolou =/