Jump to content


mestreteia's Content

There have been 60 items by mestreteia (Search limited from 18/06/2023)



Ordernar por                Order  

#564634 Não Rendireciona

Posted by mestreteia on 05/04/2005, 09:50 in PHP

O que vc colocou na painel_de_controle.php para aceitar a validação do login?

Na página restrita tem que ter uma validação da sessão, tipo:

session_start();
$login = isset ($_SESSION["login"])?$_SESSION["login"]:"";
$senha = isset ($_SESSION["senha"])?$_SESSION["senha"]:"";

if ($login!=""){

//mostre a página

}else{

//volte para a página de login

}


E ainda, você pode colocar uma campo em sua tabela onde diferencie administradores de usuários, se for o caso.



#565299 Não Rendireciona

Posted by mestreteia on 06/04/2005, 16:07 in PHP

Cara, vou colocar o script que uso para minha página de login:

<?

//Verifica a existência das sessões
$sessao_login = isset ($_SESSION["login"])?$_SESSION["login"]:"";
$login = isset ($_POST["login"])?$_POST["login"]:"";
$senha = isset ($_POST["senha"])?$_POST["senha"]:"";
$logoff = isset ($_GET["logoff"])?$_GET["logoff"]:"";

include("conexao_banco.inc");

//Destrói a sessão aberta
if ($logoff == "ok"){
  session_unset();
   session_destroy();
  header("location:pagina_principal.php");
}

if (isset ($_POST["sair"])){
	session_destroy();
	header("location:página_principal.php");
}

