Ir para conteúdo
Fórum Script Brasil

CaioKroh

Membros
  • Total de itens

    26
  • Registro em

  • Última visita

Sobre CaioKroh

Contatos

  • Website URL
    http://
  • ICQ
    0

Perfil

  • Gender
    Male
  • Location
    ES

CaioKroh's Achievements

0

Reputação

  1. Olá, eu tenho um fomulario de cadastro, e nele tem um list/menu (5 categorias). Eu quero que de acordo com o intem do list/menu selecionado, o cadastro vá para uma tabela do mysql, se escolher outra opção no list/menu, vai para outra tabela, ... Para fazer isso eu posso usar o IF ? Ex.: if(categoria == imovelnovo){ Inserir em tal tabela}elseif(categoria == imovelusado){ inserir em tal tabela}elseif....
  2. Bom, vou colocar um exemplo do problema que estou tendo: PASTA_1(cadastro.php/form.php) - PASTA_2(index.php) na pasta_2, que tem o arquivo index.php, eu do um include no arquivo cadastro.php, que esta na pasta_1 (../PASTA_1/cadastro.php), só que a action dessa pagina de cadastro manda pro form.php, que esta na mesma pasta. O problema é: quando o arquivo de cadastro esta incluido na index.php, ele não acha o arquivo form.php, pois está em outro pasta. Teria algum jeito de resolver isso, sem ser mudar o action do form da pagina ? (Ex.: Por iFrame da certo, mas o include não)
  3. CaioKroh

    Deletar dados

    Bom, tem como alguém arrumar pra mim ? (to começando no PHP) Obs.: já coloquei o formulario fora do while e mudei tudo pra GET... LER.php <?php include("Connections/conn.php"); mysql_select_db($database_conn, $conn); $query_mostrar = "SELECT * FROM tbpedidos ORDER BY id ASC"; $mostrar = mysql_query($query_mostrar, $conn) 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>Untitled Document</title> <style type="text/css"> <!-- .style2 { font-size: 14px; font-weight: normal; } --> </style> </head> <body> <div align="center"> <p> <form id="formdeleta" name="formdeleta" method="get" action="deletar.php"> <?php while($row_mostrar = mysql_fetch_assoc($mostrar)){ echo '<table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <th scope="row"> <table width="500" border="1" cellspacing="0" cellpadding="0"> <tr> <th width="116" height="30" bgcolor="#EEEEEE" scope="row"><div align="left">NOME:</div></th> <th colspan="2" bgcolor="#EEEEEE" scope="row"><div align="left" class="style2">'.$row_mostrar['nome'].'</div></th> <th width=68" bgcolor="#EEEEEE" scope="row"> <div align="center"> <input type="checkbox" name="notica[]" value='.$row_mostrar['id].' /> </div></th> </tr> <tr> <th height="30" bgcolor="#EEEEEE" scope="row"><div align="left">CIDADE:</div></th> <th width="228" height="30" bgcolor="#EEEEEE" scope="row"><div align="left" class="style2">'.$row_mostrar['cidade'].'</div></th> <th width=88" bgcolor="#EEEEEE" scope="row">ESTADO:</th> <th height="30" bgcolor="#EEEEEE" class="style2" scope="row">'.$row_mostrar['estado].'</th> </tr> <tr> <th height="30" bgcolor="#EEEEEE" scope="row"><div align="left">MENSAGEM:</div></th> <th height="30" colspan="3" bgcolor="#EEEEEE" scope="row"><div align="left" class="style2">'.$row_mostrar['pedido'].'</div></th> </tr> <tr> <th height=30" colspan="4" scope="row"></th> </tr> </table> <p> </p> </th> </tr> </table>'; } ?> </p> <p> <a href="deletar.php"><input type="submit" name="button" id="button" value="Deletar" /></a></p> </form> </div> </body> </html> <?php mysql_free_result($mostrar); ?> DELETAR.php <?php $id = $_GET['id]; include("Connections/conn.php"); mysql_select_db($database_conn, $conn); mysql_query("DELETE FROM tbpedidos where id='$id'") or die (mysql_error()); ?>
  4. CaioKroh

    Deletar dados

    des vez não deu erro nenhum, mais também não deletou nada... A pagina ler.php tem, em cada registro um chechbox com o valor do id... eu quero deletar os checkbox selecionados...
  5. CaioKroh

    Deletar dados

    deu isso aqui: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  6. CaioKroh

    Deletar dados

    Fiz o script de deletar mais não esta funcionando... alguém me ajuda a arrumar. Pagina para ver os arquivos inseridos na tabela: LER.php <?php include("Connections/conn.php"); mysql_select_db($database_conn, $conn); $query_mostrar = "SELECT * FROM tbpedidos ORDER BY id ASC"; $mostrar = mysql_query($query_mostrar, $conn) 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>Untitled Document</title> <style type="text/css"> <!-- .style2 { font-size: 14px; font-weight: normal; } --> </style> </head> <body> <div align="center"> <p> <?php while($row_mostrar = mysql_fetch_assoc($mostrar)){ echo '<table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <th scope="row"><form id="formdeleta" name="formdeleta" method="post" action="deletar.php"> <table width="500" border="1" cellspacing="0" cellpadding="0"> <tr> <th width="116" height="30" bgcolor="#EEEEEE" scope="row"><div align="left">NOME:</div></th> <th colspan="2" bgcolor="#EEEEEE" scope="row"><div align="left" class="style2">'.$row_mostrar['nome'].'</div></th> <th width=68" bgcolor="#EEEEEE" scope="row"> <div align="center"> <input type="checkbox" name="notica[]" value='.$row_mostrar['id].' /> </div></th> </tr> <tr> <th height="30" bgcolor="#EEEEEE" scope="row"><div align="left">CIDADE:</div></th> <th width="228" height="30" bgcolor="#EEEEEE" scope="row"><div align="left" class="style2">'.$row_mostrar['cidade'].'</div></th> <th width=88" bgcolor="#EEEEEE" scope="row">ESTADO:</th> <th height="30" bgcolor="#EEEEEE" class="style2" scope="row">'.$row_mostrar['estado].'</th> </tr> <tr> <th height="30" bgcolor="#EEEEEE" scope="row"><div align="left">MENSAGEM:</div></th> <th height="30" colspan="3" bgcolor="#EEEEEE" scope="row"><div align="left" class="style2">'.$row_mostrar['pedido'].'</div></th> </tr> <tr> <th height=30" colspan="4" scope="row"></th> </tr> </table> <p> </p> </form> </th> </tr> </table>'; } ?> </p> <p> <a href="<?php echo "deletar.php?deletar=$id"; ?>"><input type="submit" name="button" id="button" value="Deletar" /></a> </p> </div> </body> </html> <?php mysql_free_result($mostrar); ?> Pagina de deletar: DELETAR.php <?php $id = $_GET['id]; include("Connections/conn.php"); mysql_select_db($database_conn, $conn); mysql_query("DELETE FROM tbpedidos where id=$id"); ?>
  7. Como que eu faço para dar repeat region na horizontal ?
  8. Vo tenta aki, mais vlw ai di novu pela ajuda :) Brigadaooo
  9. Vlw ai cara, deu certinhu aki... :rolleyes: Agora queria saber como que eu faço, por exemplo numa pagina que aparece todas as noticias (uma pagina restrita), eu colocar um checkbox em cada titulo e um botao de excluir, para excluir as noticias que eu selecionei ? :blush:
  10. Bom, minha duvida é a seguinte: Tenho 2 paginas no sistema de noticias: -Index.php (mostra só o titulo) -noticia.php (mostra a noticia inteira) Queria saber se tem como eu colocar o link na pagina index.php pra ele redirecionar para a pagina noticia.php, mais que apareça a notícia escolhida na index. Desde já agradeço.
  11. CaioKroh

    Iniciando no PHP - Ajuda

    Tipo, aqui não apareceu nada... eu fiz umas mudificações, mas agora só aparece o id=1, e a pagina de noticia2.php está abrindo (só a noticia do id=1) Os codes: index2.php noticia2.php O problema mesmo agora é so o ID mesmo
  12. CaioKroh

    Iniciando no PHP - Ajuda

    Eu fiz... Todas notícias que eu clico aparecem ID 3 na página... E quando vai pra página da notícia aparece um erro no mysql, como se estivesse no lugar errado.
  13. CaioKroh

    Iniciando no PHP - Ajuda

    Ainda tah danod pau... vo passa os codigos inteiros : Index2.php noticia2.php
  14. CaioKroh

    Iniciando no PHP - Ajuda

    Bom, eu coloquei o link no titulo certinho na pagina, ai eu clico e ele redireciona para a pagina que vai mostrar a noticia pelo id selecionado. O problema chega aki: Eu coloquei a tabela pra puxar pelo $id, mas onde que eu coloco $id=$_GET['ID']; na pagina ? -------------EDIT------------ Na parte do browse não aparece o numero do id, aparece apenas: linknoticia.php?id=$id
×
×
  • Criar Novo...