
Mário Miranda
Membros-
Total de itens
173 -
Registro em
-
Última visita
Sobre Mário Miranda

Contatos
-
Website URL
http://
-
ICQ
0
Mário Miranda's Achievements
0
Reputação
-
Olá pessoal. Tenho uma pagina com com 02 campos: O primeiro para digitar o código e o segundo seria descrição do produto. Gostaria de saber como eu posso fazer para que quando eu digitar o codigo, o segundo campo trazer a descrição do produto referente ai codigo digitado. Sei que isso se faz com AJAX mas não sei como fazer. Desde já agradeço a atenção.
-
Boa tarde Como eu faço pra saber se o meu apache está rodando os scripts cgi? Obrigado e até +
-
Boa tarde a todos. Fui chamado para uma entrevista de emprego em uma empresa de desenvolvimento de sistemas web. Vou para a entrevista, porém a pessoa que me chamou me pediu um portfólio do sistema que eu fiz, que por sinal é meu único sistema em php. Como eu poderia fazer esse portfólio? Obrigado desde já
-
Olá. Só uma sugestão: você poderia guardar os estados no banco de dados também. Assim você não precisa colocar um monte de estados no seu codigo html, e sim trazer esses estados direto do banco e jogar o resultado no combobox dos estados.
-
Bom dia. Gostaria de saber como mapear uma impressora windows em uma máquina linux, mas pelo modo texto. O Samba está funcionando. Obs: estou usando o slackware. Desde já agradeço
-
Olá Kandrade. Não deu certo... Fiz o que você me passou, o servidor mapeou a pasta...mas quando executo o script php com a função fopen, o servidor me retorna Warning: fopen(/tmp/teste/teste) [function.fopen]: failed to open stream: Permission denied in /usr/local/apache2/htdocs/teste_escreve.php on line 2
-
Boa tarde. Mapeei uma pasta windows em um servidor linux da seguinte maneira: smbmount //192.168.25.18/mario /tmp/imp12 -o username=Administrador O mapeamento acontece normalmente, só que estou tentando usar uma função PHP para criar arquivos dentro desta pasta mapeada, só que o servidor me retorna "permissão negada". Já olhei as propriedades da pasta mapeada....está tudo certo...desmarcado o "Somente leitura"e tudo mais. Frente a isso, tentei mudar o dono da pasta mapeada.. chown daemon:daemon /tmp/imp12 Nesse comando, o linux me retorna chown: changing ownership of `/tmp/imp12': Operation not permitted Em uma ultima tentativa, tentei mudar os direitos da pasta: chmod 777 ou chmod +x /tmp/imp12 O linux não me retorna erro, mas também não muda os direitos. Por favor...estou mesmo precisando dar um jeito de poder fazer esse tipo de função nessa pasta. Obrigado
-
Então.. Os atributos já estão corretos...a pasta que eu mapeio (que está em uma maquina windows) já está com o atributo "Somente leitura" desmarcado. Aí eu pensei em dar o chmod +x no caminho em que eu mapeio....mas os direitos permanecem os mesmos, tentei então executar chown daemon:daemon /mnt/imp12 e o linux me retorna chown: changing ownership of `/tmp/imp12': Operation not permitted
-
Boa tarde. Tenho um servidor php em linux e nele tem uma pasta que mapeia uma pasta de um cliente windows. Estou tentando executar a função fopen para criar um arquivo nesse diretorio...porém está dando permissão negada. O que pode ser? Desde já agradeço a atenção.
-
Olá babaloricha. Segue o código da primeria tela: <html> <head> <title>face</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!-- ImageReady Slices (face.gif) --> <table id="Table_01" width="721" height="501" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="17"> <img src="image/face_01.gif" width="720" height="77" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="77" alt=""></td> </tr> <tr> <td colspan="7" rowspan="2"> <img src="image/face_02.gif" width="116" height="23" alt=""></td> <td> <img src="image/face_03.gif" width="71" height="14" alt=""></td> <td> <img src="image/face_04.gif" width="10" height="14" alt=""></td> <td> <img src="image/face_05.gif" width="105" height="14" alt=""></td> <td> <img src="image/face_06.gif" width="20" height="14" alt=""></td> <td> <img src="image/face_07.gif" width="128" height="14" alt=""></td> <td> <img src="image/face_08.gif" width="33" height="14" alt=""></td> <td> <img src="image/face_09.gif" width="104" height="14" alt=""></td> <td> <img src="image/face_10.gif" width="26" height="14" alt=""></td> <td> <img src="image/face_11.gif" width="65" height="14" alt=""></td> <td> <img src="image/face_12.gif" width="42" height="14" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="14" alt=""></td> </tr> <tr> <td colspan="30" rowspan="10"> <? switch($_REQUEST['id']){ case 1: include('/usr/local/apache2/htdocs/busca_cliente1.php'); break; case 2: include('/usr/local/apache2/htdocs/result_busca1.php'); break; } ?> </td> <td> <img src="image/spacer.gif" width="1" height="9" alt=""></td> </tr> <tr> <td rowspan="4"> <img src="image/face_14.gif" width="12" height="72" alt=""></td> <td colspan="5"> <a href="/face.php?id=1"><img src="image/face_15.gif" alt="" width="85" height="22" border="0"></a></td> <td rowspan="4"> <img src="image/face_16.gif" width="19" height="72" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="22" alt=""></td> </tr> <tr> <td colspan="5"> <img src="image/face_17.gif" width="85" height="9" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="9" alt=""></td> </tr> <tr> <td colspan="4"> <img src="image/face_18.gif" width="72" height="22" alt=""></td> <td rowspan="2"> <img src="image/face_19.gif" width="13" height="41" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="22" alt=""></td> </tr> <tr> <td colspan="4"> <img src="image/face_20.gif" width="72" height="19" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="19" alt=""></td> </tr> <tr> <td colspan="7"> <img src="image/face_21.gif" width="116" height="18" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="18" alt=""></td> </tr> <tr> <td colspan="7"> <img src="image/face_22.gif" width="116" height="20" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="20" alt=""></td> </tr> <tr> <td colspan="3"> <img src="image/face_23.gif" width="66" height="19" alt=""></td> <td colspan="4" rowspan="2"> <img src="image/face_24.gif" width="50" height="39" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="19" alt=""></td> </tr> <tr> <td colspan="3"> <img src="image/face_25.gif" width="66" height="20" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="20" alt=""></td> </tr> <tr> <td colspan="6"> <img src="image/face_26.gif" width="97" height="19" alt=""></td> <td rowspan="2"> <img src="image/face_27.gif" width="19" height="40" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="19" alt=""></td> </tr> <tr> <td colspan="6"> <img src="image/face_28.gif" width="97" height="21" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="21" alt=""></td> </tr> <tr> <td colspan="7"> <img src="image/face_29.gif" width="116" height="21" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="21" alt=""></td> </tr> <tr> <td colspan="7"> <img src="image/face_30.gif" width="116" height="19" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="19" alt=""></td> </tr> <tr> <td colspan="4"> <img src="image/face_31.gif" width="76" height="14" alt=""></td> <td colspan="3" rowspan="5"> <img src="image/face_32.gif" width="40" height="171" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="14" alt=""></td> </tr> <tr> <td colspan="4"> <img src="image/face_33.gif" width="76" height="21" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="21" alt=""></td> </tr> <tr> <td colspan="2"> <img src="image/face_34.gif" width="38" height="19" alt=""></td> <td colspan="2" rowspan="3"> <img src="image/face_35.gif" width="38" height="136" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="19" alt=""></td> </tr> <tr> <td colspan="2" rowspan="2"> <img src="image/face_36.gif" width="38" height="117" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="84" alt=""></td> </tr> <tr> <td colspan="10"> <img src="image/face_37.gif" width="604" height="33" alt=""></td> <td> <img src="image/spacer.gif" width="1" height="33" alt=""></td> </tr> <tr> <td> <img src="image/spacer.gif" width="12" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="26" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="28" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="10" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="8" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="13" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="19" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="71" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="10" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="105" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="20" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="128" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="33" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="104" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="26" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="65" height="1" alt=""></td> <td> <img src="image/spacer.gif" width="42" height="1" alt=""></td> <td></td> </tr> </table> <!-- End ImageReady Slices --> </body> </html> Na primeira case o código é esse: <? include_once('valida_usu.php'); $usu_loja=$_COOKIE['loja_usu']; $loja=$_COOKIE['loja_padrao']; ?> <html> <head> <title>-->>Help System Tecnologia-Guias de entrega<<--</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> .botao{ font-size:10px; font-family:Verdana,Helvetica; font-weight:bold; color:white; background: #638cb5 url(pro_six_1b.gif); border:0px; width:80px; height:19px; } .text{ font-size:12px; font-family:Verdana,Helvetica; font-weight:bold; color:black; background: #638cb5 url(pro_six_0b.gif); border:10px; width:280px; height:16px; } </style> </head> <script> function verify(frm) { if(frm.nome.value.length == 0) { alert('Digite um nome'); return false; } } function UP_Letra(evento, valida, maiuscula) { if (evento.target) { codigo = evento.target; } else { codigo = event.srcElement; } element = codigo.value; if (maiuscula == 'true') { element = element.toUpperCase(); } var new_element = ""; for (vIdx=0; vIdx < element.length; vIdx++) { if (valida.indexOf(element.substr(vIdx, 1)) != -1 || (maiuscula == 'false' && valida.toLowerCase().indexOf(element.substr(vIdx, 1)) != -1) ) { new_element = new_element + element.substr(vIdx, 1); } } codigo.value = new_element; } </script> <body> <div align="left"> <li><font color="RED" size="3"> Emissão de guias</font></li> </div> <table border=1 align="center" class="table"> <form action="result_busca.php" method="post" name="logar" ONSUBMIT="return verify(logar)"> <tr><td align=center><b>Nome</td></tr> <tr></td></tr> <tr><td><input type="text" name="nome" size=50 onkeyup="UP_Letra(event, ' ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'true')" class="text"></td></tr> </table> <table align=center class="table"> <td><input type="submit" value="Buscar" name="buscar" Onclick="return verify(logar)" class="botao"></td> </table> </form> </body> </html> E na segunda case, que é quando vem o resultado: <? include_once('/usr/local/apache2/htdocs/valida_usu.php'); $usu_loja=$_COOKIE['loja_cookie']; $loja=$_COOKIE['loja_padrao']; $nome=strtoupper($_REQUEST['nome']); echo" <script language=\"JavaScript\"> function openHelp(codigo){ var codigo = codigo { window.open(\"altera_cli.php?id=\"+codigo,\"helpwindow\",\"toolbar=no,menubar=no,scrollbars=yes,width=600,height=300\"); return false; } } </script>"; define('QTD_P_PAGINA',8); $con=pg_connect("host=192.0.1.13 port=5432 dbname=entregas user=postgres password=123456"); //paginação $query_tot_reg = pg_query($con,"select * from tabela_cliente where nome like '$nome%'"); $result_tot_reg=pg_num_rows($query_tot_reg); if($_REQUEST['offset'] <= 1){ $offset=1; $limiter=0; }elseif($_REQUEST['offset'] > 1){ $paginas= ceil($result_tot_reg / QTD_P_PAGINA); if($_REQUEST['offset'] > $paginas) $offset=$paginas; else $offset=$_REQUEST['offset']; $limiter=($offset-1)*QTD_P_PAGINA; } //fim da paginacao //echo"o valor de offset é $offset"; $query=pg_query($con,"select count (*) as conta from tabela_cliente where nome like '$nome%'"); $result=pg_fetch_assoc($query); if($result['conta']>0){ $query1=pg_query($con,"select nome, logradouro, numero, bairro, tipo,id_cliente,telefone, cidade from tabela_cliente where nome like '$nome%' order by nome desc limit ".QTD_P_PAGINA." offset $limiter"); $linhas=pg_num_rows($query1); //echo"select nome, logradouro, numero, bairro, tipo,id_cliente,telefone, cidade from tabela_cliente where nome like '$nome%' order by nome desc limit ".QTD_P_PAGINA." offset $limiter"; echo "<br> <div align=\"left\"> <li><font color=\"RED\" size=\"3\"><a href=\"busca_cliente.php\">Emissão de guias</a> - Busca de clientes</font></li> </div>"; echo "<table border=\"0\" align=center cellpadding=\"0\" cellspacing=\"0\" width=100%>"; echo "<tr><td><font color=red size=\"3\">Codigo do Cliente</font></td>"; echo "<td><font color=red size=\"3\">Nome</font></td>"; echo "<td><font color=red size=\"3\">Tipo Endereço</font></td>"; echo "<td><font color=red size=\"3\"> Endereço</font></td>"; echo "<td><font color=red size=\"3\">Telefone</font></td></font></tr>"; while($result1=@pg_fetch_assoc($query1)){ echo"<tr>"; echo"<font size=\"2\"><td><a href=info_cliente.php?manda=".$result1['id_cliente']." ><font size=\"1\">".$result1['id_cliente']."</a></font></td> <td><font size=\"2\"><a onclick=\"return openHelp(".$result1['id_cliente'].")\">".$result1['nome']."</font></td> <td><font size=\"2\">".$result1['tipo']."</font></td> <td><font size=\"2\">".$result1['logradouro']."</font></td> <td><font size=\"2\">".$result1['telefone']."</font></td>"; } echo "</tr></table>"; echo"<table align=\"center\"> <tr>"; if($offset > 1){ echo"<td> <td><font><a href=\"result_busca.php?offset=".($offset - 1)."&nome=".$_REQUEST['nome']."\">Anterior</font></a>  </td></td>"; } if($offset -1>= 0 and $linhas>=7){ echo"<td><font> <a href=\"result_busca.php?&offset=".($offset + 1)."&nome=".$_REQUEST['nome']."\">Próximo</a></font></td>"; } echo"</tr></table>"; }else{ echo"<table border=2 align=\"center\">"; echo" <tr><td align=\"center\"><font color=\"#0000FF\">Registro não encontrado. <br><a href=\"java script:history.back()\">Consultar novamente</a></font></td></tr></div>"; } @pg_free_result($query1); pg_free_result($query_tot_reg); pg_close($con); ?>
-
Boa tarde. Trabalho com PHP a quase 1 ano e nunca montei face nenhuma....apenas o bruto mesmo. Estou querendo fazer faces de site, que ainda não sei fazer. Só que as minhas faces ficam distorcidas quando chamo algum link. Vou colocar uma tela com a face em formato certo e outra em formato distorcido. (por favor não reparem na simplicidade...estou começando ainda :D ) Face sem distorcer: Face distorcida: Como faço para não distorcer? Obrigado e até mais
-
(Resolvido) Dúvida com verificação de campos preenchidos
pergunta respondeu ao Mário Miranda de Mário Miranda em Ajax, JavaScript, XML, DOM
Certo jefmolino! Deu certo. Obrigado pela dica. Até + -
Bom dia a todos. Tenho um conjunto de verificações para um form. Esse conjunto verifica se algum campo está vazio. Neste form tem 02 botões: 1 que serve para alterar um registro e outro para excluir. Eu gostaria de saber como se faz para a verificação funcionar apenas para o botão alterar. Está assim: <script> function verify(frm) { if(frm.nome.value.length == 0) { alert('Digite o nome completo!'); return false; } if(frm.RG.value.length == 0) { alert('Digite o RG!'); return false; } if(frm.CPF.value.length == 0) { alert('Digite o CPF!'); return false; } if(frm.tel1.value.length == 0) { alert('Digite um telefone para contato!'); return false; } if(frm.veiculo.value.length == 0) { alert('Digite o veículo que será utilizado pelo motorista.'); return false; } if(frm.placa.value.length == 0) { alert('Digite a placa do veículo!'); return false; } if(frm.cnh.value.length == 0) { alert('Digite o número da carteira de habilitação do motorista.'); return false; } } E no form está assim: <form action=\"/inc/mostra_motoristas.inc.php\" method=\"post\" name=\"cadastrar\" ONSUBMIT=\"return verify(cadastrar)\"> Só que eu queria que a verificação só funcionasse no botão de alterar, e não no de excluir. Obrigado a todos
-
Blza Vampiro. Valeu pela dica
-
Olá pessoal. Pensando em evitar gambiarras, vou postar aqui o que eu fiz para descobrir o dia seguinte. Gostaria da opinião de vocês pois não quero fazer gambiarras e se tiver um jeito mais fácil, por favor me digam. Obrigado. Seguem as linhas: $calendario=cal_days_in_month(CAL_GREGORIAN,date('m'),date('year'); //descobre quantos dias tem o mes atual $dia=date('d'); if($dia==30 and $calendario==31){ //se dia atual for 30 e o mes tiver 31 dias $dia=date('d')+1; }elseif($dia==31){ //se dia atual for 31 $dia==1; }elseif($dia==28 and $calendario==28){ //se o dia atual for 28 e o mes tiver 28 dias $dia=1; }elseif($dia==28 and $calendario==29){ //se o dia atual 28 e o mes tiver 29 dias $dia=date('d')+1; } Obrigado a todos