//Se existir a sessão $sessao_login, vá para a página inicio.php, senão, conecte-se ao banco. Se a conexão retornar verdadeira, selecione as colunas da tabela usuarios onde a coluna usu_login seja igual à variável $login
if ($sessao_login==""){
	if ($login!=""){
  if ($conn==TRUE){
 	 $SQL = "SELECT usu_login, usu_nome, usu_tipo FROM usuarios WHERE usu_login='$login'";
    $res = mysql_query($SQL);
    list($log, $nom, $tip)=mysql_fetch_row($res);
    //echo "$log, $nom, $tip <br> $SQL";
    $_SESSION["login"]=$log;
    $_SESSION["tipo"]=$tip;
    $_SESSION["senha"]=$senha;
    $_SESSION["usuario"]=$nom;
    header("location:pagina_principal.php");
  }
	}
?>
<!--Formulário para efetuar login-->
<form action="" name="tela_login" method="POST">
<table border="0" cellpadding="3" cellspacing="0" width="225" height="70" align="center" bgcolor="#EFC081" style="border:1.5pt solid #CB801B">
	<tr>
  <td>
  Login:
  </td>
  <td>
  <input type="text" name="login" size="10" maxlength="15">
  </td>
	</tr>
	<tr>
  <td>
  Senha:
  </td>
    <td>
    <input type="password" name="senha" size="10" maxlength="15">&nbsp;<input type="submit" name="logar" value="LOGAR" class="botao_laranja">
    </td>
	</tr>

</table>


Na página onde eu quero validar se existe a sessão, eu coloco:

//início da sessão//
session_start();
	
//variáveis para conexão com o banco de dados//
$login = isset($_SESSION["login"])?$_SESSION["login"]:"";
$senha = isset($_SESSION["senha"])?$_SESSION["senha"]:"";

//informações para diferenciar as permissões desta página//
$usuario = isset($_SESSION["usuario"])?$_SESSION["usuario"]:"";
$tipo = isset($_SESSION["tipo"])?$_SESSION["tipo"]:"";
$nome = isset ($_SESSION["usuario"])?$_SESSION["usuario"]:"";

OBS: Não criei uma coluna "senha". Eu trabalho de forma diferente, colocando o usuário e senha para acessar o banco de dados e não as tabelas. É mais fácil controlar as permissões dessa forma.



#361207 Como Fazer Um Placar Controlado Pelo Teclado?

Posted by mestreteia on 10/05/2004, 14:50 in Adobe Flash e ActionScript

Para fazer com que a contagem decresça, é só repetir o mesmo código, trocando ++ por -- e associando a uma outra letra do teclado:

//Time 1
on (keyPress "q") {
time1 ++;
}

//Time2
on (keyPress "a") {
time2 ++;
}

on (keyPress "w") {
time1 --;
}
on (keyPress "s") {
time2 --;
}


Certo?



#427645 Formulario

Posted by mestreteia on 18/08/2004, 10:53 in PHP

você vai precisar fazer 4 páginas: 2 em salvas com extensão .php e as outras com extensão .htm

-->página "fale_conosco.htm":

Monte o seu formulário corretamente (com os nomes dos campos sem acentuação e sem espaços, para evitar problemas com o seu servidor)

ex:

<form name="senddata" method="post" action="send.php">
        <table width="294" border="0" cellpadding="0" cellspacing="0" bordercolor="#0066FF">
          <tr>
            <td width="75"><font size="2" face="Arial, Helvetica, sans-serif">Nome:</font><i><b></b></i></td>
            <td width="219"><i><b>
              <input name="nome" type="text" size="30" maxlength="45">
              </b></i></td>
          </tr>
          <tr>
            <td><font size="2" face="Arial, Helvetica, sans-serif">E-mail:</font><i><b></b></i></td>
            <td><i><b>
              <input name="email" type="text" size="30" maxlength="45">
              </b></i></td>
          </tr>
          <tr>
            <td valign="top"> <font size="2" face="Arial, Helvetica, sans-serif">Mensagem:</font></td>
            <td><i><b>
              <textarea name="textodamensagem" cols="30" rows="4"></textarea>
              </b></i></td>
          </tr>
          <tr>
            <td><div align="left"><i><b> </b></i></div></td>
            <td><div align="left"><i><b>
                <input type="submit" name="enviar" value="Enviar">
                <input type="reset" name="reset" value="Limpar">
                </b></i></div></td>


repare que o action está direcionando para send.php

-->página "send.php"

edite o código dessa forma:

<?php
$date = date("d/m/Y h:i");

include "config.php";

//ENVIO DA MENSAGEM ORIGINAL
$headers = "$cabecalho_da_mensagem_original";
if ($assunto_digitado_pelo_usuario=="n")
{
  $assunto = "$assunto_da_mensagem_original";
};
$seuemail = "$email_para_onde_vai_a_mensagem";
$mensagem = "$configuracao_da_mensagem_original";
mail($seuemail,$assunto,$mensagem,$headers);

//ENVIO DE MENSAGEM DE RESPOSTA AUTOMATICA
$headers = "$cabecalho_da_mensagem_de_resposta";
if ($assunto_digitado_pelo_usuario=="n")
{
  $assunto = "$assunto_da_mensagem_de_resposta";
}
else
{
  $assunto = "Re: $assunto";
};
$mensagem = "$configuracao_da_mensagem_de_resposta";
mail($email,$assunto,$mensagem,$headers);

echo "<script>window.location='$exibir_apos_enviar'</script>";

?>


esse código possui alguns campos q eu não criei na minha página "fale_conosco.htm", como "assunto" e "headers" (vc pode criá-los, se necessário)

--> página "config.php"

<?php

//CONFIGURAÇÕES SOBRE SEU SITE
$nome_do_site="Seu site";
$email_para_onde_vai_a_mensagem = "seuemail@email.com.br";
$nome_de_quem_recebe_a_mensagem = "Voce";
$exibir_apos_enviar='enviado.html';

//ESSA VARIAVEL DEFINE SE É O USUARIO QUEM DIGITA O ASSUNTO OU SE DEVE ASSUMIR O ASSUNTO DEFINIDO
//POR VOCÊ CASO O USUARIO DEFINA O ASSUNTO PONHA "s" NO LUGAR DE "n" E CRIE O CAMPO DE NOME
//'assunto' NO FORMULARIO DE ENVIO
$assunto_digitado_pelo_usuario="s";

//CONFIGURAÇOES DA MENSAGEM ORIGINAL
$cabecalho_da_mensagem_original="From: $name <$email>\n";
$assunto_da_mensagem_original="Contato via formulario de email";
$configuracao_da_mensagem_original="Enviado por:\nNome: $nome\nEmail: $email\nMensagem: $textodamensagem\nEnviado em: $date";

//CONFIGURAÇÕES DA MENSAGEM DE RESPOSTA
// CASO $assunto_digitado_pelo_usuario="s" ESSA VARIAVEL RECEBERA AUTOMATICAMENTE A CONFIGURACAO
// "Re: $assunto"
$assunto_da_mensagem_de_resposta = "EMAIL RECEBIDO";
$cabecalho_da_mensagem_de_resposta = "From: $nome_de_quem_recebe_a_mensagem - $nome_do_site <$email_para_onde_vai_a_mensagem>\n";
$configuracao_da_mensagem_de_resposta="Obrigado por entrar em contato!\nEm breve responderemos ao seu questionamento.\n\nAtenciosamente,\nVoce \nSeu site \n\nEnviado em: $date";

?>


-->Página "enviado.htm"

Uma página dizendo q a mensagem foi enviada!!!

Preste atenção nos nomes dos campos. Isso ajuda a fazer as alterações de acordo com a sua necessidade.

Qualquer dúvida, é só postar de novo



#350830 Como Aumentar O Alcance Do Scroll!

Posted by mestreteia on 26/04/2004, 16:51 in Adobe Flash e ActionScript

E aí?

Peguei um ScrollBar para o meu texto. O problema é que o texto tem as dimensões w 416.5 x h 784.9. É um texto dinâmico e eu consigo visualizar na minha página. O problema é que o alcance do scroll está muito limitado. Não chega nem na metade do texto.

O que precisa ser alterado?

Muito obrigado!!!

_____________________________________________________

Veja a resposta no final desta página!!!

:ph34r:



#351780 Como Aumentar O Alcance Do Scroll!

Posted by mestreteia on 27/04/2004, 16:35 in Adobe Flash e ActionScript

os actionsScripts são muito longos. Já tentei alterar algumas variáveis, sem sucesso. Tudo isso porque o scrollBar do FlashMX não reconhece o tamanho total do meu texto.

:(

Existe algum scroll que eu possa criar sem ter que utilizar o do Flash?

Muito obrigado, Sheep!!!



#352533 Como Aumentar O Alcance Do Scroll!

Posted by mestreteia on 28/04/2004, 16:10 in Adobe Flash e ActionScript

Valeu, cara, mas eu naum consegui abrir. Dava erro de página naum encontrada.
O problema da barra do flash é que vc tem muito trabalho para alterar os botões.

Tenta mandar a sua barra praquele meu e-mail.



#352278 Como Aumentar O Alcance Do Scroll!

Posted by mestreteia on 28/04/2004, 11:22 in Adobe Flash e ActionScript

valeu, mesmo, pessoal.

só naum tô conseguindo abrir o link da barra. tenta mandar pro minhastaras@yahoo.com.br (naum riam do meu e-mail).

BRIGADÃO!!! :D



#352430 Como Aumentar O Alcance Do Scroll!

Posted by mestreteia on 28/04/2004, 14:18 in Adobe Flash e ActionScript

Resolvido o problema!!!!


O que acontecia:

1- O palco tinha 200 de altura x 400 de largura;
2- Criei uma caixa de texto dinâmica, sendo que o meu texto tem 798 pixels de altura;
3- Expandi a minha caixa de texto para os 798 pixels (meu erro), mantendo os mesmos 200 pixels para o palco;

Solução óbvia:

Ao escolher a opção Texto Dinâmico, quando vc clica no corpo do texto com o botão direito, aparece a opção Srollable, o que permite fazer com que o texto fique completo, mesmo se a caixa for menor. Ou seja, se vc selecionar o texto, ele irá rolar dentro da caixa de texto.

Logo a caixa de texto tem que ter 200 pixels indepente do tamanho do texto. E o Scrollbar tem que ter o mesmo tamanho da caixa de texto (200 pixels).

Agora é só personalizar os botões e tudo o mais.

Simples!!!

Muito obrigado a todos que estiveram dispostos a me ajudar.

B)



#350895 Como Aumentar O Alcance Do Scroll!

Posted by mestreteia on 26/04/2004, 17:52 in Adobe Flash e ActionScript

muito obrigado. Estou tentando colocar o meu arquivo, ams ta dando erro.

#initclip 1

/*
  FScrollBarClass
  EXTENDS FUIComponentClass
	
*/


FScrollBarClass = function()
{
	if (this._height==4) {
  return;
	}
	this.init();

	this.minPos = this.maxPos = this.pageSize = this.largeScroll = 0;
	this.smallScroll = 1;


	this.width = (this.horizontal) ? this._width : this._height;
	this._xscale = this._yscale = 100;
	this.setScrollPosition(0);
	this.tabEnabled = false;
	if ( this._targetInstanceName.length > 0 ) {
  this.setScrollTarget(this._parent[this._targetInstanceName]);
	}
	this.tabChildren = false;
	this.setSize(this.width);
}

FScrollBarClass.prototype = new FUIComponentClass();



//  ::: PUBLIC METHODS

FScrollBarClass.prototype.setHorizontal = function(flag)
{
	if (this.horizontal && !flag) {
  this._xscale = 100;
  this._rotation = 0;
	} else if (flag && !this.horizontal) {
  this._xscale = -100;
  this._rotation = -90;
	}

	this.horizontal = flag;
}

// updates the thumb, turns the bar on and off
FScrollBarClass.prototype.setScrollProperties = function(pSize, mnPos, mxPos)
{
	if (!this.enable) {
  return;
	}
	this.pageSize = pSize;
	this.minPos = Math.max(mnPos, 0);
	this.maxPos = Math.max(mxPos,0);
	this.scrollPosition = Math.max(this.minPos, this.scrollPosition);
	this.scrollPosition = Math.min(this.maxPos, this.scrollPosition);
	
	if (this.maxPos-this.minPos<=0) { // turn it off
  this.scrollThumb_mc.removeMovieClip();
  this.upArrow_mc.gotoAndStop(3);
  this.downArrow_mc.gotoAndStop(3);
  this.downArrow_mc.onPress = this.downArrow_mc.onRelease = this.downArrow_mc.onDragOut = null;
  this.upArrow_mc.onPress = this.upArrow_mc.onRelease = this.upArrow_mc.onDragOut = null;
  this.scrollTrack_mc.onPress = this.scrollTrack_mc.onRelease = null;
  this.scrollTrack_mc.onDragOut = this.scrollTrack_mc.onRollOut = null;
  this.scrollTrack_mc.useHandCursor = false;
	} else { // turn it on
  var tmp = this.getScrollPosition();
  this.upArrow_mc.gotoAndStop(1);
  this.downArrow_mc.gotoAndStop(1);
  this.upArrow_mc.onPress = this.upArrow_mc.onDragOver = this.startUpScroller;
  this.upArrow_mc.onRelease = this.upArrow_mc.onDragOut = this.stopScrolling;
  this.downArrow_mc.onPress = this.downArrow_mc.onDragOver = this.startDownScroller;
  this.downArrow_mc.onRelease = this.downArrow_mc.onDragOut = this.stopScrolling;
  this.scrollTrack_mc.onPress = this.scrollTrack_mc.onDragOver = this.startTrackScroller; 
  this.scrollTrack_mc.onRelease = this.stopScrolling;
  this.scrollTrack_mc.onDragOut = this.stopScrolling;
  this.scrollTrack_mc.onRollOut = this.stopScrolling;
  this.scrollTrack_mc.useHandCursor = false;
  this.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
  this.scrollThumb_mc._x = 0;
  this.scrollThumb_mc._y = this.upArrow_mc._height;
  this.scrollThumb_mc.onPress = this.startDragThumb;
  this.scrollThumb_mc.controller = this;
  this.scrollThumb_mc.onRelease = this.scrollThumb_mc.onReleaseOutside = this.stopDragThumb;
  this.scrollThumb_mc.useHandCursor=false;
  this.thumbHeight = this.pageSize / (this.maxPos-this.minPos+this.pageSize) * this.trackSize;
  this.thumbMid_mc = this.scrollThumb_mc.mc_sliderMid;
  this.thumbTop_mc = this.scrollThumb_mc.mc_sliderTop;
  this.thumbBot_mc = this.scrollThumb_mc.mc_sliderBot;
  this.thumbHeight = Math.max (this.thumbHeight, 6); // 6 is the smallest a thumb should be
  this.midHeight = this.thumbHeight - this.thumbTop_mc._height - this.thumbBot_mc._height;
  this.thumbMid_mc._yScale = this.midHeight * 100 / this.thumbMid_mc._height;
  this.thumbMid_mc._y =  this.thumbTop_mc._height;
  this.thumbBot_mc._y = this.thumbTop_mc._height + this.midHeight;
  this.scrollTop = this.scrollThumb_mc._y;
  this.trackHeight = this.trackSize - this.thumbHeight;
  this.scrollBot = this.trackHeight + this.scrollTop; 
  tmp = Math.min(tmp, this.maxPos);
  this.setScrollPosition(Math.max(tmp, this.minPos));
	}
}

FScrollBarClass.prototype.getScrollPosition = function ()
{
	return this.scrollPosition;
}

FScrollBarClass.prototype.setScrollPosition = function(pos)
{
	this.scrollPosition = pos;
	if (this.scrollThumb_mc!=undefined) {
  pos = Math.min(pos, this.maxPos);
  pos = Math.max(pos, this.minPos);
	}
	this.scrollThumb_mc._y = ((pos-this.minPos) * this.trackHeight / (this.maxPos-this.minPos)) + this.scrollTop;
	this.executeCallBack();
}

FScrollBarClass.prototype.setLargeScroll = function(lScroll)
{
	this.largeScroll = lScroll;	
}

FScrollBarClass.prototype.setSmallScroll = function(sScroll)
{
	this.smallScroll = sScroll;	
}

FScrollBarClass.prototype.setEnabled = function(enabledFlag)
{
	var wasEnabled = this.enable;
	if (enabledFlag && !wasEnabled) {
  this.enable = enabledFlag;
  if (this.textField!=undefined) {
 	 this.setScrollTarget(this.textField);
  } else {
 	 this.setScrollProperties(this.pageSize,
     	 this.cachedMinPos, this.cachedMaxPos);
 	 this.setScrollPosition(this.cachedPos);
  }
  this.clickFilter = undefined;
	} else if (!enabledFlag && wasEnabled) { 
  this.textField.removeListener(this);
  this.cachedPos = this.getScrollPosition();
  this.cachedMinPos = this.minPos;
  this.cachedMaxPos = this.maxPos;
  if (this.clickFilter==undefined) {
 	 this.setScrollProperties(this.pageSize,0,0);
  } else {
 	 this.clickFilter=true;
  }
  this.enable = enabledFlag;
	}
}


// stretches the track, creates + positions arrows
FScrollBarClass.prototype.setSize = function(hgt)
{
	if (this._height==1) return;
	this.width = hgt;
	this.scrollTrack_mc._yscale = 100;
	this.scrollTrack_mc._yscale = 100 * this.width / this.scrollTrack_mc._height;
	if (this.upArrow_mc==undefined) {
  this.attachMovie("UpArrow", "upArrow_mc", 1);   //1 is arbitrary
  this.attachMovie("DownArrow", "downArrow_mc", 2);   //2 is arbitrary
  this.downArrow_mc.controller = this.upArrow_mc.controller = this;
  this.upArrow_mc.useHandCursor = this.downArrow_mc.useHandCursor = false;
  this.upArrow_mc._x = this.upArrow_mc._y = 0;
  this.downArrow_mc._x = 0;
	}
	this.scrollTrack_mc.controller = this;
	this.downArrow_mc._y = this.width - this.downArrow_mc._height;
	this.trackSize = this.width - (2 * this.downArrow_mc._height);
	if (this.textField!=undefined) {
  this.onTextChanged();
	} else {
  this.setScrollProperties(this.pageSize, this.minPos, this.maxPos);
	}
}


//   ::: PRIVATE METHODS

FScrollBarClass.prototype.scrollIt = function (inc, mode)
{
	var delt = this.smallScroll;
	if (inc!="one") {
  delt = (this.largeScroll==0) ? this.pageSize : this.largeScroll;
	} 
	var newPos = this.getScrollPosition() + (mode*delt);
	if (newPos>this.maxPos) {
  newPos = this.maxPos;
	} else if (newPos<this.minPos) {
  newPos = this.minPos;
	}
	this.setScrollPosition(newPos);
}

FScrollBarClass.prototype.startDragThumb = function()
{
	this.lastY = this._ymouse;
	this.onMouseMove = this.controller.dragThumb;
}

FScrollBarClass.prototype.dragThumb = function()
{
	this.scrollMove = this._ymouse - this.lastY;
	this.scrollMove += this._y;
	if (this.scrollMove<this.controller.scrollTop) {
  this.scrollMove = this.controller.scrollTop;
	}
	else if (this.scrollMove>this.controller.scrollBot) {
  this.scrollMove = this.controller.scrollBot;
	}
	this._y = this.scrollMove;
	var c = this.controller;
	c.scrollPosition = Math.round( (c.maxPos-c.minPos) * (this._y - c.scrollTop) / c.trackHeight) + c.minPos;

	this.controller.isScrolling = true;
	updateAfterEvent();
	this.controller.executeCallBack();
}

FScrollBarClass.prototype.stopDragThumb = function()
{
	this.controller.isScrolling = false;
	this.onMouseMove = null;
}

FScrollBarClass.prototype.startTrackScroller = function()
{
	this.controller.trackScroller();
	this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "page", -1);
}

