<?php
$Data = strtotime($mes."/".$dia."/".$ano_);
$Dia = date('w',strtotime(date('n/\0\1\/Y',$Data)));
$Dias = date('t',$Data);
for ($i=1,$d=1;$d<=$Dias;) {
echo "<tr>";
for ($x=1;$x<=7 && $d <= $Dias;$x++,$i++) {
if ($i > $Dia) {
if ($x == 1) { echo "<td><b>".$d."</b></td>"; }
if ($d == $dia) { echo "<td><u>".$d."</u></td>"; }
else { echo "<td>".$d."</td>"; }
$d++;
}
else { echo "<td> </td>"; }
}
for(;$x<=7;$x++) { echo "<td> </td>"; }
echo "</tr>";
}
?>
- Fórum WMO
- → WeeD's Content
WeeD's Content
There have been 103 items by WeeD (Search limited from 30/03/2023)
#665429 Ajudinha Com Calendario
Posted by WeeD on 28/11/2005, 12:35 in PHP
#664622 Problemas No Calendario
Posted by WeeD on 25/11/2005, 10:52 in PHP
<?php
$Data = strtotime($mes."/".$dia."/".$ano_);
$Dia = date('w',strtotime(date('n/\0\1\/Y',$Data)));
$Dias = date('t',$Data);
for ($i=1,$d=1;$d<=$Dias;) {
echo "<tr>";
for ($x=1;$x<=7 && $d <= $Dias;$x++,$i++) {
if ($i > $Dia) { echo "<td><span ".($d==$dia)." ? style=\"color:#C30;\">".$d++."</span></td>"; }
else { echo "<td> </td>"; }
}
for(;$x<=7;$x++) { echo "<td> </td>"; }
echo "</tr>";
}
?>
#664021 Enviar Email Com Axexo
Posted by WeeD on 23/11/2005, 15:12 in PHP
<?php $acao = $_GET["acao"]; if ($acao == "enviar") { $nome = $_POST["NOME"]; $assunto = $_POST["ASSUNTO"]; $remetente = $_POST["EMAIL"]; $destino = $_POST["OPCOES"]; $mensagem = $_POST["TEXTO"]; $mensagem = wordwrap($mensagem,50,"<br>",1); $arquivo = isset($_FILES["ARQUIVO"]) ? $_FILES["ARQUIVO"] : FALSE; if (file_exists($arquivo["tmp_name"]) and !empty($arquivo)) { $fp = fopen($_FILES["ARQUIVO"]["tmp_name"],"rb"); $anexo = fread($fp,filesize($_FILES["ARQUIVO"]["tmp_name"])); $anexo = base64_encode($anexo); fclose($fp); $anexo = chunk_split($anexo); $boundary = "XYZ-" . date("dmYis") . "-ZYX"; $texto = "--$boundary\n"; $texto .= "Content-Transfer-Encoding: 8bits\n"; $texto .= "Content-Type: text/html; charset=\"ISO-8859-1\"\n\n"; $texto .= "$mensagem\n"; $texto .= "--$boundary\n"; $texto .= "Content-Type: ".$arquivo["type"]."\n"; $texto .= "Content-Disposition: attachment; filename=\"".$arquivo["name"]."\"\n"; $texto .= "Content-Transfer-Encoding: base64\n\n"; $texto .= "$anexo\n"; $texto .= "--$boundary--\r\n"; $headers = "MIME-Version: 1.0\n"; $headers .= "From: \"$nome\" <$remetente>\r\n"; $headers .= "Content-type: multipart/mixed; boundary=\"$boundary\"\r\n"; $headers .= "$boundary\n"; $Enviar=mail($destino,$assunto,$texto,$headers); echo"Email enviado com Sucesso!"; } else { $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: \"$nome\" <$remetente>\r\n"; $Enviar=mail($destino,$assunto,$mensagem,$headers); echo"Email enviado com Sucesso!"; } } ?>
Obriagdo!
#638711 Function();
Posted by WeeD on 14/09/2005, 16:18 in PHP
<?php function CortarTexto($usuario,$caracteres) { if (strlen($usuario) > $caracteres) { return substr($usuario,0,$caracteres) . "..."; } else return $usuario; } ?>
#638098 Paginação "inteligente"
Posted by WeeD on 13/09/2005, 14:34 in PHP
E outra coisa, se não for pedir muito alguem poderia me ajudar ao invez da paginção ser a "metade" do total de registro. ela ficar por padrão assim:
Pagina: 1 de 10 : 1 2 3 >
Pagina: 1 de 10 : 1 2 3 >
Pagina: 1 de 10 : 1 2 3 >
Pagina: 1 de 10 : 4 5 6 >
<?php $num_por_pagina = 5; if (!isset($_GET['pagina'])) { $pagina = 1; } else { $pagina = $_GET['pagina']; } $primeiro_registro = ($pagina * $num_por_pagina) - $num_por_pagina; $consulta = mysql_query("SELECT * FROM users ORDER BY id ASC LIMIT $primeiro_registro,$num_por_pagina"); while($x = mysql_fetch_array($consulta)) { echo(''.$x['id'].' - '.$x['user'].'<br>'); } $contar = mysql_query("SELECT COUNT(*) FROM users"); list($total_usuarios) = mysql_fetch_array($contar); $total_paginas = ($total_usuarios / $num_por_pagina); $prev = $pagina - 1; $next = $pagina + 1; if ($pagina > 1) { $prev_link = "<a href='$PHP_SELF?pagina=$prev'><font class='webdings'>-</font></a>"; } else { $prev_link = ""; } if ($total_paginas > $pagina) { $next_link = "<a href='$PHP_SELF?pagina=$next'><font class='webdings'>+</font></a>"; } else { $next_link = ""; } $total_paginas = ceil($total_paginas); $painel = ""; for ($x = 1; $x <= $total_paginas; $x++) { if ($x == $pagina) { $painel .= "<b class='vinho'>$x</b>"; } else { $painel .= "<a href='$PHP_SELF?pagina=$x'> $x </a>"; } } echo "<br><b>Página: $pagina de $x :</b> $prev_link $painel $next_link"; ?>
Obrigado!
#636670 Segurança Em Receber Dados E Passar Dados.
Posted by WeeD on 09/09/2005, 18:36 in PHP
<?php $id = addslashes($_GET["id"]); $update = mysql_query("UPDATE testes SET views=(views+1) WHERE id='$id'") $consulta = mysql_query("SELECT * FROM testes WHERE id='$id'") $contar = mysql_num_rows($consulta); if (!$resultado) { echo"texto não encontrado."; } else { $x = mysql_fetch_array($consulta); $id = $x["id"]; $titulo = $x["titulo"]; $noticia = $x["noticia"]; } mysql_close(); ?>
#636541 Barra De Status
Posted by WeeD on 09/09/2005, 14:27 in HTML, CSS e Metodologias
Ferramentas > Opções > Facilidades
ae vai ter la duas "checkbox" Permitir Java e Permirtir JavaScript ai na frente vai ter um botão [ Permissões ] ae você abilita a "checkbox" Modificar o texto da barra de status.
#636478 Erros "estranhos"!
Posted by WeeD on 09/09/2005, 12:02 in CSS & Semântica (Tableless)
#636460 Erros "estranhos"!
Posted by WeeD on 09/09/2005, 11:30 in CSS & Semântica (Tableless)
#636458 Problema Com O 'float:' ?
Posted by WeeD on 09/09/2005, 11:27 in CSS & Semântica (Tableless)
#636456 Erros "estranhos"!
Posted by WeeD on 09/09/2005, 11:21 in CSS & Semântica (Tableless)
Grupamento de Seletores
Quando um mesmo bloco de declaração de estilos aplica-se a diversos seletores, podemos grupá-los separando-os por uma vírgula. No exemplo a seguir um fundo amarelo claro será aplicado a todos os elementos strong e a todos os elementos em .
strong, em { background-color: #ffc; }
#636297 Problema Com O 'float:' ?
Posted by WeeD on 08/09/2005, 21:47 in CSS & Semântica (Tableless)
#estrutura_main {
width:700px;
position:absolute;
left:50%;
margin-left:-350px;
background-color:#ffffff;
overflow:auto;
}
#636253 Erros "estranhos"!
Posted by WeeD on 08/09/2005, 20:28 in CSS & Semântica (Tableless)
Exemplo 1:
#IDPAI p#ID1 { ESTILOS; } #IDPAI p#ID2 { ESTILOS; } #IDPAI p#ID1, p#ID2 { ESTILOS; }Exemplo 2:
p#ID1 { ESTILOS; } p#ID2 { ESTILOS; } p#ID1, p#ID2 { ESTILOS; }
tipo no segundo exemplo ele fica os estilos configurados certo corretamente. ai quando eu coloco a "#ID-PAI" na frente, "desconfigura" os estilos pois ele só aplica no "primeiro ID os que vem depois da virgula não aplica os resultados.
- Fórum WMO
- → WeeD's Content
- Privacy Policy
- Regras ·