-
Total de itens
638 -
Registro em
-
Última visita
Sobre Tenko

- Data de Nascimento 09/04/1980
Perfil
-
Gender
Male
-
Location
Osasco
-
Interests
Programação PHP, java ( é legal ) , javascript, flash, sql, C#
Tenko's Achievements
0
Reputação
-
Tenko alterou sua foto pessoal
-
livros.xml <?xml version="1.0" encoding='utf-8'?> <livros> <livro> <cod>01</cod> <titulo>PHP</titulo> <descricao>Lendo XML</descricao> <autor>Tenko</autor> <paginas>200</paginas> <preço>5.00</preço> </livro> <livro> <cod>02</cod> <titulo>XML</titulo> <descricao>Usando XML com PHP </descricao> <autor>Jose das Couves</autor> <paginas>100</paginas> <preço>15.00</preço> </livro> </livros> xml.php <?php header ( 'Content-Type:text/html; charset=utf-8' ); $xml = simplexml_load_file ( 'livro.xml' ); foreach ( $xml->livro as $livro ) { echo $livro->cod . '<br/>'; echo $livro->titulo . '<br/>'; echo $livro->autor . '<br/>'; echo $livro->descricao . '<br/>'; echo $livro->preço . '<br/>'; echo "<br>"; } ?>
-
Boa tarde. Clique encima do projeto com o botão direito do mouse e delete.
-
Bom dia. Já pesquisou por toFixed(2);
-
[LE AJUDA] Function não está checando valor do checkbox (Parsefloat)
pergunta respondeu ao Julix de Tenko em Ajax, JavaScript, XML, DOM
Bom dia. Espero que te ajude. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script> var d = document; function calcula() { // Inicio zerando os valores d.getElementById( 'total' ).innerHTML = 'R$ 0.00'; // Pegandos os campos var oChecks = d.getElementsByTagName( 'input' ); var iChecks = oChecks.length; var fTotal = 0; // Lendo os dados marcados for( var i = 0; i < iChecks; i++ ) { if( oChecks[ i ].type == 'checkbox' && oChecks[ i ].checked ) { // Separando pelo id passado var separaInfo = oChecks[ i ].id.split( '_' ); // pegando o valor de cada linha var fValorLinha = d.getElementById( 'val' + separaInfo[ 1 ] ).value; // tratando para ver se foram informados valores fValorLinha = parseFloat( fValorLinha ); if( ! isNaN( fValorLinha ) ) { fTotal += fValorLinha; } else { d.getElementById( 'val' + separaInfo[ 1 ] ).value = 0; } } } d.getElementById( 'total' ).innerHTML = 'R$ ' + fTotal.toFixed( 2 ); } </script> </head> <body> <table width="100%" border="1"> <tr> <td width="4%" align="center" valign="middle"><div align="center"> <input name="chk_1" type="checkbox" id="chk_1" value="checkbox"> </div></td> <td width="96%"><input name="val1" type="text" id="val1"></td> </tr> <tr> <td align="center" valign="middle"><div align="center"> <input name="chk_2" type="checkbox" id="chk_2" value="checkbox"> </div></td> <td><input name="val2" type="text" id="val2"></td> </tr> <tr> <td align="center" valign="middle"><div align="center"> <input name="chk_3" type="checkbox" id="chk_3" value="checkbox"> </div></td> <td><input name="val3" type="text" id="val3"></td> </tr> <tr> <td align="center" valign="middle"><div align="center"> <input name="chk_4" type="checkbox" id="chk_4" value="checkbox"> </div></td> <td><input name="val4" type="text" id="val4"></td> </tr> <tr> <td align="center" valign="middle"><div align="center"> </div></td> <td> </td> </tr> <tr> <td align="center" valign="middle"><div align="center">Total</div></td> <td> <span id="total"></span> </td> </tr> <tr> <td colspan="2"><input type="button" value="Calcular" onclick="calcula()"/></td> </tr> </table> </body> </html> -
Associar Função js a um ID em Css
pergunta respondeu ao Victor Hugo Marques de Tenko em Ajax, JavaScript, XML, DOM
Bom dia. Vê se ajuda. function increaseFontSize() { var p = document.getElementsByTagName('p'); for(i=0;i<p.length;i++) { if( p.id == 'conteudo' ) { if( p.style.fontSize ) { var s = parseInt(p.style.fontSize.replace("px","")); } else { var s = 12; } if( s != max ) { s += 1; } p.style.fontSize = s+"px" } } } <p id="titulo">Teste</p> <p id="titulo1">Teste</p> <p id="conteudo">Teste</p> <p id="rodape">Teste</p> -
É... ainda mesmo vendo o link que você passou não esta abrindo.. Mesmo assim obrigado
-
E ai, beleza? Então, o email chega, chega o anexo, mas quando tento abrir, olha ai: O Adobe Reader não pode abrir 'nome_arq.pdf' porque não há suporte a esse tipo de arquivo ou ele foi danificado(por exemplo, foi enviado como anexo de e-mail e não foi decodificado corretamente).. Palavra por palavra
-
Boa tarde pessoal, beleza? Preciso de ajuda, fiz este script, funciona para enviar qualquer arquivo, menos PDF, podem me ajudar a saber onde esta errado por favor. Abraços public function montaEmailAnexo( $sPasta ) { $boundary = "XYZ-" . date ( "dmYis" ) . "-ZYX"; $this->headers = "From: {$this->de};" . "\n"; $this->headers .= "MIME-Version: 1.0" . "\n"; $this->headers .= "Content-Type: multipart/mixed;"; $this->headers .= "boundary={$boundary}" . "\n"; $this->headers .= "{$boundary}" . "\r\n"; $this->corpoMSG = "--$boundary" . "\r\n"; $this->corpoMSG .= "{$this->mensagem}" . "\r\n\r\n"; $this->corpoMSG .= "$boundary" . "\r\n"; $this->corpoMSG .= "Content-Type: text/html; charset='iso-8859-1'" . "\r\n"; $this->corpoMSG .= "Content-Transfer-Encoding: quoted-printable" . "\r\n"; $this->corpoMSG .= "Content-description:Mail message body" . "\r\n"; $this->corpoMSG .= "Content-Transfer-Encoding: 8bits" . "\r\n"; $this->corpoMSG .= "--$boundary" . "\r\n"; $sType = ( in_array( $sPasta, array( '../Arquivos/Pedidos/', '../Arquivos/Trocas/' ) ) ) ? 'Application/pdf' : ''; for($i = 0; $i < count ( $this->arquivos ); $i ++) { // [ 06/10/2011 13:44:47 ] Comentário : Abrindo a pasta onde os arquivos estão para gerar os anexos $oFp = fopen ( "{$sPasta}{$this->arquivos [$i]}", 'rb' ); if( $oFp ) { $fread = fread ( $oFp, filesize ( "{$sPasta}{$this->arquivos [$i]}" ) ); // [ 06/10/2011 13:45:09 ] Comentário : Criptografando os anexos para não serem lidos por outra pessoa durante o processo de entrega $this->anexos = base64_encode ( $fread ); $this->anexos = chunk_split( $this->anexos ); $this->corpoMSG .= "Content-Type:{$sType}; name={$this->arquivos [$i]}" . "\r\n"; $this->corpoMSG .= "Content-Transfer-Encoding: base64" . "\r\n"; $this->corpoMSG .= "Content-Disposition: attachment; filename={$this->arquivos [$i]}" . "\r\n"; $this->corpoMSG .= "{$this->anexos}" . "\n"; $this->corpoMSG .= "--{$boundary}--" . "\r\n"; } else { echo 'Erro ao abrir o arquivo...'; return false; } fclose ( $oFp ); } if (! @mail ( $this->para, $this->assunto, $this->corpoMSG, $this->headers )) { return false; } else { return true; } } Antes que eu esqueça... O erro que aparece é: Arquivo não pode ser aberto por estar danificado ou não foi decodificado corretamente
-
Código-fonte do JavaScript é exibido na página.
pergunta respondeu ao GuiOr de Tenko em Ajax, JavaScript, XML, DOM
Boa tarde. você colocou o código javascript entre as tags <script> e </script>? -
Bom dia. Pesquise por comando sql SELECT, seria algo assim: $sSql = "select * from login WHERE login = '{$sUsuario}' and senha = '{$sSenha}'";
-
Bom dia, Vê se é isso que você precisa <html> <head> <title></title> <script> var nomes_json = '[{"nome":"Kellen","idade":26},{"nome":"Tenko","idade":30}]'; var lista = eval( nomes_json ); for( var i = 0; i < lista.length; i++ ) { alert( 'Nome : ' + lista[ i ].nome + ' Idade : ' + lista[ i ].idade ); } </script> </head> </html>
-
deixei bem comentado pra você entender passo a passo o que eu fiz
-
Falo... precisando estamos ai
-
Boa tarde. O melhor modo de fazer isso é com AJAX, mas acredito que este modelo te ajude a entender. Deixei tudo com comentários pra ficar fácil de enteder, mas, lembrando, este é um exemplo, procure, pesquise soluções melhores. <html> <head> <title></title> <script> function cidade(estado) { // Criando o array das cidades var aArrayCidade = new Array(); // Adicionando as cidades aArrayCidade['RS'] = new Array('Alecrim','Cacequi','Pinhal Grande'); aArrayCidade['SC'] = new Array('Tubarão', 'Itajaí'); // pega a quantidade de itens do array de cidades do estado var iTamanho = aArrayCidade[ estado ].length; // limpando os campos das cidades document.getElementById('cidade').innerHTML = ''; // Criando e adicionando o primeiro valor oOptions = document.createElement('option'); oOptions.value = ''; oOptions.innerHTML = ':: Selecione ::'; document.getElementById('cidade').appendChild( oOptions ); // percorrendo o array for( var i = 0; i < iTamanho; i++ ) { // criando os objetos options oOptions = document.createElement('option'); oOptions.value = aArrayCidade[ estado ][ i ]; oOptions.innerHTML = aArrayCidade[ estado ][ i ]; // adicionando os elementos document.getElementById('cidade').appendChild( oOptions ); } } </script> </head> <body> <table border="1" cellpadding="1" cellspacing="1" width="40%"> <tr> <td>ESCOLHA UM ESTADO: </td> <td> <select id="estados" onchange="cidade(this.value);"> <option value="">:: Selecione ::</option> <option value="RS">RS</option> <option value="SC">SC</option> </select> </td> </tr> <tr> <td>ESCOLHA A CIDADE: </td> <td> <select id="cidade"> <option value="">:: Selecione ::</option> </select> </td> </tr> </table> </body> </html>
-
Bom dia, beleza? Fiz um modo simples para você entende, mas existem mais soluções. <html> <head> <title></title> <script> vetor_ficticio = ["joao %% 2011-08-01 %% 10", "jose %% 2011-09-01 %% 15", "maria %% 2011-10-01 %% 20", "pedro %% 2011-08-01 %% 18", "rodrigo %% 2011-10-01 %% 23"]; function quebra( vetor_ficticio ){ var iTamanho = vetor_ficticio.length; var arrayNomes = new Array(); var arrayData = new Array(); var arrayIdade = new Array(); for( var i = 0; i < iTamanho; i++ ){ var aDivisao = vetor_ficticio[ i ].split( '%%' ); arrayNomes.push( aDivisao[ 0 ] ); arrayData.push( aDivisao[ 1 ] ); arrayIdade.push( aDivisao[ 2 ] ); } alert( arrayNomes ); alert( arrayData ); alert( arrayIdade ); } quebra( vetor_ficticio ); </script> </head> <body> </body> </html>