FScrollBarClass.prototype.scrollInterval = function(inc,mode)
{
	clearInterval(this.scrolling);
	if (inc=="page") {
  this.trackScroller();
	} else {
  this.scrollIt(inc,mode);
	}
	this.scrolling = setInterval(this, "scrollInterval", 35, inc, mode);
}

FScrollBarClass.prototype.trackScroller = function()
{
	if (this.scrollThumb_mc._y+this.thumbHeight<this._ymouse) {
  this.scrollIt("page",1);
	} else if (this.scrollThumb_mc._y>this._ymouse) {
  this.scrollIt("page",-1);
	}
}

FScrollBarClass.prototype.stopScrolling = function()
{
	this.controller.downArrow_mc.gotoAndStop(1);
	this.controller.upArrow_mc.gotoAndStop(1);
	clearInterval(this.controller.scrolling);
}

FScrollBarClass.prototype.startUpScroller = function()
{
	this.controller.upArrow_mc.gotoAndStop(2);
	this.controller.scrollIt("one",-1);
	this.controller.scrolling = setInterval(this.controller, "scrollInterval",500, "one", -1);
}

FScrollBarClass.prototype.startDownScroller = function()
{
	this.controller.downArrow_mc.gotoAndStop(2);
	this.controller.scrollIt("one",1);
	this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", 1);
}


