
Mateustg
Membros-
Total de itens
382 -
Registro em
-
Última visita
Tudo que Mateustg postou
-
CAro Fertel, até que tentei me arrumar aqui, mas não consegui, pois não tenho noções de ASP. Será que você pode me ajudar enviando alguma coisa do código?
-
Ok Victor, fico aguardando!
-
Isto mesmo, estou usando Access
-
Resolvi perguntar se vocês não tem alguma enquete que faça igual a desta pág. aqui para que eu possa aplicar neste código de fotos??? Quero ter um esquema q apareça as fotos e a votação do lado. Será que tem como eu pegar um enquete e jogar como include? <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title></title> </head> <body bgcolor="#000000" text="#ffffff" link="#ffff00" vlink="#ffff00" alink="#ffff00"> <!-- #include file="adovbs.inc" --> <% Dim CONN_STRING Dim CONN_USER Dim CONN_PASS CONN_STRING = "DBQ=" & Server.MapPath("bdteste.mdb") & ";" CONN_STRING = CONN_STRING & "Driver={Microsoft Access Driver (*.mdb)};" CONN_USER = "" CONN_PASS = "" Dim iPageSize Dim iPageCount Dim iPageCurrent Dim strOrderBy Dim strSQL Dim conexao Dim objPagingRS Dim iRecordsShown Dim I Dim varcliques,RSFOTOS, RSrecados iPageSize = 1 id=request.querystring("id") strSQL = "SELECT * FROM fotos WHERE codevento="&id&"" Set conexao = Server.CreateObject("ADODB.Connection") conexao.Open CONN_STRING, CONN_USER, CONN_PASS conexao.Cursorlocation = 3 Set objPagingRS = Server.CreateObject("ADODB.Recordset") objPagingRS.PageSize = iPageSize objPagingRS.CacheSize = iPageSize objPagingRS.Open strSQL, conexao, adOpenStatic, adLockReadOnly, adCmdText If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If iPageCount = objPagingRS.PageCount If iPageCurrent > iPageCount Then iPageCurrent = iPageCount If iPageCurrent < 1 Then iPageCurrent = 1 If iPageCount = 0 Then Response.Write "Nenhuma Foto Encontrada" Else objPagingRS.AbsolutePage = iPageCurrent %> <p align="center"> <font size="+1">Foto <strong><%= iPageCurrent %></strong> de <strong><%= iPageCount %></strong></font> </p> <% Response.Write "<table border=""1"">" & vbCrLf iRecordsShown = 0 varcliques = 0 Do While iRecordsShown < iPageSize And Not objPagingRS.EOF varcliques = objPagingRS("cliques") varcliques = varcliques + 1 Set RSFOTOS = Server.CreateObject("ADODB.RecordSet") strSQL="UPDATE fotos SET cliques = "&varcliques&" WHERE codfoto="&objPagingRS("codfoto")&"" RSFOTOS.Open strSQL, conexao, adOpenStatic, adLockReadOnly, adCmdText %> <center> <div align="center"> <table border="0" width="60%"> <tr> <td width="100%" align="center"><font face="BankGothic Md BT" color="yellow" size="5">:: <%=objPagingRS("nomesfoto")%> ::</font></td> </tr> <tr> <td width="100%"><img src="fotos/<%=objPagingRS("nomefisico")%>" width="456" height="340"></td> </tr> <tr> <td width="100%" align="center">Esta foto foi visualizada <b><%=objPagingRS("cliques")%></b> vezes </td> </tr> <tr> <script language="javascript"> function abrir(){ window.open('mandarecado.asp?id=<%=objPagingRS("codfoto")%>','nome','status=no,scrollbars=no,resizable=no,width=400,height=400');} </script> <td width="100%" align="center"><font size="2" face="Verdana" color="#FFFFFF"> <a href="javascript:abrir()">Postar novo Torpedo</a></font> </td> </tr> <tr> <td width="100%"><% strSQL="SELECT * from recados WHERE codfoto="&objPagingRS("codfoto")&" AND Ucase(valida)='sim' ORDER BY idrecados" Set RSRECADOS = conexao.execute(strSQL) While not RSRECADOS.EOF %> <hr width="80%"> De:<%=RSRECADOS("remetente")%> <br> email:<%=RSRECADOS("email")%><br> Para:<%=RSRECADOS("destinatario")%><br> Torpedo:<%=RSRECADOS("mensagem")%><br> <hr width="80%"> <% RSRECADOS.MoveNext Wend%> </td> </tr> </table> </div> </center> <p align="center"> <%iRecordsShown = iRecordsShown + 1 objPagingRS.MoveNext Loop Response.Write "</table>" & vbCrLf End If objPagingRS.Close Set objPagingRS = Nothing conexao.Close Set conexao = Nothing y=0 %> <div align="center"> <table border="0" width="83%"> <tr> <td width="20%"> <p align="left"> <% If iPageCurrent > 1 Then %> <a href="detalhes.asp?id=<%=id%>&page=<%= iPageCurrent - 1 %>"> << Anterior</a></td> <% End If %> <center> <td width="60%"><p align="center"> <% For I = 1 To iPageCount If y=12 OR y=24 OR y=36 OR y=48 OR y=60 then Response.Write "<br>" If I = iPageCurrent Then %> <span style="background-color: #FF0033">[ <%= I %> ]</span> <% Else %> <a href="detalhes.asp?id=<%=id%>&page=<%= I %>">[ <%= I %> ]</a> <% End If y=y+1 Next If iPageCurrent < iPageCount Then %> </td> </center> <td width="20%"> <p align="right"> <a href="detalhes.asp?id=<%=id%>&page=<%= iPageCurrent + 1 %>">Próxima >></a> </td> </tr> </table> </div> <% End If %> </body> </html>
-
Olá, eu tenho um mural de recados no meu site, o que eu gostaria de fazer é pegar somente o primeiro recado que foi postado lá e exibí-lo na primeira página (home). Gostaria de exibir só o 1° recado, assim: de que está enviando, para quem é e a mensagem enviada. O código gerado para colocar todos os recados no mural é desta página que segue adiante, ela pega todos os recados e vai postando um a um na página, mas eu quero agora colocar só um na home, como posso fazer isso? <% Option Explicit %> <!--#include file="common.asp" --> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Guide Guestbook '** '** Copyright 2001-2003 Bruce Corkhill All Rights Reserved. '** '** This program is free software; you can modify (at your own risk) any part of it '** under the terms of the License that accompanies this software and use it both '** privately and commercially. '** '** All copyright notices must remain in tacked in the scripts and the '** outputted HTML. '** '** You may use parts of this program in your own private work, but you may NOT '** redistribute, repackage, or sell the whole or any part of this program even '** if it is modified or reverse engineered in whole or in part without express '** permission from the author. '** '** You may not pass the whole or any part of this application off as your own work. '** '** All links to Web Wiz Guide and powered by logo's must remain unchanged and in place '** and must remain visible when the pages are viewed unless permission is first granted '** by the copyright holder. '** '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER '** WARRANTIES WHETHER EXPRESSED OR IMPLIED. '** '** You should have received a copy of the License along with this program; '** if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom. '** '** '** No official support is available for this program but you may post support questions at: - '** http://www.webwizguide.info/forum '** '** Support questions are NOT answered by e-mail ever! '** '** For correspondence or non support questions contact: - '** info@webwizguide.com '** '** or at: - '** '** Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom '** '**************************************************************************************** Session.LCID = 1046 'Buffer the response Response.Buffer = True 'Dimension variables Dim strName 'Holds the Users name Dim strpara 'Holds the Users para Dim strEmailAddress 'Holds the Users e-mail address Dim strCountry 'Holds the users country Dim strHomepage 'Holds the Users homepage Dim strComments 'Holds the Users comments Dim dtmEntryDate 'Holds the date the commnets where made Dim intRecordPositionPageNum 'Holds the record position Dim intRecordLoopCounter 'Loop counter for displaying the guestbook records Dim intTotalNumGuestbookEntries 'Holds the total number of records in the database Dim intTotalNumGuestbookPages 'Holds the total number of pages in the database Dim intLinkPageNum 'Holds the page number to be linked to 'If this is the first time the page is displayed then the guestbook record position is set to page 1 If Request.QueryString("PagePosition") = "" Then intRecordPositionPageNum = 1 'Else the page has been displayed before so the guestbook record postion is set to the Record Position number Else intRecordPositionPageNum = CInt(Request.QueryString("PagePosition")) End If 'Initalise the strSQL variable with an SQL statement to query the database by selecting all tables ordered by the decending date strSQL = "SELECT " & strDbTable & "Comments.* FROM " & strDbTable & "Comments ORDER BY Date_stamp DESC;" 'Set the cursor type property of the record set to dynamic so we can naviagate through the record set rsCommon.CursorType = 3 'Query the database rsCommon.Open strSQL, adoCon 'Set the number of records to display on each page by the constant set at the top of the script rsCommon.PageSize = intRecordsPerPage 'Get the guestbook record poistion to display from If NOT rsCommon.EOF Then rsCommon.AbsolutePage = intRecordPositionPageNum %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Recados VIP Seven</title> <!-- The Web Wiz Guestbook v. <% = strVersion %> is written by Bruce Corkhill ©2001-2003 If you want your Guestbook then goto http://www.webwizguide.info --> <!--#include file="includes/header.asp" --> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" height="8"> <tr valign="middle"> <td height="14"> <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="70%"align="center" class="text"> <a href="sign.asp?PagePosition=<% = intRecordPositionPageNum %>" target="_self"><font face="Arial" size="4" color="#FFFF00"><b>Escrever</b><br></font></a></td> </tr> </table></td> </tr> </table> <table width="90%" border="0" align="center" cellspacing="0" cellpadding="0"> <tr> <td align="center" class="text"> <% 'If there are no rcords in the database display an error message If rsCommon.EOF Then 'Tell the user there are no records to show Response.Write "<br>Não há nehum recado cadastrado em nosso sistema" Response.Write "<br>Por favor retorne mais tarde" Response.End 'Display the guestbook Else 'Count the number of enties in the guestbook database intTotalNumGuestbookEntries = rsCommon.RecordCount 'Count the number of pages there are in the guestbook database calculated by the PageSize attribute set above intTotalNumGuestbookPages = rsCommon.PageCount 'Display the HTML number number the total number of pages and total number of records in the guestbook database %> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td align="center" class="text"><br>Existem <% = intTotalNumGuestbookEntries %> recados em <% = intTotalNumGuestbookPages %> página(s) e você está na página nº <% = intRecordPositionPageNum %></td> </tr> </table> <br> <% 'For....Next Loop to display records from the guestbook database For intRecordLoopCounter = 1 to intRecordsPerPage 'If there are no guestbook records left to display then exit loop If rsCommon.EOF Then Exit For 'Read in the values form the database strName = rsCommon("Name") strPara = rsCommon("Para") strCountry = rsCommon("Country") strEmailAddress = rsCommon("EMail") dtmEntryDate = CDate(rsCommon("Date_stamp")) strHomepage = rsCommon("Homepage") strComments = rsCommon("Comments") 'If there is no homepage entry to display the display no URL given If strHomepage = "http://" then strHomepage = "no URL given" 'Else turn the URL stored in the strHomepage variable into a hyperlink Else strHomepage = "<a href=""" & strHomepage & """ target=""_blank"">" & strHomepage & "</a>" End If 'Write the HTML to the web browser to display the guestbook entries %> <table width="100%" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="<% = strTableBorderColour %>"> <tr> <td> <table width="100%" border="0" cellpadding="2" cellspacing="0"> <tr bgcolor="<% = strTableTitleColour %>"> <td colspan="2" class="text"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="27%" class="text"><font color="#FFFF00"><b>De:</b></font> <% Response.Write(strName)%> <td width="20%" class="text"><font color="#ffff00"><b>Para:</b></font> <% Response.Write(strPara) %></td> <td width="80%" align="right" class="text"><font color="#ffff00"><b>Enviado:</b></font> <% = FormatDateTime(dtmEntryDate, VbLongDate) %> às <% = FormatDateTime(dtmEntryDate, VbShortTime) %></td> </tr> </table></td> </tr> <tr> <td colspan="2" bgcolor="<% = strTableColour %>" class="text"><font color="#000000"><% = strComments %></font> </td> </tr> <tr bgcolor="<% = strTableTitleColour %>"> <td width="50%" align="left" class="text"><font color="#ffff00"><b>Cidade:</b></font> <% = strCountry %></td> <td width="50%" align="right" class="text"><font color="#ffff00"><b>E-mail:</b></font> <% Response.Write("<a href=""mailto:" & strEmailAddress & """>" & strEmailAddress & "</a>") %></td> </tr> </table></td> </tr> </table> <br> <% 'Move to the next record in the database rsCommon.MoveNext 'Loop back round Next End If 'Display an HTML table with links to the other entries in the guestbook %> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="50%" align="center" class="text"> <% 'If there are more pages to display then add a title to the other pages If intRecordPositionPageNum > 1 or NOT rsCommon.EOF Then Response.Write vbCrLf & " Page: " End If 'If the guestbook page number is higher than page 1 then display a back link If intRecordPositionPageNum > 1 Then Response.Write vbCrLf & ("<a href=""default.asp?PagePosition=" & intRecordPositionPageNum - 1 & """ target=""_self""><< Anterior</a>") End If 'If there are more pages to display then display links to all the pages If intRecordPositionPageNum > 1 or NOT rsCommon.EOF Then 'Display a link for each page in the guestbook For intLinkPageNum = 1 to intTotalNumGuestbookPages 'If there is more than 7 pages display ... last page and exit the loop If intLinkPageNum > 15 Then If intTotalNumGuestbookPages = intRecordPositionPageNum Then Response.Write(" ..." & intTotalNumGuestbookPages) Else Response.Write(" ...<a href=""default.asp?PagePosition=" & intTotalNumGuestbookPages & """ target=""_self"">" & intTotalNumGuestbookPages & "</a>") 'Exit Loop Exit For 'Else display the normal link code Else 'If the page to be linked to is the page displayed then don't make it a hyper-link If intLinkPageNum = intRecordPositionPageNum Then Response.Write(" " & intLinkPageNum) Else Response.Write(" <a href=""default.asp?PagePosition=" & intLinkPageNum & """ target=""_self"">" & intLinkPageNum & "</a>") End If Next End If 'If it is Not the End of the guestbook entries then display a next link for the next guestbook page If NOT rsCommon.EOF then Response.Write (" <a href=""default.asp?PagePosition=" & intRecordPositionPageNum + 1 & """ target=""_self"">Próxima >></a>") End If 'Finsh HTML the table %> </td> </tr> </table></td> </tr> </table> <% 'Reset Server Variables rsCommon.Close Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing %> </td> </tr> </table> <div align="center"><br> <% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** If blnLCode = True Then Response.Write("<span class=""smText"">Todos os direitos reservados à www.vipseven.com.br " & "</span>") Response.Write("<br><span class=""smText"">Copyright ©2004 VIP Seven</span>") End If '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** %> <br> </div> <!--#include file="includes/footer.asp" -->
-
Valeu Idrema DS pela ajuda!!! Obrigado!
-
Olá, alguém poderia me passar um tutorial ou me falar como faço um efeito de fogo no Fireworks??? (isso se tiver como fazer)
-
Avaliem Este Novo Trabalho Por Favor
um tópico no fórum respondeu Mateustg em Avaliações de Trabalhos
Kd o endereço da página???? -
Reginaldo, então eu tenho que colocar qualquer valor neste item??
-
É somente este arquivo? Não há outro? Pois não encontrei nada de errado neste daqui.
-
E que mal lhe pergunte, pois não sei quase nada de ASP, eu devo fazer o que? Devo fazer o CInt() retornar True? Como Faço?
-
o passw_postal está com o tipo: número
-
Valeu Diraol, vou tentar este, mas acabei conseguindo fazer um outro aqui. Valeu mesmo!
-
Ainda não!!!! Mas consegui este, só que ele não aceita que eu coloque uma imagem, só um texto. Será que tem como mudá-lo? <html> <body> <head> <!-começa aqui-> <HEAD> <script LANGUAGE="JavaScript"> <!-- function popupWin() { text = "<html>\n<head>\n<title></title>\n<body>\n"; text += "<center>\n<br>"; text += "<a href='paginadois.html' target='_blank'><font face=verdana size=1 color=black>Página principal</font></a>"; text += "</center>\n</body>\n</html>\n"; setTimeout('windowProp(text)', 3000); // depois de 3 segundos abre a janela } function windowProp(text) { newWindow = window.open('paginadois.html','newWin','width=300,height=100'); newWindow.document.write(text); setTimeout('closeWin(newWindow)', 5000); // depois de 5 segundo fecha } function closeWin(newWindow) { newWindow.close(); } //--> </script> </HEAD> <BODY onLoad="popupWin()"> <center> após 3 segundos a janela popup abre e depois de 5 segundos ela fecha </center> </body> </html>
-
Não deu certo! você tem outro?
-
Olá, estou precisando de um popup que abra uma imagem ao entrar no site e passados uns 5 ou 7 segundos, este popup se feche automaticamente. Como faço isso???
-
Eu tenho um sistema de cartões postais, eu consegui fazer o envio do cartão e recebi em meu email a notificação do cartão (Deixe-me informá-lo de que tosta enviou-lhe um postal digital. Para o ver siga o link : http://www.vipseven.com.br/pd/pd/visualiza...ident=&psw=8852 - o postal vai estar disponível no nosso site até ao dia 4/23/2004). Ele mostra o endereço que tenho que acessar para ver o cartão, porém hora que cliko no link ele vai para pág. e me apresenta o seguinte erro: Microsoft VBScript runtime error '800a000d' Type mismatch: 'Clnt' /pd/pd/visualizar.asp, line 51 a linha 51 é esta: 51 SQLStmt = "SELECT * FROM postal WHERE ID_POSTAL = " & _ 52 CInt(ident) & " AND passw_postal = " & CInt(psw) Aqui está todo o cód. da pág. visualizar.asp <% Set Conn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") Conn.Open "DBQ=" & Server.MapPath("./postaisdigitais.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "", "" Dim apanhar Dim ident Dim psw ' erring diz-nos se o postal jà existe ' exists. Por defeito achamos que sim. Dim erring ' Normalmente uso 0 e 1 como boolean, ' julgo que ocupa menos recursos ao servidor do que ' um True e False erring = 0 ' Recebemos a informação dos argumentos ' relativos ao postal a ver; ' ficamos a saber se é uma pré-visualização ' ou um destinatário a querer ver o seu postal apanhar = Request("uq") if apanhar = "Previsualizar" then ' para pré-visualizar entra-se aqui ' Criei sessions para guardar a informação, ' assim posso aceder à mesma a qualquer altura session("postal") = Request("R1") session("nomede") = Request("nomede") session("emailde") = Request("emailde") session("nomepara") = Request("nomepara") session("emailpara") = Request("emailpara") session("message") = Request("mensagem") else ' aqui temos o identificador do postal digital, ' para sabermos qual a ir buscar. ' Percorremos a Base de Dados para ver se está ' tudo correcto. ident = Request("ident") ' Buscamos a password ' Não queremos que as pessoas vão ver os postais dos ' só por mudar o ID de 12 para 13 e afins. ' Com a password cada postal só pode ser visto ' pela pessoa que sabe a password, neste caso nem precisa de saber ' só tem de seguir o link que lhe foi enviado psw = Request("psw") ' Esta é uma simples declaração de SQL para ' validar o Id e a password SQLStmt = "SELECT * FROM postal WHERE ID_POSTAL = " & _ CInt(ident) & " AND passw_postal = " & CInt(psw) ' Executamos o SQL rs.Open SQLstmt, Conn, 1, 2 if rs.EOF then 'O Postal digital não existe ou a password está errada! erring = 1 else 'O Postal existe. Vamos preencher as variáveis de 'sessão com a informação da BD. session("postal") = rs("postal_postal") session("nomede") = rs("nomede_postal") session("emailde") = rs("emailde_postal") session("nomepara") = rs("nomepara_postal") session("emailpara") = rs("emailpara_postal") session("mensagem") = rs("mensagem_postal") end if rs.close end if %> <html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <body bgcolor=white> <% ' Aqui vamos verificar se houveram erros if erring <> 1 and (apanhar="Previsualizar" or apanhar="defora") and len(session("postal")) <> 0 then ' ´se tudo estiver bem mostramo sa informação %> <div align="left"> <table border="0" width="580" cellspacing="0" cellpadding="0"> <tr> <td width="50%" valign="top" align="left"><br> <br> <img src="imagens/<%=session("postal")%>.jpg" hspace="5" border="2" WIDTH="354" HEIGHT="231"> </td> <td width="50%"> <table border="0" cellspacing="3" width="100%" cellpadding="3" bordercolor="#000000" height="202"> <tr> <td width="100%" height="109"> <p align="left"> <font face="Arial"><br> <small>Remetente:</small> <strong><%=session("nomede")%></strong> <br> <small>E-Mail Remetente:</small><small><strong> <%=session("emailde")%></strong></small> <br> <small>Destinatario:</small><strong><small> <%=session("nomepara")%></small></strong> <br> <small>E-mail Destinatario:</small><small><strong> <%=session("emailpara")%></strong></small> </font> </td> </tr> <tr> <td width="100%"> <font face="Arial"> <small>Message:</small><br> <font size="2"><strong> <%=session("message")%></strong> </font> </font> </td> </tr> <tr> <td width="100%" align="center" valign="middle" height="29"> <% 'se apanhar = "seeit" mostramos os botões 'de envio e repetição if apanhar="Previsualizar" then %> <p align="left"><br> <a href="javascript:history.back()"> Repetir </a> <a href="enviar.asp"> Enviar </a> </td> </tr> </table> </td> </tr> </table> </div> <% ' alguém está a ver um postal já criado ' mostra-se o botão de resposta else %> <br><br><br> <a href="construir.asp" target="_self" > Criar Tambem Um Postal </a> <% end if ' este else só funciona se não existir nenhum postal else %> <br><br> <center> ERRO.... </center> <br> <% end if ' Aqui é o local onde removemos Postais antigos, com mais de 30 diasall the postcards ' Não quero ter uma Base de Dados cheia de lixo ' por isso apago todos os regitos com mais de 30 dias. ' Pode perguntar.. "-Porque meteu este código aqui?" ' A minha resposta é: ' "- Porque é o local onde se veêm postais, ' se vamos ver um postal apagamos os que jà não interessam ' mas poderia estar em outro lado qualquer." ' Vamos buscar a data do servidor d = now() ' vamos decrementar 30 dias à mesma d = DateAdd("d",-30,d) ' Corremos o SQL que vai remover tudo SQLStmt = "DELETE FROM postal WHERE data_postal < #" & d & "#" rs.Open SQLStmt,Conn,1,2 %> </body> </html> Alguém pode me ajudar a resolver esta?
-
Bem, esse aqui é todo o cód. da pág. enviar.asp <% 'Aqui conectamos com a Base de Dados Set Conn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") Conn.Open "DBQ=" & Server.MapPath("./postaisdigitais.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password" ' Esta é a variável usada como identificador ' do postal digital Dim identifier ' goby é uma variável boolean para ' ajuda na validação Dim goby goby = 1 'lets start it with True %> <html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <body bgcolor=white> <font face=3D"Arial"> <small><strong> <% ' Validamos então o nome; tem de ter um tamanho ' mínimo de 2 caracteres if len(session("nomepara")) < 2 then ' se existir problemas marcamos logo a nossa variável goby = 0 end if if len(session("nomede")) < 2 then goby = 0 end if ' validamos o email, If Len(session("emailde")) <= 5 Then goby = 0 Else If InStr(1, session("emailde"), "@", 1) < 2 Then goby = 0 Else If InStr(1,session("emailde"), ".", 1) < 4 Then goby = 0 End If End If End If If Len(session("emailpara")) <= 5 Then goby = 0 Else If InStr(1, session("emailpara"), "@", 1) < 2 Then goby = 0 Else If InStr(1,session("emailpara"), ".", 1) < 4 Then goby = 0 End If End If End If ' Aqui verificamos se o texto não tem mais de 500 caracteres. If len(session("message")) >= 500 Then goby = 0 End If ' Vamos agora verificar a nossa variável ' se estiver a zeros avisamos que hà erros if goby = 0 then %> <br><br><br><br><br> <center>ERRO....</center><br> <% end if ' Se não hà erros introduzimos a informação para a Base de Dados ' e enviamos a informação por email para o destinatário If goby = 1 then 'fazemos o update à Base de Dados SQLStmt = "INSERT INTO postal (" & _ "passw_postal, postal_postal, nomepara_postal, nomede_postal, " & _ "emailde_postal, emailpara_postal, mensagem_postal, data_postal) " & _ "VALUES (" ' vamos criar um número aleatório para que o postal fique protegido, ' usamos o randomize/rnd para criar um número aleatório randomize() passw = Int((9999-1)*Rnd + 1) SQLStmt = SQLStmt & passw & ",'" & session("postal") & _ "','" & session("nomepara") & "','" & _ session("nomede") & "','" & _ session("emailde") & "','" & _ session("emailpara") & "','" & _ session("message") & "',Now)" ' escrevemos a informação na BD definitivamente rs.Open SQLStmt, Conn, 1, 2 SQLStmt = "Select max(id_postal) AS maximo from postal" rs.Open SQLStmt, Conn, 1, 2 ident = rs("maximo") ' Vamos aqui usar o componente ASPMail ' pode usar um outro qualquer, este é o que é usado ' no servidor ond estamos Set Mailer = Server.CreateObject("SMTPsvg.Mailer") Mailer.RemoteHost = "mail.vipseven.com.br" Mailer.FromName = "O Site" Mailer.FromAddress = "vipseven@vipseven.com.br" Mailer.AddRecipient " ", session("emailpara") Mailer.Subject = "Envio de Postal Digital para si de " & session("nomede") & " ..." ' vamos buscar a data que está no servidor d = now() ' vamos acrescentar-lhe 30 dias, para por no aviso de limite ' de expiração do postal digital d = DateAdd("d",30,d) enviar = "Deixe-me informá-lo de que " & session("nomede") & _ Chr(13) & Chr(10) & _ " enviou-lhe um postal digital. Para o ver " & _ "siga o link :" & _ Chr(13) & Chr(10) & Chr(13) & Chr(10) & _ "http://www.vipseven.com.br/pd/pd/visualizar.asp?uq=defora&" & _ "ident=" & ident & _ "&psw=" & passw & " " & Chr(13) & Chr(10) & _ " o postal vai estar disponível no nosso site até ao dia " & _ formatDateTime(d,2) & _ Chr(13) & Chr(10) & Chr(13) & Chr(10) & _ Chr(13) & Chr(10) & _ " Obrigado," Mailer.BodyText = enviar Mailer.SendMail If Err <> 0 Then Response.write "ERRO..." Response.Write "<br><br>" & "Houve um Erro : " & Err.description & "<br><br>" Response.Write "<center><p>ERRO DO LADO DO SERVIDOR, " & "contacte o nosso webmaster.</p></center>" goby = 0 Else Response.Write "<br><br><br><center><p>POSTAL DIGITAL ENVIADO" & " SEM PROBLEMAS ...<br>" End if Set Mailer = nothing End If ' penso que reparou que uso o JavaScript history.back ' com este não perdemos a informação jà criada anteriormente %> <center> <p> <a href="javascript:history.go('-2')"> <Refazer> </a> </p> </center> </strong></small></font> </body> </html>
-
Nada! não consegui achar erro!
-
Tenho um sistema de envio de cartão postal, só que na hora do envio ele me apresenta o seguinte erro: Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft] ODBC [Microsoft Access Driver] no current recorder /infosis/pd/pd/enviar.asp line 91 a linha 91 do arq. enviar.asp é essa: 90 ' escrevemos a informação na BD definitivamente 91 rs.Open SQLStmt, Conn, 1, 2 92 SQLStmt = "Select max(id_postal) AS maximo from postal" 93 rs.Open SQLStmt, Conn, 1, 2 94 ident = rs("maximo") O q está ocorrendo? alguém pode me ajudar?
-
Olá, eu gostaria de estar colocando no meu site um sistema de música. quando a pessoa entrar no site ela poderá habilitar o som e se ela quiser também poderá mudar de música, só que o problema todo está ai, eu não sei utilizar o Flash, não sei nada. Será que alguém pode me passar um tutorial de como fazer isso ou me ajudar a fazer???
-
procura em www.scriptfacil.com, lá tem um código assim
-
Olá, eu estou precisando de um código já pronto de cartão virtual. Eu já baixei vários (do SB, Wmonline, plugmaster, cód livre, etc), mas não consegui utilizar nenhum, será que alguma alma caridosa poderia me passar um código em funcionamento.