Ir para conteúdo
Fórum Script Brasil

Brandow

Membros
  • Total de itens

    35
  • Registro em

  • Última visita

Sobre Brandow

Brandow's Achievements

0

Reputação

  1. Olha eu fiz um formulário que cadastra usuários mais os dados não são levados para a DB o codigo php é este. No formulário de cadastro o form está declarado com a pagina abaixo e todas as names são correspondentes as variaveis <?php include "config.php"; if(!empty($_POST["login"]) && !empty($_POST["senha"]) && !empty($_POST["email"])){ if(filter_var($_POST["email"],FILTER_VALIDATE_EMAIL)) { $login = $_POST["login"]; $senha = $_POST["senha"]; $email = $_POST["email"]; $ip = $_SERVER["REMOTE_ADDR"]; $hotel = $_POST["hotel"]; $url = $_POST["url"]; $iphotel = $_POST["iphotel"]; $port = $_POST["port"]; $versao = $_POST["versao"]; $idioma = $_POST["idioma"]; $tipo = $_POST["tipo"]; $senha_sha1 = sha1($senha); $repeat_user = mysql_query("SELECT * FROM `cadastro` WHERE nome='$login';") or die("Erro: <br />".mysql_error()); if(mysql_num_rows($repeat_user) > 0 || mysql_num_rows("SELECT * FROM `cadastro` WHERE email = '$email'") > 0) { $mensagem_erro = "Já existe um usuário com este nome/e-mail."; } else { $insert = mysql_query("INSERT INTO `cadastro`(id,login,senha_sha1,email,ip,hotel,url,iphotel,port,versao,idioma,tipo) values ('','$login','$senha_sha1','$email','$ip','$hotel','$url','$iphotel','$port','$versao','$idioma','$tipo')") or die(mysql_error()); if($insert){ die("Registro concluído com sucesso.<script>top.location = 'login.php';</script>"); } } } } ?>
  2. Acho que é essa: function Contains($str, $words, $filter = false) { $return = false; if ($filter) { $str = strtolower($str); $words = strtolower($words); } if (@strpos($str, $words) === false) { $return = false; } else { $return = true; } $getWords = explode(",", str_replace(" ", "", $words)); foreach ($getWords as $Word) { if (!$return) { if (@strpos($str, $Word) === false) { $return = false; } else { $return = true; } } } return $return; }
  3. Não sei o sistema já veio assim, mas acho que nada
  4. Poderia ver meu código e ver oque pode está errado? <?php if (!defined('IN_HK') || !IN_HK) { exit; } if (!HK_LOGGED_IN || !$users->hasFuse(USER_ID, 'fuse_housekeeping_sitemanagement')) { exit; } if (isset($_POST['content'])) { $title = filter($_POST['title']); $teaser = filter($_POST['teaser']); $topstory = WWW . '/images/ts/' . filter($_POST['topstory']); $content = $_POST['content']; $seoUrl = filter($_POST['url']); $category = intval($_POST['category']); if (strlen($seoUrl) < 1 || strlen($title) < 1 || strlen($teaser) < 1 || strlen($content) < 1) { fMessage('error', 'escreva todos os dados.'); } else { dbquery("INSERT INTO site_news (title,category_id,seo_link,topstory_image,body,snippet,datestr,timestamp) VALUES ('" . $title . "','" . $category . "','" . $seoUrl . "','" . $topstory . "','" . $content . "','" . $teaser . "','" . date('d-M-Y') . "', '" . time() . "')"); fMessage('ok', 'Noticia Criada.'); header("Location: index.php?_cmd=news"); exit; } } require_once "top.php"; ?> <script type="text/javascript"> function previewTS(el) { document.getElementById('ts-preview').innerHTML = '<img src="<?php echo WWW; ?>/images/ts/' + el + '" />'; } function suggestSEO(el) { var suggested = el; suggested = suggested.toLowerCase(); suggested = suggested.replace(/^\s+/, ''); suggested = suggested.replace(/\s+$/, ''); suggested = suggested.replace(/[^a-z 0-9]+/g, ''); while (suggested.indexOf(' ') > -1) { suggested = suggested.replace(' ', '-'); } document.getElementById('url').value = suggested; } </script> <h1>Criar nova Notícia</h1> <form method="post"> <br /> <div style="float: left;"> <strong>Titulo:</strong><br /> <input type="text" value="<?php if (isset($_POST['title'])) { echo clean($_POST['title']); } ?>" name="title" onkeyup="suggestSEO(this.value);" style="padding: 5px; width:400; height:25; "><br /> <br /> <strong>Categoria:</strong><br /> <select name="category"> <?php $getOptions = dbquery("SELECT * FROM site_news_categories ORDER BY caption ASC"); while ($option = mysql_fetch_assoc($getOptions)) { echo '<option value="' . intval($option['id']) . '" ' . (($option['id'] == $_POST['category']) ? 'selected' : '') . '>' . clean($option['caption']) . '</option>'; } ?> </select><br /> <br /> <strong>URL-Notícia:</strong><br /> <div style="border: 1px dotted; width: 300px; padding: 5px;"> <?php echo WWW; ?>/[id]-<input type="text" id="url" name="url" value="<?php if (isset($_POST['url'])) { echo clean($_POST['url']); } ?>" maxlength="120">/<br /> </div> <small>Isso é uma Pequena Atualização de como ficará o link da sua nótícia</small><br /> <br /> <strong>Um pequeno Texto(Frase de Efeito da nóticia):</strong><br /> <textarea name="teaser" cols="48" rows="5" style="padding: 5px; font-size: 120%;"><?php if (isset($_POST['teaser'])) { echo clean($_POST['teaser']); } ?></textarea><br /> <br /> <strong>Topstory Imagem:</strong><br /> <select onkeypress="previewTS(this.value);" onchange="previewTS(this.value);" name="topstory" id="topstory" style="padding: 5px; font-size: 120%;"> <?php if ($handle = opendir(CWD . '/images/ts')) { while (false !== ($file = readdir($handle))) { if ($file == '.' || $file == '..') { continue; } echo '<option value="' . $file . '"'; if (isset($_POST['topstory']) && $_POST['topstory'] == $file) { echo ' selected'; } echo '>' . $file . '</option>'; } } ?> </select> </div> <div id="ts-preview" style="margin-left: 20px; padding: 10px; float: left; text-align: center; vertical-align: middle;"> <small>(Selecione a imagem TopStory para sua nóticia, que irá automáticamente irá aparecer para você ver a imagem escolhida)</small> </div> <div style="clear: both;"></div> <br /><br /> <script type="text/javascript" src="./tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ mode : "exact", elements : "content", theme : "advanced", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_resizing : true, theme_advanced_statusbar_location : "bottom" }); </script> <textarea id="content" name="content" style="width:80%"><?php if (isset($_POST['content'])) { echo clean($_POST['content']); } ?></textarea> <br /> <br /> <input type="submit" value="Criar"> </form> <?php require_once "bottom.php"; ?>
  5. Olá amigo eu retirei a variavel mais ainda não foi
  6. Olá eu tenho um sistema de noticias em que eu uso o "tiny_mce" como editor de texto para o textarea, mas quando eu tento enviar imagens, ou colocar Bold, italic no texto nenhum funciona o que poderia ser? o campo no banco de dados? ou o tipo de variavel pois eu declarei a variavel que recebe os dados e envia como $content = htmlspecialchars($_POST['content']);
  7. Aff nem, para que serve então esse "serviço grátis no fórum" se tem que pagar para eu ser ajudado em uma coisas que vocês "Sabixoes" podem fazer em menos de 1 minuto esquece feche o tópico.
  8. Se nem de graça vocÊs ajudam imagina pagando.
  9. alguém ajuda por favor preciso disso urgente!!!
  10. olá eu tenho um sistema de contador de links, mas gostaria de saber como eu aplico o coockie que só conta, a cada 24 horas por ip, por exemplo esse coockie que eu gostaria de aplicar, só que não sei como faz isso. setcookie("$cookie_name", $_SERVER['REMOTE_ADDR'], time()+86400); aqui está o codigo do meu sistema <?php // Check if the ID was submitted, AND if it is numeric (a number) if (isset($_GET['id']) && is_numeric($_GET['id'])) { // Connect to our database require_once('mysql_connect.php'); $id = mysql_real_escape_string($_GET['id']); // Add 1 to the sites hits $query = "UPDATE dados_usuarios SET hits = hits + 1 WHERE id = $id"; $result = mysql_query($query) OR die(mysql_error()); unset($query); unset($result); $query = "SELECT id, url, name, blok, votes, hits, description FROM dados_usuarios WHERE id = $id"; $result = mysql_query($query) OR die(mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $num = mysql_num_rows($result); $url = $row['url']; $name = $row['name']; $blok = $row['blok']; $votes = $row['votes']; $hits = $row['hits']; $description = $row['description']; if ($blok == 1) { echo "olá";} if ($blok == 2) { echo "olá"; } if ($num > 0) if ($blok == 0) { echo "você votou "; }else { echo ''; } } else { echo ''; } ?>
  11. acho que não pelo que eu me lembre fiz os campos somente definindo varchar nada mais, e o id com auto increment só isso @edit agora que me lembrei não declarei int no campo obrigado por ajudar :D
  12. Olha eu estou com um sistema que exibe os resultados da DB de acordo com o numero de votos, mas só que está dando um erros não fica na ordem certa está definido como DESC mais não exibe em ordem decrescente. <?php // Connect to our database require_once('mysql_connect.php'); // Select sites from the database - limit to the top 50 sites $query = "SELECT * FROM dados_usuarios ORDER BY votes desc limit 10"; $result = mysql_query($query) OR die(mysql_error()); echo ''; // Start the rank counter $rank = 1; while ($mostrar = mysql_fetch_array($result, MYSQL_ASSOC)) { $name = $mostrar['name']; $url = $mostrar['url']; $port = $mostrar['port']; $hits = $mostrar['hits']; $votes = $mostrar['votes']; $ID = $mostrar['ID']; $versao = $mostrar['versao']; $ip = $mostrar['ip']; $pais = $mostrar['pais']; $description = $mostrar['description']; echo "<div id=contentBox> <table width=501 height=26 border=0> <tr> <td width=17><img src=http://server.blackoutgaming.net:8022/status/?dns=$ip&port=$port&style=1 /></td> <td width=214><a href=vote.php?id=$ID target=_blank><img src=http://icons.iconarchive.com/icons/deleket/sleek-xp-basic/16/Add-icon.png border=0><a href=abrir.php?id=$ID target=_blank title=$description>$name</a></td> <td width=175><span class=style3>| </span><img src=$pais ><span class=style3> |</span><span class=style2> $versao </span><span class=style3>|</span> <span class=style3>Votos: $votes | </span></td> <td width=77><a href=abrir.php?id=$ID target=_blank title=$description><img src=http://yourimg.in/m/065r38c.png border=0 width=75 height=25></a></td> </tr> </table> </div>"; } ?></center>
  13. Estou com esse erro quando eu vou votar no meu sistema de votação, quando o arquivo estava no vertrigo (programa de suporte php com mysql) da certo, mas quando eu ponho na minha hospedagem da esse erro. e também parece que o coockie não está funcionando pois eu consigo votar toda hora, só que sempre da esse erro <head> <title>Top habbos - Votar</title> </head> <?php // If the user hasn't said they are sure they want to vote. if (!isset($_POST['submitted'])) { // Check if the ID was submitted, AND if it is numeric (a number) if (isset($_GET['id']) && is_numeric($_GET['id'])) { // Connect to our database require_once('mysql_connect.php'); $id = mysql_real_escape_string($_GET['id']); $query = "SELECT id, name FROM dados_usuarios WHERE id = $id"; $result = mysql_query($query) OR die (mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <style type="text/css"> <!-- .style2 {font-size: 24px} --> </style> </head> <body> <link rel="stylesheet" type="text/css" href="../css/main.css" /> <link rel="stylesheet" type="text/css" href="../css/button.css" /> <script type="text/javascript" language="javascript" src="../lytebox.js"></script> <link rel="stylesheet" href="../lytebox.css" type="text/css" media="screen" /> <style> body{ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; background-image:url(http://yourimg.in/m/146a59y.png); background-repeat:repeat-yx} #contentBox { border: 1px solid #CCC; border-radius: 5px; -moz-border-radius: 5px; -o-border-radius: 5px; -webkit-border-radius: 5px; margin-bottom: 20px; border-bottom: 3px solid #CCC; } #div { float: center; padding: 5px; border: 1px solid #CCC; border-radius: 5px; -moz-border-radius: 5px; -o-border-radius: 5px; -webkit-border-radius: 5px; margin-bottom: 20px; border-bottom: 3px solid #CCC; background-color:#FFFFFF; height: 500px; width: 1000px; } h1 { color: #FFF; font-size: 16px; text-shadow: 1px 1px #000; margin-bottom: 0px; } h2 { color: #FFF; font-size: 20px; text-shadow: 1px 1px black; margin-bottom: 3px; } h3 { color: #FFF; font-size: 20px; text-shadow: 1px 1px black; padding-bottom: 0px; margin-bottom: -3px; margin-top: -2px; } h1 a:link, hover { color: #FFF; } h3 a:link, hover { color: #FFF; padding-left: 15px; } </style> <center><div id="div" style=" width: 650px; height:500px; left: 32px; top: 10px;"> <p align="center"><img src="../logo.png" width="563" height="122"></p> <div style="height:1px; background-color:#CCCCCC"></div> <span class="style2">Olá, bem vindo ao Top habbos, aqui você pode divulgar seu servidor de Habbo e conseguir vários usuários para ele. <br><br> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <input type="submit" name="vote" value="Votar no <?php echo $row['name']; ?>" /> <input type="hidden" name="submitted" value="TRUE" /> <input type="hidden" name="id" value="<?php echo $row['id']; ?>" /> </form></span><br> <script type="text/javascript"><!-- google_ad_client = "ca-pub-7156540650710403"; /* Top abbos */ google_ad_slot = "9099004702"; google_ad_width = 250; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></div> </center> </body> </html> <br /> <?php } else { echo '<center><div id="div" style=" width: 650px; height:500px; left: 32px; top: 10px;"> <p align="center"><img src="../logo.png" width="563" height="122"></p> <div style="height:1px; background-color:#CCCCCC"></div> <span class="style2">Você tem que escolher o Hotel para votar</div> </center>'; } } else { // Connect to our database require_once('mysql_connect.php'); $id = mysql_real_escape_string($_POST['id']); // Select the site we want to add 1 vote to $query = "SELECT id, votes, name FROM dados_usuarios WHERE id = $id"; $result = mysql_query($query) OR die(mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $votes = $row['votes']; $id = $row['id']; $name = $row['name']; $cookie_name = 'vote_'.$id; if (!isset($_COOKIE['vote_'.$id])) { // Add 1 to the previous hit amount $votes++; // Update our websites hit amount $query = "UPDATE dados_usuarios SET votes = $votes WHERE id = $id"; $result = mysql_query($query) OR die(mysql_error()); setcookie("$cookie_name", $_SERVER['REMOTE_ADDR'], time()+86400); echo '<center><div id="div" style=" width: 650px; height:500px; left: 32px; top: 10px;"> <p align="center"><img src="../logo.png" width="563" height="122"></p> <div style="height:1px; background-color:#CCCCCC"></div> <span class="style2">Obrigado por Votar neste hotel!</div> </center></a><head><meta http-equiv="refresh" content="1; url=../index.php"></head>'; } else { echo '<center><div id="div" style=" width: 650px; height:500px; left: 32px; top: 10px;"> <p align="center"><img src="../logo.png" width="563" height="122"></p> <div style="height:1px; background-color:#CCCCCC"></div> <span class="style2">Você já votou hoje, volte amanhã</div> </center></a><head><meta http-equiv="refresh" content="1; url=../index.php"></head>'; } } ?>
  14. kkkkkk como sou besta, esqueci do mínimo detalhe :D obrigado.
×
×
  • Criar Novo...