//
// Begin Special text scroller functions
//


FScrollBarClass.prototype.setScrollTarget = function(tF)
{
	if (tF == undefined) {
  this.textField.removeListener(this);
  delete this.textField[ (this.horizontal) ? "hScroller" : "vScroller" ]; 
  if (!(this.textField.hScroller==undefined) && !(this.textField.vScroller==undefined)) {
 	 this.textField.unwatch("text");
 	 this.textField.unwatch("htmltext");
  }
	}
	this.textField = undefined;
	if (!(tF instanceof TextField)) return;
	this.textField = tF;
	this.textField[ (this.horizontal) ? "hScroller" : "vScroller" ] = this; 
	this.onTextChanged();
	this.onChanged = function()
	{
  this.onTextChanged();
	}
	this.onScroller = function()
	{
  if (!this.isScrolling) {
 	 if (!this.horizontal) {
    this.setScrollPosition(this.textField.scroll);
 	 } else { 
    this.setScrollPosition(this.textField.hscroll);
 	 }
  }
	}
	this.textField.addListener(this);
	this.textField.watch("text", this.callback);
	this.textField.watch("htmlText", this.callback);
}

FScrollBarClass.prototype.callback = function(prop, oldVal, newVal)
{
	clearInterval(this.hScroller.synchScroll);
	clearInterval(this.vScroller.synchScroll);
	this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
	this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
	return newVal;
}


