- Fórum WMO
- → Inu_yasha's Content
Inu_yasha's Content
There have been 263 items by Inu_yasha (Search limited from 29/03/2023)
#631073 Contador Em Php
Posted by Inu_yasha on 29/08/2005, 13:54 in PHP
<? include "config.php"; $counter = mysql_query("SELECT * FROM $tabela ORDER BY $s DESC", $db); if ( $counter == 1 ) { $cadastrar = mysql_query("UPDATE $tabela SET count + 1 WHERE s = '$s'", $db); $x = mysql_fetch_array($counter); $coun = $x["count"]; echo " $coun "; } else { $cadastrar = mysql_query("INSERT INTO $tabela (s, count) VALUES ('$s', '1')", $db); $x = mysql_num_rows($counter); $coun = $x["count"]; echo " $coun "; } ?>erro de numrows na linha 13...
$x = mysql_num_rows($counter);
ja tentei por o fetch array, mas deu erro...
alguma solucao?
#627680 Contador De Cliques
Posted by Inu_yasha on 20/08/2005, 11:50 in HTML, CSS e Metodologias
<script> function soma(div,c){ x=1+c; texts=document.getElementById(div); texts.innerHTML = x; } </script> <body> <a href='#' onClick="soma('resultado',+1)">soma</a> <div id="resultado"></div>aqui fica so no dois mesmo.
#627431 Caracteres..
Posted by Inu_yasha on 19/08/2005, 15:55 in HTML, CSS e Metodologias
http://darkness.6te.net/ask/faq.php
#627426 Caracteres..
Posted by Inu_yasha on 19/08/2005, 15:45 in HTML, CSS e Metodologias
#627334 Caracteres..
Posted by Inu_yasha on 19/08/2005, 12:50 in HTML, CSS e Metodologias
troquei o charset e NÃO DEU CERTO.
#627152 Caracteres..
Posted by Inu_yasha on 18/08/2005, 21:19 in HTML, CSS e Metodologias
#627142 Caracteres..
Posted by Inu_yasha on 18/08/2005, 21:02 in HTML, CSS e Metodologias
http://darkness.6te.net/ask/faq.php
o que eu faço para arrumar?
#626158 If
Posted by Inu_yasha on 16/08/2005, 19:31 in PHP
querem uma prova que eu nao coloquei aquele tal email?
http://forum.wmonlin...howtopic=121194
tá aqui, leiam embaixo...
#626113 If
Posted by Inu_yasha on 16/08/2005, 18:22 in PHP
$cadastrar = mysql_query("INSERT INTO news (nome, email) VALUES ('$nome', '$email')", $db); = cadastra no bd o email e o nome, eh so ler a função ¬¬
if( $email ) foi o felipensp q arrumo o cod q n tava funcionando com o ER de validar email, ai ele colocou isso...
#626076 If
Posted by Inu_yasha on 16/08/2005, 17:23 in PHP
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <form action="cad.php" method="post"> <table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="12%"><font size="1" face="Verdana">Seu Nome:</font></td> <td width="88%"><font size="1" face="Verdana"> <input name="nome" type="text" id="nome" class="f1"> </font></td> </tr> <tr> <td><font size="1" face="Verdana">Seu E-mail:</font></td> <td><font size="1" face="Verdana"> <input name="email" type="text" id="email" class="f1"> </font></td> </tr> <tr> <td> </td> <td><input name="opcao" type="radio" value="cad"><font size="2">Cadastrar</font></td> </tr> <tr> <td> </td> <td><input name="opcao" type="radio" value="del"><font size="2">Descadastrar</font></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Cadastrar" class="f1"></td> </tr> </table> </form> </body> </html>ai tá o formulario para você se cadastrar. custa voltar paginas acima e ver o form? o method eh post.
#626072 If
Posted by Inu_yasha on 16/08/2005, 17:16 in PHP
<?php include "config.php"; $nome = $_POST['nome']; $email = $_POST['email']; if( eregi('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email) ) { $cadastrar = mysql_query("INSERT INTO news (nome, email) VALUES ('$nome', '$email')", $db); } if( $email ) { echo "<script>window.alert('Email cadastrado com sucesso.'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; } else { echo "<script>window.alert('Houve um erro ao tentar cadastrar seu email. Tente novamente!'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; } ?>sem akeles if de opcao e talz ele funciona normal.... dai eu adicionei os if de opcao pra escolher se quer adicionar ou deletar o email da news!
#626064 If
Posted by Inu_yasha on 16/08/2005, 17:03 in PHP
<?php include "config.php"; $nome = $_POST['nome']; $email = $_POST['email']; if ($opcao == 'cad') { if( eregi('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email) ) { $cadastrar = mysql_query("INSERT INTO news (nome, email) VALUES ('$nome', '$email')", $db); } if( $email ) { echo "<script>window.alert('Email cadastrado com sucesso.'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; } else { echo "<script>window.alert('Houve um erro ao tentar cadastrar seu email. Tente novamente!'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; } } if ($opcao == 'del') { $del = mysql_query("DELETE from news (nome, email) VALUES ('$nome', '$email')", $db); } ?>eu ja tentei d td, os campos, tem o mesmo nome, mas a pag fik em branco...
pag q cadastra:
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <form action="cad.php" method="post"> <table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="12%"><font size="1" face="Verdana">Seu Nome:</font></td> <td width="88%"><font size="1" face="Verdana"> <input name="nome" type="text" id="nome" class="f1"> </font></td> </tr> <tr> <td><font size="1" face="Verdana">Seu E-mail:</font></td> <td><font size="1" face="Verdana"> <input name="email" type="text" id="email" class="f1"> </font></td> </tr> <tr> <td> </td> <td><input name="opcao" type="radio" value="cad"><font size="2">Cadastrar</font></td> </tr> <tr> <td> </td> <td><input name="opcao" type="radio" value="del"><font size="2">Descadastrar</font></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Cadastrar" class="f1"></td> </tr> </table> </form> </body> </html>faz um mes q n consigo, nem com a documentacao do php eu consegui...
#624992 Função Em Js Que Verifique Qual O Navegador
Posted by Inu_yasha on 13/08/2005, 08:54 in HTML, CSS e Metodologias
#624761 Função Em Js Que Verifique Qual O Navegador
Posted by Inu_yasha on 12/08/2005, 15:43 in HTML, CSS e Metodologias
#623023 Validate_email()
Posted by Inu_yasha on 06/08/2005, 23:56 in Artigos, Dicas e Tutoriais de PHP
#623016 Validate_email()
Posted by Inu_yasha on 06/08/2005, 23:10 in Artigos, Dicas e Tutoriais de PHP
if(eregi( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', ($email)) { $cadastrar = mysql_query("INSERT INTO news (nome, email) VALUES ('$nome', '$email')", $db);
<?php include "config.php"; $nome = $_POST["nome"]; $email = $_POST["email"]; if(eregi( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', ($email)) { $cadastrar = mysql_query("INSERT INTO news (nome, email) VALUES ('$nome', '$email')", $db); } if($email) { echo "<script>window.alert('Email cadastrado com sucesso.'); </script>"; echo "<script>window.location = 'java script:history.go(-1);'</script>"; } else { echo "<script>window.alert('Houve um erro ao tentar cadastrar seu email. Tente novamente!'); </script>"; echo "<script>window.location = 'java script:history.go(-1);'</script>"; } ?>
Parse error: parse error, unexpected '{' in c:\appserv\www\news\upload\cad.php on line 7!
mas porque isso? o q eu fiz de errado?
#623008 Validate_email()
Posted by Inu_yasha on 06/08/2005, 22:42 in Artigos, Dicas e Tutoriais de PHP
<?php include "config.php"; $nome = $_POST["nome"]; $email = $_POST["email"]; $cadastrar = mysql_query("INSERT INTO news (nome, email) VALUES ('$nome', '$email')", $db); if(eregi( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', ($email)) { if($cadastrar) { echo "<script>window.alert('Email cadastrado com sucesso.'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; } else { echo "<script>window.alert('Houve um erro ao tentar cadastrar seu email. Tente novamente!'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; } ?>so da erro.
Parse error: parse error, unexpected '{' in c:\appserv\www\news\upload\cad.php on line 14!
#622895 Validate_email()
Posted by Inu_yasha on 06/08/2005, 13:15 in Artigos, Dicas e Tutoriais de PHP
function validate_email( $email ) { return ( eregi( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email ) ); } $cadastrar = mysql_query("INSERT INTO news (nome, email) VALUES ('$nome', '$email')", $db); if($cadastrar) { echo "<script>window.alert('Email cadastrado com sucesso.'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; } else { echo "<script>window.alert('Houve um erro ao tentar cadastrar seu email. Tente novamente!'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; }ficaria assim:
function validate_email( $email ) { return ( eregi( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email ) ) { $cadastrar = mysql_query("INSERT INTO news (nome, email) VALUES ('$nome', '$email')", $db); if($cadastrar) { echo "<script>window.alert('Email cadastrado com sucesso.'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; } else { echo "<script>window.alert('Houve um erro ao tentar cadastrar seu email. Tente novamente!'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; } else { echo " email invalido"; }
??
#622838 Validate_email()
Posted by Inu_yasha on 06/08/2005, 09:22 in Artigos, Dicas e Tutoriais de PHP
$nome = $_POST["nome"]; $email = $_POST["email"]; function validate_email( $email ) { return ( eregi( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email ) ); } $cadastrar = mysql_query("INSERT INTO news (nome, email) VALUES ('$nome', '$email')", $db); if($cadastrar) { echo "<script>window.alert('Email cadastrado com sucesso.'); </script>"; echo "<script>window.location = 'javascript:history.go(-1);'</script>"; }
eu n consigo inserir isso:
<?php echo "Email " . (validate_email("guilhermeblanco@dominio.com.br") ? "válido" : "inválido"); ?>simplesmente não sei onde inserir. e nao entendi o q mais tem q modificar!
- Fórum WMO
- → Inu_yasha's Content
- Privacy Policy
- Regras ·