Ir para conteúdo
Fórum Script Brasil

filipiarruda

Membros
  • Total de itens

    39
  • Registro em

  • Última visita

Posts postados por filipiarruda

  1. Amigo, use seções para verificar se usuários estão ativos no sistema, os usuários do Bando de Dados, devem ser criados apenas quando outras pessoas forem fazer alterações ou administrar o banco de dados. Para exibir se o usuário está online, eu nunca fiz isso ainda, criae um log dos usuários, assim poderá manter também até mesmo por questões de segurança, registros de tudo que foi acessado e quando, quem acessou, de onde acessou e quantos dados mais você precisar.

    Espero ter te dado uma luz sobre essa questão.

  2. Olá pessoal, faz um tempo que não entro aqui no Fórum e decidi expor a minha dúvida. Alguém poderia, me indicar onde é que está a falha no meu código? Pois ele não envia o e-mail, erro de sintaxe, não tem, mas pode ser que eu tenha esquecido de algo.

    Abaixo está meu código:

    <?php
    
    include ("smtp.class.php");
      $host = "smtp.dominio.com.br"; /*host do servidor SMTP */
      $mail = "send@provedor.com.br";//o endereço de e-mail deve ser válido.
      $senha = "123456";
    
      /* Configuração da classe.e smtp.class.php */
      $smtp = new Smtp($host, 587);
      $smtp->user = $mail; /*usuario do servidor SMTP */
      $smtp->pass = $senha; /* senha do usuario do servidor SMTP*/
      $smtp->debug = true; /*ativa a autenticacao SMTP */
      /* Prepara a mensagem para ser enviada. */
      $from = $mail;
      $vendedor_mail1 = "mail1@provedor.com.br";
      $vendedor_mail2 = "mail2@provedor.com.br";
      //$to = array($vendedor_mail1, $vendedor_mail2);
      $to = "email@provedor.com.br";
      $subject = "Testando e-mail";
      $msg = "Mensagem de teste aqui";
    
      /* faz o envio da mensagem */
     
    
    	  $smtp->Send($to, $from, $subject, $msg, "text/html");
    
    ?>
    
    
  3. Bom dia a todos, estou precisando adicionar margin-right no meu carrossel JQuery, mas porém quando faço isso pelo css nãoadianta, pois o JQuerygera uma id dinamicamente durante a execução, e gostaria de alguma dica para implementara margin direto no JQuery, abaixoestá o código:

    $("#car_galerias").carouFredSel({
    			  circular	: true,
    			  infinite	: false,
    			  auto 		: true,
    			  items		: 4,
    			  prev : {
    				  button		: "#cargal_prev",
    				  key			: "left",
    				  items		: 4,
    				  easing		: "easeOutBounce",
    				  duration	: 1500
    			  },
    			  next : {
    				  button		: "#cargal_next",
    				  key			: "right",
    				  items		: 4,
    				  easing		: "easeOutBounce",
    				  duration	: 1500
    			  },
    			  scroll : {
    				  items	: 3,
    				  duration: 900,
    				  pauseOnHover: true
    			  }
    		  });
    	 
    	 });
    });
    
  4. Pessoal, quero apenas uma dica de como mudar o evento do bt-close, para que ao invés de retornar ao início da apresentação, avance para as próximas partes.

    Já dei uma olhada neste código várias vezes, porém ainda não consegui identificar qual a alteração necessária.

    /**
     * boxlayout.js v1.0.0
     * http://www.codrops.com
     *
     * Licensed under the MIT license.
     * http://www.opensource.org/licenses/mit-license.php
     * 
     * Copyright 2013, Codrops
     * http://www.codrops.com
     */
    var Boxlayout = (function() {
    
    	var $el = $( '#bl-main' ),
    		$sections = $el.children( 'section' ),
    		// works section
    		$sectionWork = $( '#bl-work-section' ),
    		// work items
    		$workItems = $( '#bl-work-items > li' ),
    		// work panels
    		$workPanelsContainer = $( '#bl-panel-work-items' ),
    		$workPanels = $workPanelsContainer.children( 'div' ),
    		totalWorkPanels = $workPanels.length,
    		// navigating the work panels
    		$nextWorkItem = $workPanelsContainer.find( 'nav > span.bl-next-work' ),
    		// if currently navigating the work items
    		isAnimating = false,
    		// close work panel trigger
    		$closeWorkItem = $workPanelsContainer.find( 'nav > span.bl-icon-close' ),
    		transEndEventNames = {
    			'WebkitTransition' : 'webkitTransitionEnd',
    			'MozTransition' : 'transitionend',
    			'OTransition' : 'oTransitionEnd',
    			'msTransition' : 'MSTransitionEnd',
    			'transition' : 'transitionend'
    		},
    		// transition end event name
    		transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],
    		// support css transitions
    		supportTransitions = Modernizr.csstransitions;
    
    	function init() {
    		initEvents();
    	}
    
    	function initEvents() {
    		
    		$sections.each( function() {
    			
    			var $section = $( this );
    
    			// expand the clicked section and scale down the others
    			$section.on( 'click', function() {
    
    				if( !$section.data( 'open' ) ) {
    					$section.data( 'open', true ).addClass( 'bl-expand bl-expand-top' );
    					$el.addClass( 'bl-expand-item' );	
    				}
    
    			} ).find( 'span.bl-icon-close' ).on( 'click', function() {
    				
    				// close the expanded section and scale up the others
    				$section.data( 'open', false ).removeClass( 'bl-expand' ).on( transEndEventName, function( event ) {
    					if( !$( event.target ).is( 'section' ) ) return false;
    					$( this ).off( transEndEventName ).removeClass( 'bl-expand-top' );
    				} );
    
    				if( !supportTransitions ) {
    					$section.removeClass( 'bl-expand-top' );
    				}
    
    				$el.removeClass( 'bl-expand-item' );
    				
    				return false;
    
    			} );
    
    		} );
    
    		// clicking on a work item: the current section scales down and the respective work panel slides up
    		$workItems.on( 'click', function( event ) {
    
    			// scale down main section
    			$sectionWork.addClass( 'bl-scale-down' );
    
    			// show panel for this work item
    			$workPanelsContainer.addClass( 'bl-panel-items-show' );
    
    			var $panel = $workPanelsContainer.find("[data-panel='" + $( this ).data( 'panel' ) + "']");
    			currentWorkPanel = $panel.index();
    			$panel.addClass( 'bl-show-work' );
    
    			return false;
    
    		} );
    
    		// navigating the work items: current work panel scales down and the next work panel slides up
    		$nextWorkItem.on( 'click', function( event ) {
    			
    			if( isAnimating ) {
    				return false;
    			}
    			isAnimating = true;
    
    			var $currentPanel = $workPanels.eq( currentWorkPanel );
    			currentWorkPanel = currentWorkPanel < totalWorkPanels - 1 ? currentWorkPanel + 1 : 0;
    			var $nextPanel = $workPanels.eq( currentWorkPanel );
    
    			$currentPanel.removeClass( 'bl-show-work' ).addClass( 'bl-hide-current-work' ).on( transEndEventName, function( event ) {
    				if( !$( event.target ).is( 'div' ) ) return false;
    				$( this ).off( transEndEventName ).removeClass( 'bl-hide-current-work' );
    				isAnimating = false;
    			} );
    
    			if( !supportTransitions ) {
    				$currentPanel.removeClass( 'bl-hide-current-work' );
    				isAnimating = false;
    			}
    			
    			$nextPanel.addClass( 'bl-show-work' );
    
    			return false;
    
    		} );
    
    		// clicking the work panels close button: the current work panel slides down and the section scales up again
    		$closeWorkItem.on( 'click', function( event ) {
    
    			// scale up main section
    			$sectionWork.removeClass( 'bl-scale-down' );
    			$workPanelsContainer.removeClass( 'bl-panel-items-show' );
    			$workPanels.eq( currentWorkPanel ).removeClass( 'bl-show-work' );
    			
    			return false;
    
    		} );
    
    	}
    
    	return { init : init };
    
    })();
    
  5. Olá pessoal, estou querendo criar um formulário para upload da imagem para uma pasta no meu site, e gravar o caminho desta no banco de dados MySQL, e posteriormente, em outra página, exibir determinado número destas imagens, ordenando pelas mais recentes adicionadas, alguém tem alguma dica para me ajudar?

    PS.: Testei um código aqui, mas não é o que quero, alguém pode dar uma luz sobre como fazer?

  6. Olá pessoal, eu sempre que crio algum programa no Delphi, qualquer que seja, quando utilizo um banco de dados( o meu banco é o Firebird osu o IB Expert como SGBD), quando compilo minha aplicação, e colo o o executável e a pasta do banco de dados em outra máquina, nos devidos locais, e abri o executável, ele dá um erro, dizendo que não encontrou determinado arquivo para conectar ao meu banco de dados. Preciso usar algum arquivo .ini ou .dll para fazer o sistema funcionar? Alguém sabe o que posso fazer?

    Meu Delphi é a versão 2010.

  7. Está certo, o que eu tenho pronto até o momento está abaixo.

    comentar.php

    <?php require_once('Connections/vale_autos.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $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;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO comentarios (nome, email, mensagem) VALUES (%s, %s, %s)",
                           GetSQLValueString($_POST['nome'], "text"),
                           GetSQLValueString($_POST['email'], "text"),
                           GetSQLValueString($_POST['mensagem'], "text"));
    
      mysql_select_db($database_vale_autos, $vale_autos);
      $Result1 = mysql_query($insertSQL, $vale_autos) or die(mysql_error());
    
      $insertGoTo = "comentado.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    
    $maxRows_listar = 10;
    $pageNum_listar = 0;
    if (isset($_GET['pageNum_listar'])) {
      $pageNum_listar = $_GET['pageNum_listar'];
    }
    $startRow_listar = $pageNum_listar * $maxRows_listar;
    
    mysql_select_db($database_vale_autos, $vale_autos);
    $query_listar = "SELECT nome, email, mensagem FROM comentarios ORDER BY id DESC";
    $query_limit_listar = sprintf("%s LIMIT %d, %d", $query_listar, $startRow_listar, $maxRows_listar);
    $listar = mysql_query($query_limit_listar, $vale_autos) or die(mysql_error());
    $row_listar = mysql_fetch_assoc($listar);
    
    if (isset($_GET['totalRows_listar'])) {
      $totalRows_listar = $_GET['totalRows_listar'];
    } else {
      $all_listar = mysql_query($query_listar);
      $totalRows_listar = mysql_num_rows($all_listar);
    }
    $totalPages_listar = ceil($totalRows_listar/$maxRows_listar)-1;
    ?>
    <!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" />
    <link href="css-comentarios.css" type="text/css" rel="stylesheet" />
    <title>Comentários</title>
    </head>
    
    <body>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="coment">
      <table align="center">
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Nome:</td>
          <td><input type="text" name="nome" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Email:</td>
          <td><input type="text" name="email" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right" valign="top">Mensagem:</td>
          <td><textarea name="mensagem" cols="50" rows="5"></textarea></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">&nbsp;</td>
          <td><input type="submit" value="Enviar Comentário" /></td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <p>&nbsp;</p>
    <table border="1" align="center" id="coment2">
      <tr>
        <td>Nome</td>
        <td>E-mail</td>
        <td>Mensagem</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_listar['nome']; ?></td>
          <td><?php echo $row_listar['email']; ?></td>
          <td><?php echo $row_listar['mensagem']; ?></td>
        </tr>
        <?php } while ($row_listar = mysql_fetch_assoc($listar)); ?>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($listar);
    ?>
    atualizar.php
    <?php require_once('Connections/vale_autos.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $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;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO comentarios (nome, email, mensagem) VALUES (%s, %s, %s)",
                           GetSQLValueString($_POST['nome'], "text"),
                           GetSQLValueString($_POST['email'], "text"),
                           GetSQLValueString($_POST['mensagem'], "text"));
    
      mysql_select_db($database_vale_autos, $vale_autos);
      $Result1 = mysql_query($insertSQL, $vale_autos) or die(mysql_error());
    
      $insertGoTo = "comentado.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    
    $maxRows_listar = 10;
    $pageNum_listar = 0;
    if (isset($_GET['pageNum_listar'])) {
      $pageNum_listar = $_GET['pageNum_listar'];
    }
    $startRow_listar = $pageNum_listar * $maxRows_listar;
    
    mysql_select_db($database_vale_autos, $vale_autos);
    $query_listar = "SELECT nome, email, mensagem FROM comentarios ORDER BY id DESC";
    $query_limit_listar = sprintf("%s LIMIT %d, %d", $query_listar, $startRow_listar, $maxRows_listar);
    $listar = mysql_query($query_limit_listar, $vale_autos) or die(mysql_error());
    $row_listar = mysql_fetch_assoc($listar);
    
    if (isset($_GET['totalRows_listar'])) {
      $totalRows_listar = $_GET['totalRows_listar'];
    } else {
      $all_listar = mysql_query($query_listar);
      $totalRows_listar = mysql_num_rows($all_listar);
    }
    $totalPages_listar = ceil($totalRows_listar/$maxRows_listar)-1;
    ?>
    <!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" />
    <link href="css-comentarios.css" type="text/css" rel="stylesheet" />
    <title>Comentários</title>
    </head>
    
    <body>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="coment">
      <table align="center">
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Nome:</td>
          <td><input type="text" name="nome" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Email:</td>
          <td><input type="text" name="email" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right" valign="top">Mensagem:</td>
          <td><textarea name="mensagem" cols="50" rows="5"></textarea></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">&nbsp;</td>
          <td><input type="submit" value="Enviar Comentário" /></td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <p>&nbsp;</p>
    <table border="1" align="center" id="coment2">
      <tr>
        <td>Nome</td>
        <td>E-mail</td>
        <td>Mensagem</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_listar['nome']; ?></td>
          <td><?php echo $row_listar['email']; ?></td>
          <td><?php echo $row_listar['mensagem']; ?></td>
        </tr>
        <?php } while ($row_listar = mysql_fetch_assoc($listar)); ?>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($listar);
    ?>

    Agradeço desde já a disposição em me ajudar, gostaria de poder colocar as respostas em uma tabela distinta no banco de dados.

  8. Oi Juh, olha, faça uma pequena alteração e teste sweu código, como no código abaixo:

    <?php
    echo "Email não enviado... <a href="mailto:meuemail@yahoo.com.br" > Mande um Email diretamente do seu computador! </a>";
    ?>

    Agora teste seu código e poste quais foram os resultados.

  9. Tente usar a API do GeoIp.

    Aqui está um exemplo que retorna todos os dados de sua localização:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
     "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Localização do usuário via Geo IP</title>
    
    </head>
    <body>
    <div id="doc">
      <div id="map"></div>
      <div  id="info"></div>
    </div>
    &lt;script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script>
    &lt;script>
    (function(){
    
      var info = document.getElementById('info');
      var lat = geoip_latitude();
      var lon = geoip_longitude();
      var city = geoip_city();
      var out = '<h3>Informaçoes de usa localização:</h3>'+
                '<ul>'+
                '<li>Latitude: ' + lat + '</li>'+
                '<li>Longitude: ' + lon + '</li>'+
                '<li>Cidade: ' + city + '</li>'+
                '<li>Cód. Região: ' + geoip_region() + '</li>'+
                '<li>Região: ' + geoip_region_name() + '</li>'+
                '<li>Código do País: ' + geoip_country_code() + '</li>'+
                '<li>Nome do País: ' + geoip_country_name() + '</li>'+
                '</ul>';
      info.innerHTML = out;
      var url = 'http://maps.google.com/maps/api/staticmap?center='+
                lat+','+lon+'&sensor=false&size=300x300&maptype=roadmap&key='+
                'ABQIAAAAijZqBZcz-rowoXZC1tt9iRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQQBCa'+
                'F1R_k1GBJV5uDLhAKaTePyQ&markers=color:blue|label:I|'+lat+
                ','+lon+'6&visible='+lat+','+lon+'|'+(+lat+1)+','+(+lon+1);
      var map = document.getElementById('map');
      map.innerHTML = '<img src="'+url+'" alt="'+city+'">';
    
    })();
    </script>
    </body>
    </html>

    Parabéns, post bem interessante e útil, este código com algumas pequenas adaptações pode nos ajudar a armazenar dados, e descobrir qual o maior público-alvo de um site, agradeço a sua contribuição com a comunidade Script Brasil.

  10. Tente usar a API do GeoIp.

    Aqui está um exemplo que retorna todos os dados de sua localização:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
     "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Localização do usuário via Geo IP</title>
    
    </head>
    <body>
    <div id="doc">
      <div id="map"></div>
      <div  id="info"></div>
    </div>
    &lt;script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script>
    &lt;script>
    (function(){
    
      var info = document.getElementById('info');
      var lat = geoip_latitude();
      var lon = geoip_longitude();
      var city = geoip_city();
      var out = '<h3>Informaçoes de usa localização:</h3>'+
                '<ul>'+
                '<li>Latitude: ' + lat + '</li>'+
                '<li>Longitude: ' + lon + '</li>'+
                '<li>Cidade: ' + city + '</li>'+
                '<li>Cód. Região: ' + geoip_region() + '</li>'+
                '<li>Região: ' + geoip_region_name() + '</li>'+
                '<li>Código do País: ' + geoip_country_code() + '</li>'+
                '<li>Nome do País: ' + geoip_country_name() + '</li>'+
                '</ul>';
      info.innerHTML = out;
      var url = 'http://maps.google.com/maps/api/staticmap?center='+
                lat+','+lon+'&sensor=false&size=300x300&maptype=roadmap&key='+
                'ABQIAAAAijZqBZcz-rowoXZC1tt9iRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQQBCa'+
                'F1R_k1GBJV5uDLhAKaTePyQ&markers=color:blue|label:I|'+lat+
                ','+lon+'6&visible='+lat+','+lon+'|'+(+lat+1)+','+(+lon+1);
      var map = document.getElementById('map');
      map.innerHTML = '<img src="'+url+'" alt="'+city+'">';
    
    })();
    </script>
    </body>
    </html>

    Amigo, eu posso personalizar e adaptar para que as informações sejam apenas as que eu necessito mostrar, e também utilizar estilo css?

×
×
  • Criar Novo...