FScrollBarClass.prototype.onTextChanged = function()
{
	if (!this.enable || this.textField==undefined) return;
	clearInterval(this.synchScroll);
	if (this.horizontal) {
  var pos = this.textField.hscroll;
  this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
  this.setScrollPosition(Math.min(pos, this.textField.maxhscroll));
	} else {
  var pos = this.textField.scroll;
  var pageSize = this.textField.bottomScroll - this.textField.scroll;
  this.setScrollProperties(pageSize, 1, this.textField.maxscroll);
  this.setScrollPosition(Math.min(pos, this.textField.maxscroll));
	}
}

FScrollBarClass.prototype.executeCallBack = function()
{
	if (this.textField==undefined) {
  super.executeCallBack();
	} else {
  if ( this.horizontal ) {
 	 this.textField.hscroll = this.getScrollPosition();
  } else {
 	 this.textField.scroll = this.getScrollPosition();
  }
	}
}





Object.registerClass("FScrollBarSymbol", FScrollBarClass);

#endinitclip



#561716 "if" Não Tiver Nada, Não Mostra Nada, Como?

Posted by mestreteia on 30/03/2005, 12:56 in PHP

Se vc está usando o script q vc postou, vai dar erro porque o segundo "temp" que vc informou não está caracterizado como variável.

