header("Location: pagina.htm");
Não funcionou o negocio do form??
Falopa!
Posted 01/09/2005, 17:32
header("Location: pagina.htm");
Posted 01/09/2005, 17:49
Hum... por isso aonde...Faça assim:
header("Location: pagina.htm");
Não funcionou o negocio do form??
Falopa!
Posted 01/09/2005, 18:57
Posted 02/09/2005, 12:37
<? require("loga.php"); ?> <? include"config.php"; $sql = mysql_query("SELECT * FROM fotos order by id desc"); ?> <? $total = mysql_num_rows($sql); $colunas = "1"; if ($total>0) { for ($i = 0; $i < $total; $i++) { if (($i%$colunas)==0) { ?> <? }?> <? $dados= mysql_fetch_array($sql); echo mysql_error(); ?> <? if($dados['id'] != ""){?> <? }?> <table width="420" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="148" rowspan="2"><a href="editar_cod.php?id=<?=$dados['id']?>"><img src="./fotos/<? echo $dados['nomedoarquivo'];?>" width="148" height="111" border="0"></a></td> <td width="93" height="20" bgcolor="#CCCCCC">Título</td> <td width="179" height="20" bgcolor="#CCCCCC"><? echo $dados['titulo']?></td> </tr> <tr> <td height="91">Comentário</td> <td height="91"><? echo $dados['comentario']?></td> </tr> </table> <br> <? }} ?>
<? require("loga.php"); ?> <? include"config.php"; $id = $_GET['id']; $sql = mysql_query("SELECT * FROM fotos WHERE id='$id'"); $dados= mysql_fetch_array($sql); ?> <form name="form1" method="post" action="alterarcoment_cod.php?id=<?=$dados['id']?>"> <table width="420" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="148" rowspan="2"><a href="editar_cod.php?id=<?=$dados['id']?>"><img src="./fotos/<? echo $dados['nomedoarquivo'];?>" width="148" height="111" border="0"></a></td> <td width="93" height="20" bgcolor="#CCCCCC">Título</td> <td width="179" height="20" bgcolor="#CCCCCC"><input name="titulo" type="text" id="titulo" value="<? echo $dados['titulo']?>"></td> </tr> <tr> <td height="91" valign="top">Comentário</td> <td height="91" valign="top"><textarea name="comentario" id="textarea2"><? echo $dados['comentario']?></textarea></td> <td><input type="submit" name="Submit" value="Enviar já !"></td> </tr> </table> </form>
<? include"config.php"; $id = $_GET['id']; $titulo = $_POST['titulo']; $comentario = $_POST['comentario']; // agora iremos a parte que insere os valores pegos acima no db $dados = mysql_query("UPDATE fotos SET titulo='$titulo', comentario='$comentario' WHERE id='$id'"); if($dados){ echo"Dados alterados com sucesso"; }else{ echo"Algo deu errado..."; } ?>
Posted 02/09/2005, 13:27
<? require("loga.php"); ?> <? $user = $_SESSION["usuario"]; ?> <p>Olá <B><? print $_SESSION["usuario"]; ?></B>,<BR> Esta é a página de administração do projeto de flog que estou desenvolvendo..<BR> <BR> Meu Flog | <a href="enviar_foto.php">Enviar Foto</a> | <a href="editar.php">Editar Comentários</a> | <a href="editar_senha.php?usuario=<?=$user;?>">Alterar Senha</a> | Meus Favoritos | Meus Links | Cores e Fontes | <a href="logout.php">Sair </a></p>
<? require("loga.php"); ?> <? include"config.php"; $usuario = $_GET['usuario']; $sql = mysql_query("SELECT * FROM usuarios WHERE usuario='$usuario'"); $dados= mysql_fetch_array($sql); ?> <form name="form1" method="post" action="alterarsenha_cod.php?id=<?=$dados['id']?>"> <table width="420" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="35" rowspan="3"> </td> <td width="152" height="20" bgcolor="#CCCCCC">Senha antiga </td> <td width="164" height="20" bgcolor="#CCCCCC"><? echo $dados['senha']?></td> </tr> <tr> <td height="10" valign="top">Senha nova </td> <td height="10" valign="top"><input name="senhanova" type="password" id="senhanova"></td> <td width="69" rowspan="2"><input type="submit" name="Submit" value="Enviar já !"></td> </tr> <tr> <td height="10" valign="top">Confirme a senha nova </td> <td height="10" valign="top"><input name="senhanova2" type="password" id="senhanova2"></td> </tr> </table> </form>
<? require("loga.php"); ?> <? include"config.php"; if ( $senhanova != $senhanova2 ) { $errors .= "Você digitou 2 senhas diferentes. Eita, porque você fez isso ??<br>"; //adiciona o erro caso o usuário digitou 2 senhas diferentes } if ( $errors == "" ) { //checa se houve ou não erros no cadastro $senhanova = $_POST['senhanova']; $cadastrar = mysql_query("UPDATE usuarios SET senha='$senhanova' WHERE id='$id'"); if ( $cadastrar == 1 ) { echo "<div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif><br><br><br>Senha alterada com sucesso.</font></div>"; //se cadastrou com sucesso o usuário aparece essa mensagem } else { echo "<div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif><br><br><br>Ocorreu um erro no servidor ao tentar alterar sua senha.</font></div>"; //caso houver um erro quanto as configurações aparece essa mensagem } } else { echo "<div align=center><font size=2 face=Verdana, Arial, Helvetica, sans-serif>Ocorreu os seguintes erros ao tentar alterar sua senha:<br><br>$errors</font></div>"; //mostra os erros do usuário, caso houver } ?>
<html> <head> <title> </title> <style type="text/css"> <!-- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10px; } --> </style> </head> <body> <? include"config.php"; $sql = mysql_query("SELECT * FROM fotos order by id desc LIMIT 1"); ?> <? $total = mysql_num_rows($sql); $colunas = "1"; if ($total>0) { for ($i = 0; $i < $total; $i++) { if (($i%$colunas)==0) { ?> <? }?> <? $dados= mysql_fetch_array($sql); ?> <? if($dados['nomedoarquivo'] != ""){?> <? }?> <table width="770" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="160"> </td> <td width="300">//nome do flog </td> <td width="310"><div align="center" class="style1">administrar</div></td> </tr> </table> <table width="770" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="160" align="center" valign="top"><p>Fotos:</p> <p><iframe name="iframe_miniaturas" frameborder="0" width="160" height="600" marginheight="0" src="http://www.aconxegu.com.br/flog/miniaturas.php" scrolling="no"></iframe></p></td> <td width="450" align="center" valign="middle"><p> </p> <table width="420" height="1000" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle"><iframe name="exibe_foto" frameborder="0" width="420" height="1000" marginheight="0" src="foto_principal.php?nomedoarquivo=<?=$dados['nomedoarquivo']?>" scrolling="no"></iframe></td> </tr> </table> <p> </p> <p> </p> <p> </p></td> <td width="160"> </td> </tr> </table> <? }} ?> </body> </html>
or die(mysql_error());Hehe, aprendi Host !!!!!!!
Edição feita por: mi7chael, 02/09/2005, 13:56.
Posted 02/09/2005, 14:53
exit();
Posted 02/09/2005, 15:09
Hehe, mas eu adorei essa função, vc não faz idéia de como ela me ajudou, hehe.hhahahah
exit();
Tambem funciona da mesma forma de DIE()
Falopa!
Posted 02/09/2005, 15:19
// aki igual a antes if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $dir . $_FILES['arquivo']['name'])) { $nome_arquivo = $_FILES['arquivo']['name']; // apartir daki vem o comando para pegar a extenção do arquivo $tipo = explode(".",$nome_arquivo); // aki renomeia o arqvo ("nome antigo","novonome"), $dir eh a variável q especifica o diretório, está declarada no início do scrípt, ex: $dir="fotos/", ... como utilizei hora e data, declarei elas antes... e no final, $tipo[1], eh a array q guartou o tipo a extenção do arqvo.. rename("$dir$nome_arquivo", "$dir$ano$mes$dia$hra$min$seg-$user.$tipo[1]"); // e essa linha pega o novo nome do arqvo $arquivo = "$dir$ano$mes$dia$hra$min$seg-$user.$tipo[1]"; }
Edição feita por: vitorcarrara, 02/09/2005, 15:25.
Posted 02/09/2005, 15:25
Posted 02/09/2005, 15:29
<? header("Content-type: image/jpeg"); $im = imagecreatefromjpeg($_GET['imagem']); $image = imagerotate($im, 0, 0); $largurao = imagesx($image); $alturao = imagesy($im); $alturad = 75; $largurad = ($largurao*$alturad)/$alturao; $nova = imagecreatetruecolor($largurad,$alturad); imagecopyresampled($nova,$image,0,0,0,0,$largurad,$alturad,$largurao,$alturao); imagejpeg($nova); imagedestroy($nova); imagedestroy($image); ?>
Edição feita por: vitorcarrara, 02/09/2005, 15:31.
Posted 02/09/2005, 15:43
Posted 02/09/2005, 15:55
Posted 02/09/2005, 16:14
Posted 02/09/2005, 17:47
Posted 02/09/2005, 18:07
0 membro(s), 3 visitante(s) e 0 membros anônimo(s)