Ir para conteúdo
Fórum Script Brasil

locgames

Membros
  • Total de itens

    4
  • Registro em

  • Última visita

Sobre locgames

locgames's Achievements

0

Reputação

  1. desde a 1° vez já fiz isso, mas obrigado pela tentativa
  2. ele apenas não envia irei fazer este teste q você falo, e depois posto o resultado obrigado pela ajuda desde já fiz o teste e mesmo assim não chegou nada no meu email
  3. encontrei este codigo na net: envia_form.php <? ### EMAIL SENDER by Allan Peron ### $remetente = $_POST['Wremetente']; $destinatario = $_POST['Wdestinatario']; $assunto = $_POST['Wassunto']; $saida = $_POST['Wsaida']; $cabecalho ="Content-Type: text/plain; charset=iso-8859-1\n"; $cabecalho.="From:$remetente\n"; $cabecalho.="X-Mailer: WEBSITE CONTACT\n"; $msg = ""; $demilitador = "\n****************************************************\n"; while(list($campo, $valor) = each($_POST)) { // Monta msg if ($campo != "Submit" && $campo != "Wremetente" && $campo != "Wdestinatario" && $campo != "Wassunto" && $campo != "Wsaida" && !stristr($campo, 'image')) { // Imprime o CAMPO : VALOR $msg .= $campo . " : " . $valor . "" . $demilitador; } } mail($destinatario,$assunto,$msg,$cabecalho); Header("location: $saida"); ?> validacao.js function valida_form() { if (!text_validate('form1','Nome','Nome')) { return false; } if (!text_validate('form1','Telefone','Telefone')) { return false; } if (!text_validate('form1','E-Mail','E-Mail')) { return false; } if (!text_validate('form1','Assunto','Assunto')) { return false; } if (!text_validate('form1','Mensagem','Mensagem')) { return false; } } function onlyNumber(ev) { if (ev.keyCode < 45 || ev.keyCode > 57) ev.returnValue = false; } function valueFormat(Obj,lengLimit,Event) { var keypress = Event.keyCode; var val = Obj.value; var minusFlag = false; while (val.indexOf(" ") != -1) { val = val.replace(" ",""); } while (val.indexOf(",") != -1) { val = val.replace(",",""); } while (val.indexOf(".") != -1) { val = val.replace(".",""); } while (val.indexOf("-") != -1) { val = val.replace("-",""); minusFlag = true;} len = val.length; if (len < lengLimit && keypress != 8) { len++; } if (keypress == 8 ) { len--; } if (keypress == 8 || keypress >= 48 && keypress <= 57 || keypress >= 96 && keypress <= 105 ) { if ( len <= 2 ) { Obj.value = val; } else { val = insert(val,1,','); len = val.length; for (pos=5; pos < len; pos += 3) { val = insert(val,pos,'.'); len = val.length; pos++; } if (minusFlag) { val = "-" + val; } Obj.value = val; } } } function insert(str,pos,chr) { leng = str.length return str.substr(0,leng - pos) + chr + str.substr(leng - pos,len); } /* INTEGRATIVA - Internet Results - http:// www.integrativa.com.br : info@integrativa.com.br Herbert Anderson - há - tecnologia@integrativa.com.br [programador] */ /* Retorna false caso um campo texto for igual a espaco em branco. Essa funcao recebe 3 parametros: formulario -- O NAME do form para ser validado, um string campo -- O NAME do campo do tipo text ou password para ser checked, um string rotulo -- O nome do campo como será mostrado na mensagem no caso de erro, um string Exemplo de uso: text_validate('mainform','tx_nome','Nome da empresa'); */ function text_validate(formulario,campo,rotulo){ if(document[formulario][campo].value == "" ){ document[formulario][campo].focus(); alert('Especifique '+rotulo+'.'); return false; } return true; } /* Retorna false caso um campo do tipo select for igual a zero. Essa funcao recebe 3 parametros: formulario -- O NAME do form para ser validado, um string campo -- O NAME do campo do tipo select para ser checked, um string rotulo -- O nome do campo como será mostrado na mensagem no caso de erro, um string Exemplo de uso: select_validate('mainform','estado','Estado'); */ function select_validate(formulario,campo,rotulo){ if(document[formulario][campo].selectedIndex == "0" ){ document[formulario][campo].focus(); alert('Especifique '+rotulo+'.'); return false; } return true; } function text_len_validate(formulario,campo,rotulo,min,max){ if(document[formulario][campo].value.length < min ){ document[formulario][campo].focus(); alert(rotulo+' deve conter no mínimo '+ min + ' dígitos'); return false; } if(document[formulario][campo].value.length > max ){ document[formulario][campo].focus(); alert(rotulo+' deve conter no máximo '+ max + ' dígitos'); return false; } return true; } // funcao que checa se o e-mail e valido // function checkMail(formulario,campo,rotulo) { var y = 0; if (!text_validate(formulario,campo,rotulo)) { return false; } x = document[formulario][campo].value; if (x.substring(x.length -1, x.length) != '.' && x.substring(x.length -1, x.length) != '@') { if (x.indexOf("@") != -1) { if (x.indexOf(".") != -1) { y = 1; } } } if (y == 0) { document[formulario][campo].focus(); alert('O campo e-mail não parece ser válido!'); return false; } return true; } /* Retorna false caso nenhum campo do tipo radio for selecionado. Essa funcao recebe 3 parametros: formulario -- O NAME do form para ser validado, um string campo -- O NAME do campo do tipo radio para ser checked, um string rotulo -- O nome do campo como será mostrado na mensagem no caso de erro, um string Exemplo de uso: radio_validate('mainform','opcao','Opção'); */ function radio_validate(formulario,campo,rotulo) { var result = false; for (var i=0; i<document[formulario][campo].length; i++){ if (document[formulario][campo][i].checked) { result = true; } } if (!result){ alert('Selecione uma opção para "' + rotulo +'".'); document[formulario][campo][0].focus(); } return result; } contato.html <!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"> &lt;script type="text/javascript" src="validacao.js"></script> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title></title> </head> <body> <table width="41%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><form action="envia_form.php" method="post" name="form1" id="form1" onSubmit="return valida_form()"> <table width="100%" border="0" cellpadding="2" cellspacing="2"> <tr valign="top"> <td width="42%" align="center" background="file:///C|/Users/Beto/Downloads/formulario_bnw/imagens/fnd.jpg" class="formulario"><div align="right" class="textoNormal">Nome:</div></td> <td width="58%"><div align="left"><strong> <input name="Nome" type="text" class="formulario_preenchimento" id="Nome" size="40" /> </strong></div></td> </tr> <tr valign="top"> <td align="center" background="file:///C|/Users/Beto/Downloads/formulario_bnw/imagens/fnd.jpg" class="formulario"><div align="right" class="textoNormal">E-mail:</div></td> <td><div align="left"><strong> <input name="Email" type="text" class="formulario_preenchimento" id="Email" size="40" /> </strong></div></td> </tr> <tr valign="top"> <td align="center" background="file:///C|/Users/Beto/Downloads/formulario_bnw/imagens/fnd.jpg" class="formulario"><div align="right" class="textoNormal"> Telefone: </div></td> <td><div align="left"><strong> <input name="Telefone" type="text" class="formulario_preenchimento" id="Telefone" size="15" /> </strong></div></td> </tr> <tr valign="top"> <td align="center" background="file:///C|/Users/Beto/Downloads/formulario_bnw/imagens/fnd.jpg" class="formulario"><div align="right" class="style41"><span class="linkpreto">Mensagem:</span><br /> <br /> </div></td> <td><strong> <textarea name="Mensagem" cols="30" rows="5" wrap="virtual" class="formulario_preenchimento" id="Mensagem"></textarea> </strong></td> </tr> <tr> <td height="30">&nbsp;</td> <td valign="middle"><div align="right"><strong> <input name="Wremetente" type="hidden" id="Wremetente" value="dominio@gmail.com" /> <input name="Wdestinatario" type="hidden" id="Wdestinatario" value="dominio@gmail.com" /> <input name="Wassunto" type="hidden" id="Wassunto" value="Contato enviado do site X" /> <input name="Wsaida" type="hidden" id="Wsaida" value="formulario.html" /> <input type="submit" name="Submit2" value="Enviar" class="formulario_preenchimento" /> </strong></div></td> </tr> </table> </form></td> </tr> </table> <form action="enviar_formulario.php" method="post"> Nome:<br /> <input type="text" name="nome" /> E-mail:<br /> <input type="text" name="email" /> Mensagem:<br /> <textarea name="mensagem" cols="32" rows="8"></textarea><br /> <input type="submit" value="Enviar" /> <form> so que ele não envia para o email que coloco, alguém poderia me ajudar aonde esta o erro? so leigo em php, agradeçoa ajuda de todos desde já
  4. locgames

    Ajuda em script php

    Bom comprei um curso q ensina a fazer um portal de noticas so q ele apenas coloca na pagina principal a ultima noticia cadastrada, e gostaria de coloca mais de uma noticias na pgina principal Ex: 1° Noticias 2° Noticias 3° noticas.. <?php require_once('Connections/connDB.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_connDB, $connDB); $query_rsUltimaNoticia = "SELECT n.intNotID, n.strNotTitle, n.strNotText, n.strNotImage, n.intNotViews, n.strNotDateCad, c.strCatTitle, u.strUsrName FROM pn_noticias AS n INNER JOIN pn_noticias_categorias AS c ON n.intCatID = c.intCatID INNER JOIN pn_usuarios AS u ON n.intUsrID = u.intUsrID WHERE n.strNotStatus = 'on' AND n.strNotHome = 'yes' ORDER BY n.intNotID DESC"; $rsUltimaNoticia = mysql_query($query_rsUltimaNoticia, $connDB) or die(mysql_error()); $row_rsUltimaNoticia = mysql_fetch_assoc($rsUltimaNoticia); $totalRows_rsUltimaNoticia = mysql_num_rows($rsUltimaNoticia); mysql_select_db($database_connDB, $connDB); $query_rsUltimasNoticias = "SELECT intNotID, strNotTitle FROM pn_noticias WHERE intNotID <> {$row_rsUltimaNoticia['intNotID']} ORDER BY intNotID DESC LIMIT 5"; $rsUltimasNoticias = mysql_query($query_rsUltimasNoticias, $connDB) or die(mysql_error()); $row_rsUltimasNoticias = mysql_fetch_assoc($rsUltimasNoticias); $totalRows_rsUltimasNoticias = mysql_num_rows($rsUltimasNoticias); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="alternate" type="application/rss+xml" title="Feed RSS das notícias recentes" href="http://endereco-site.com.br/rss.php" /> <title>Portal de Notícia</title> </head> <body> <h1><?php echo $row_rsUltimaNoticia['strNotTitle']; ?></h1> <p><?php echo date( 'd/m/Y H:i', strtotime($row_rsUltimaNoticia['strNotDateCad'])); ?> por <?php echo $row_rsUltimaNoticia['strUsrName']; ?> em <?php echo $row_rsUltimaNoticia['strCatTitle']; ?></p> <?php if ( file_exists( 'fotos-noticias/' . str_replace( '.jpg', '.thumb.jpg', $row_rsUltimaNoticia['strNotImage'])) ) : ?> <p><img src="fotos-noticias/<?php echo str_replace( '.jpg', '.thumb.jpg', $row_rsUltimaNoticia['strNotImage']); ?>" alt="<?php echo $row_rsUltimaNoticia['strNotText']; ?>" /></p> <?php else : ?> <p><img src="fotos-noticias/sem-foto.jpg" alt="" /></p> <?php endif; ?> <p><?php echo $row_rsUltimaNoticia['strNotText']; ?></p> <p><a href="noticia.php?intNotID=<?php echo $row_rsUltimaNoticia['intNotID']; ?>">Comente esta notícia</a></p> <h2>Últimas notícias</h2> <ol> <?php do { ?> <li><a href="noticia.php?intNotID=<?php echo $row_rsUltimasNoticias['intNotID']; ?>"><?php echo $row_rsUltimasNoticias['strNotTitle']; ?></a></li> <?php } while ($row_rsUltimasNoticias = mysql_fetch_assoc($rsUltimasNoticias)); ?> </ol> </body> </html> <?php mysql_free_result($rsUltimaNoticia); mysql_free_result($rsUltimasNoticias); ?> já tentei de todas as maneiras q imaginei, so não achei ao certo aonde que ele diz q so a ultima noticias deve ir na home se alguém puder ajudar agradeço desde já Bom pelo q eu estava lendo é esta opção ORDER BY n.intNotID DESC"; q faz com quem so a ultima noticia seja exibida na pagina principal alguém teria alguma ideia como posso substituir ela? porque ate onde eu olhei order by ou pode ser apenas desc, ou asce plz uma ajudinha ai já to fikando com cabelo branco :)
×
×
  • Criar Novo...