if ($temp!=""){
echo "($temp)";
}

Se vc não quer que apareça nada se a variável $temp estiver vaiza, pra que mencionar? É mais trabalhar somente no caso dela existir. A não ser que vc faça dessa forma:

$temp = isset($_POST["temp"])?$_POST["temp"]:"";

Esse caso é interessante quando vc trabalha com variáveis que podem ter seu valor vazio, por exemplo:

$logar = isset($_POST["logar"])?$_POST["logar"]:"";

if ($logar==""){
mostre o formulário para preenchimento de login e senha
}else{
mostre a mensagem:"você está logado"
}



#561200 Sistema De Busca

Posted by mestreteia on 29/03/2005, 15:05 in PHP

Você coloca uma condição na query. Eu não entendi se são duas buscas diferentes. Se for, faz o seguinte:

SELECIONE idade DA tabela ONDE idade >= $valor_idade;

SELECIONE idade DA tabela ONDE idade <= $valor_idade;

E faz o contrário quando for para pegar só os menores de idade.

É isso?



#564369 Formatar Data

Posted by mestreteia on 04/04/2005, 15:55 in PHP

Vc pode trabalhar com datas em qualquer formato vindo do BD. Por exemplo:

Você colocou a data no BD no formato TIMESTAMP aaaa/mm/dd hh:mm:ss

