$proxima = ( $_GET[proxima] ) ? $_GET[proxima] : 0;
?
Valeu, grande tutorial. Se todos ensinassem a lógica ao inves de dar o código mastigado, seria bem melhor para o aprendizado.
There have been 26 items by michelmfreitas (Search limited from 26/04/2023)
Posted by michelmfreitas on 16/02/2008, 14:09 in Artigos, Dicas e Tutoriais de PHP
$proxima = ( $_GET[proxima] ) ? $_GET[proxima] : 0;
Posted by michelmfreitas on 20/02/2008, 15:25 in PHP
Posted by michelmfreitas on 20/02/2008, 10:19 in PHP
Posted by michelmfreitas on 20/02/2008, 19:15 in PHP
if($eacao == 'votar'){ session_start(); extract($_POST); $id = $_SESSION['id']; $sqla = "SELECT * FROM votos WHERE id = '$id'"; $result = $conn->Execute($sqla); $dados = $result->FetchRow(); echo $sqlb = "UPDATE votos SET $enquete = $dados[$enquete] + 1 WHERE id = '$id'"; $conn->Execute($sqlb); ?> <script language="javascript"> alert('Voto computado com sucesso.'); //window.location.href='index.php?pagina=principal'; </script> <? }?>
Posted by michelmfreitas on 20/02/2008, 20:11 in PHP
if($eacao == 'votar'){ session_start(); extract($_POST); $id = $_SESSION['id']; echo $sqlb = "UPDATE votos SET $enquete = $enquete + 1 WHERE id = '$id'"; $conn->Execute($sqlb); ?> <script language="javascript"> alert('Voto computado com sucesso.'); //window.location.href='index.php?pagina=principal'; </script><? }?>
UPDATE votos SET opcao2 = opcao2 + 1 WHERE id = '10'
Posted by michelmfreitas on 25/02/2008, 16:17 in PHP
Posted by michelmfreitas on 25/02/2008, 14:08 in PHP
session_start(); $campo = $_POST['enquete']; $id = $_SESSION['id']; <----------------------
Posted by michelmfreitas on 08/09/2008, 09:13 in CSS & Semântica (Tableless)
<div id="menu"> <ul> <li><a href="#" title="pagina principal">Página Inicial</a></li> <li><a href="#" title="sobre a empresa">Sobre a empresa</a></li> <li><a href="#" title="serviços">Serviços</a></li> <li><a href="#" title="clientes">Clientes</a></li> <li><a href="#" title="fale conosco">Fale Conosco</a></li> </ul>
#menu ul li{ height: 35px; }
Posted by michelmfreitas on 21/01/2008, 11:30 in PHP
strstr — Encontra a primeira ocorrencia de uma string
<?php
$email = 'name@example.com';
$domain = strstr($email, '@');
echo $domain; // prints @example.com
$user = strstr($email, '@', true);
echo $user; // prints name
?>
echo $texto = strstr($texto, "<br />", true);
Emprestado pelo Inter de Milão ao São Paulo até o meio do ano, o atacante Adriano afirmou, em entrevista ao jornal "Corriere dello Sport", que seu principal objetivo é retornar ao clube italiano para dar a volta por cima.<br />
<br />
- Desde o meu primeiro dia no São Paulo, eu disse que espero que o meu futuro seja no Inter de Milão para sempre. Sei que deixei uma má impressão e espero voltar de cabeça erguida para poder dar o melhor de mim, de com mais responsabilidade. E sei que sou capaz disto - disse o atacante, antes da vitória do Tricolor Paulista sobre o Rio Preto.<br />
<br />
Questionado sobre como se definiria no atual momento da carreira, Adriano respondeu com naturalidade.<br />
<br />
- Eu me defino como um jogador que está recomeçando do zero, com vontade de trabalhar muito. Como alguém que está tentando ser uma pessoa mais serena dentro e fora de campo, porque isso me ajuda a me concentrar na hora de jogar. Sou um cara mais calmo aqui no Brasil - analisa.<br />
<br />
Adriano falou também sobre o lado bom de estar de volta ao paÃs onde nasceu e cresceu.<br />
<br />
- Aqui estou perto da minha famÃlia e tenho à minha volta pessoas que gostam de mim, meus companheiros de time, o treinador, a torcida. Só espero que não digam que faço coisas erradas, e eu admito que já fiz muitas, quando isto não for verdade - conclui.
Posted by michelmfreitas on 21/01/2008, 11:57 in PHP
Posted by michelmfreitas on 11/11/2007, 20:00 in PHP
Posted by michelmfreitas on 11/11/2007, 19:45 in PHP
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\easyphp1-8\www\pasta\criadb.php on line 81
$acrescimo = " <? include '../conexaoDB/conexao.php'; include 'includes/includes.php'; include '../funcoes/buscaDB.php'; $acao = $_GET['acao']; $categoria = $_GET['categoria'];
Posted by michelmfreitas on 24/09/2007, 17:04 in CSS & Semântica (Tableless)
#conteudoProducao{ position:absolute; background:#339900; float:left; left:230px; top:20px; width:500px; height:400px; padding:5px; font-family:Verdana, Arial, Helvetica, sans-serif; text-align:justify; color:#FFFFFF; font-size:10px; overflow:auto; opacity:0.65; -moz-opacity: 0.65; filter: alpha(opacity=65); border: 2px solid #FFFFFF; } #thumbs{ background:#333333; width:140px; height:350px; float:left; overflow:auto; padding:5px; margin:0; } #thumbs li img{ border:1px dashed #FFFFFF; width:100px;; height:66.6px; padding:5px; margin:5px; } #thumbs li a span{ display:none; } #thumbs li a:hover span{ display:block; left:150px; width:100px; height:auto; position:absolute; } #thumbs li a:hover span img{ width:280px; height:auto; position:fixed; margin:0; left:670px; top:85px; } #thumbs li a:hover span.legenda{ width:280px; height:auto; left:670px; position:fixed; padding:5px; text-align:center; font-weight:bold; top:380px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; color:#FFFFFF; }
<div id="conteudoProducao"> <h1 class="titulo">.: Produção da Cachaça</h1> <p> <ul id="thumbs"> <? $sql = "SELECT * FROM galeria;"; $busca = buscaDB($sql); while($foto = mysql_fetch_row($busca)){ ?> <li> <a href="#"> <img src="../<?= $foto[1];?>" alt="" /> <span> <img src="../<?= $foto[1];?>" alt="" /> <span class="legenda"> <?= $foto[2];?> </span> </span> </a> </li> <? } ?> </ul> </p> </div>
Posted by michelmfreitas on 22/12/2007, 15:58 in Ajax
<p><label>Destaque Principal</label><input name="destaque" type="checkbox" id="destaque" style="border:0;" value="sim" /></p>
function AdicionarNoticias(formularioNoticia){ $.post("classes.php", {objeto:"Noticias", metodo:"Adicionar", titulo:$("#titulo").val(), noticia:$("#noticia").val(), foto:$("#foto").val(), data:$("#data").val(), hora:$("#hora").val(), destaque:$("#destaque").val() }, function(){ alert($("#destaque").val()); // AQUI ELE RETORNA SEMPRE 'SIM' //window.location.href='?pagina=noticias'; } ); }
Posted by michelmfreitas on 22/12/2007, 16:54 in Ajax
<form id="formularioNoticia" name="formularioNoticia" action="java script:void(0);" onSubmit="AdicionarNoticias(this)" enctype="multipart/form-data" method="post">
Posted by michelmfreitas on 09/09/2007, 10:03 in Adobe Flash e ActionScript
Posted by michelmfreitas on 16/02/2008, 07:14 in MySQL
Posted by michelmfreitas on 15/01/2008, 14:08 in PHP
80 copy($foto, $arquivo) or die("erro"); 81 copy($foto, $miniatura) or die("erro");
<b>Warning</b>: copy(C:\Documents and Settings\All Users\Documentos\Minhas imagens\Amostras de imagens \Ninféias.jpg): failed to open stream: No such file or directory in <b>c:\easyphp1-8\www\pasta\adm\classes.php</b> on line <b>80</b><br /> erro
Posted by michelmfreitas on 27/07/2008, 23:39 in PHP
Posted by michelmfreitas on 12/05/2008, 15:29 in CSS & Semântica (Tableless)
<div id="lista-produtos"> <img src="<?=$linha['miniatura']?>" align="absmiddle" /> <p class="texto-galeria"><?=$linha['produto']?></p> <p><img src="img/encomendar.jpg" /></p> </div> <br style="clear:both;"/> //CSS #lista-produtos{ width:160px; border:3px solid #000000; background:#FFF8E6; text-align:center; margin:5px; padding:5px; margin-bottom:20px; float:left; } .texto-galeria{ font-size:18px; font-weight:bold; color:#FF9900; margin-top:10px; margin-bottom: 10px; } .fotos-produtos{ width:150px; text-align:center; padding:10px; }
Posted by michelmfreitas on 28/02/2008, 10:49 in CSS & Semântica (Tableless)
/* CSS Document */ *{ background-image:url(img/bg.jpg); } #site{ position:relative; margin-left:auto; margin-right:auto; width:770px; height:auto; } #conteudo{ background-image:url(imagens/index_02.jpg); width:401px; height:430px; left:369px; position:absolute; } #quadro{ background:none; position:absolute; margin-left:70px; margin-right:70px; margin-top:95px; overflow:auto; height:255px; width:260px; /*border:1px solid #000000;*/ font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; text-align:justify; } #titulo{ position:absolute; right:20px; top:30px; padding:0; margin:0; } #titulo h1{ color:#9966CC; font-size:20px; }
Posted by michelmfreitas on 14/02/2008, 08:50 in PHP
<? $acao = $_GET['acao']; if($acao == 'filtrarDias'){ echo "a"; extract($_POST); echo $semana; }?> <form method="post" action="?pagina=programacao&acao=filtrarDias" name="form"> <p>Selecione um dia da semana:<br /> <select id="semana"> <option value="Todos os dias" selected="selected">Todos os dias</option> <option value="Segunda-feira">Segunda-feira</option> <option value="Terça-feira">Terça-feira</option> <option value="Quarta-feira">Quarta-feira</option> <option value="Quinta-feira">Quinta-feira</option> <option value="Sexta-feira">Sexta-feira</option> <option value="Sábado">Sábado</option> <option value="Domingo">Domingo</option> <option value="Segunda à Sexta">Segunda à Sexta-feira</option> </select> <input type="submit" value="ok" /> </p> </form>
<select name='semana'>
Posted by michelmfreitas on 09/09/2007, 12:46 in PHP
<?xml version="1.0" encoding="UTF-8"?> <imagens> <foto> <imagem>fotos/1.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/2.JPG</imagem> <texto>Legenda da foto 2</texto> </foto> <foto> <imagem>fotos/3.JPG</imagem> <texto>Legenda da foto 3</texto> </foto> <foto> <imagem>fotos/4.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/5.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/6.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/7.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/8.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/9.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/10.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/11.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/12.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/13.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/14.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/15.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/16.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <foto> <imagem>fotos/17.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> </imagens>
<foto> <imagem>fotos/1.JPG</imagem> <texto>Legenda da foto 1</texto> </foto>
<? while($a){ ?> <foto> <imagem>fotos/17.JPG</imagem> <texto>Legenda da foto 1</texto> </foto> <? } ?>
Posted by michelmfreitas on 13/09/2007, 14:38 in Adobe Flash e ActionScript
on (release) { loadVariablesNum("mail.php", 0, "POST"); }
<? $recipient = "michelmfreitas@gmail.com"; $subject = "Contato pelo Site"; $msg = "Nome: $nome\n\nTelefone:\n\nE-mail: $email\n\nMensagem: $mensagem"; $mailheaders = "From: $nome"; $enviar = mail("$recipient", "$subject", "$msg", "$mailheaders"); if(!$enviar){ echo "erro"; }else{ echo "Mensagem enviada com sucesso."; } ?>
Posted by michelmfreitas on 23/01/2008, 14:20 in PHP
Community Forum Software by IP.Board
Licensed to: Webmasters Online