Para resgatá-la, crie uma função do tipo:

function trans_data($date){
list($ano,$mes,$dia,$hora,$min,$seg) = split('[- :]',$date);//dê uma olhada no manual para ver a função split com mais detalhes
echo "$dia/$mes/$ano";
}

Depois vc pode adaptar a mesma função para gerar a hora.

Isso ajuda?



#564859 Sistema Colunistas...

Posted by mestreteia on 05/04/2005, 17:02 in PHP

Você já tentou dessa forma:

SELECT *, COUNT(*) FROM membros WHERE id= '$parent'

Tem q tomar cuidado com o grau de relação entre elas, se é de 1 pra N ou N pra N. Isso é importante para saber se vai precisar de uma tabela intermediária.



#564622 Formatar Data

Posted by mestreteia on 05/04/2005, 09:39 in PHP

Uma outra forma de se obter a data, e formatá-la de acordo com o idioma local, é utilizando a função setlocale.

  setlocale (LC_TIME, "portuguese");//visite: [URL=http://br.php.net/manual/pt_BR/function.setlocale.php ]setlocale[/URL] para ter uma noção melhor
  $data = ucwords(strftime("%A, %d de %B de %Y"));
  $semana = str_replace("De ","de ", $data);
  echo "$semana";

É um solução prática para evitar aquele script em javascript que troca os valores numéricos dos meses por seus respectivos nomes.

Essa função depende que o servidor tenha o idioma instalado, senão não funciona adequadamente.



#565325 Sistema Colunistas...

Posted by mestreteia on 06/04/2005, 16:29 in PHP

Existe uma forma melhor de relacionar dados das tabelas:

"SELECT $tabela.*,$tabela2.* FROM $tabela, $tabela2 WHERE $tabela.parent = $tabela2.id ORDER by $tabela.$ordenado $ordem LIMIT $inicio, $limite"

Dessa mesma forma acima é possível escolher dois dados, mesmo que tenham o mesmo nome. O que vai diferenciá-los é o "$tabela." e "$tabela2."

Valeu?



#562070 Cookie Nao Apaga

Posted by mestreteia on 31/03/2005, 08:01 in PHP

Vejam essas 3 páginas como exemplo de inserir e remover cookies.

Attached Files

  • Attached File  site.rar   570bytes   5 downloads



#375207 Calculadora - Problema Com Operadores

Posted by mestreteia on 30/05/2004, 11:02 in Adobe Flash e ActionScript

Valeu, DuRanG!

Eu tentei utilizar a fórmula: x = a * b / 100, onde "a" é o número e "b" o valor percentual. Mas eu não consegui recriar essa fórmula em actionScript. E eu acho que esse cálculo vai ser um pouco mais complicado porque também é necessário saber se vai ser com desconto ou com acréscimo. Por exemplo:

10 - 20 % = 8
10 + 20 % = 12

É necessário fazer com que a calculadora simule essas equações.

Eu vou tentar gerar a fórmula como se estivesse programando. Depois eu posto aqui.

Muito obrigado, mesmo.



#369196 Formulário Asp X Flash? Porque?

Posted by mestreteia on 21/05/2004, 17:03 in Adobe Flash e ActionScript

Eu já fiz o meu formulário, numa boa. Agora eu preciso fazer com q o PHP leia a opção escolhida no meu radioButton e no meu listBox.
Em actionScript seria assim:

= radioButton_Group.getValue().getLabel();
= listBox.getSelectedIndex();

Qual o comando em PHP para reconhecer esses valores?

Obrigado!!! :lol:



#369161 Calculadora - Problema Com Operadores

Posted by mestreteia on 21/05/2004, 16:00 in Adobe Flash e ActionScript

Eu achei um código para fazer uma calculadora bem simples, mas faltava uma interação com o teclado.

Utilizei o comando

on (release) {
digit = "1";
call("AddDigit");
}
on(keyPress"1"){
digit = "1";
call("AddDigit");//o nome da minha layer
}

e funcionou numa boa.

O problema está nos operadores. Eu coloquei o código da seguinte forma:

on (release) {
call("DoOperator");
}
on (keyPress "<Enter>") {
call("DoOperator");
}

Acontece q eu aperto o enter trucentas mil vezes e nada acontece. Eu até troquei a opção "<Enter>" para "z" e funcionou. Será que o script não interpreta o Enter?

Ajundem-me... :(

Estou enviando um exemplo.

PS: A calculadora tem a opção Drag. :o

Attached Files




#373416 Calculadora - Problema Com Operadores

Posted by mestreteia on 27/05/2004, 15:31 in Adobe Flash e ActionScript

A minha calculadora já está mais ou menos legal. As teclas "Enter", para resultado, e "Del", para limpar, já estão funcionando. O problema agora está na porcentagem. O comando não está reconhecendo o operador "%". O que eu estou fazendo de errado? Eu preciso saber mais sobre cálculos utilizando ActionScript para poder fazer uma calculadora com operadores mais complexos, com fórmulas pré-estabelecidas.

Obrigado!

Estou mandando um exemplo para vcs verem.

Attached Files




#373790 Calculadora - Problema Com Operadores

Posted by mestreteia on 28/05/2004, 08:34 in Adobe Flash e ActionScript

Vou tentar postar de novo a calculadora.

Obrigado!

Attached Files




#561862 Cookie Nao Apaga

Posted by mestreteia on 30/03/2005, 16:48 in PHP

tenta o seguinte na página onde vc irá remover o cookie:

setcookie("exemplo","");

Perceba as aspas na parte onde fica o valor.



#376000 Calculadora - Problema Com Operadores

Posted by mestreteia on 31/05/2004, 08:27 in Adobe Flash e ActionScript

Muitíssimo obrigado.

Agora está funcionando que é uma beleza!!!

Vou tentar fazer as outras fórmulas específicas.

Valeu!!! (y)
:lol:



#374011 Filme

Posted by mestreteia on 28/05/2004, 14:12 in Adobe Flash e ActionScript

flash 4??? :(

Agora vc me pegou. Eu só estou trabalhando com o flash mx... Vê se no menu Window tem "Actions". Eu não tenho ele aki e nem sei se nessa versão tem suporte para actionscript. :huh:




IPB Skin By Virteq