DiegO.AS 0 Denunciar post Postado Setembro 29, 2008 Estou enfrentando dificuldades para converter esse ASP para PHP, alguém poderia me ajudaR?? segue o código .asp --------------------------------------------------------------------------------------------------------------------------------- <!--#include file="../conexao.asp"--> <% id_noticia = request("id") path = "d:\inetpub\clientes\HOST952CWN.PLUGIN.COM.BR\Html\fotos\" if request("a")="incluir" then Server.ScriptTimeOut = 99999 set objupload = server.CreateObject("Dundas.Upload.2") objUpload.MaxFileSize = 156400 objupload.UseUniqueNames = true objupload.UseVirtualDir = true objupload.save ("../fotos") dim filename(99) i=0 For Each objUploadedFile in objUpload.Files filename(i) = objUpload.GetFileName(objUploadedFile.Path) Set original = Server.CreateObject("Persits.Jpeg") 'Veirficação do tamanho da imagem, se for maior que 500pixels redimencionamos original.Open path&filename(i) if Original.Width > 500 then L = 500 Original.Width = L Original.Height = Original.OriginalHeight * L / Original.OriginalWidth original.Save path&filename(i) end if Set original = Nothing Set Jpeg = Server.CreateObject("Persits.Jpeg") Jpeg.Open path&filename(i) L = 100 ' tamanho da thumb Jpeg.Width = L Jpeg.Height = Jpeg.OriginalHeight * L / Jpeg.OriginalWidth Jpeg.Sharpen 1, 150 thumb = split(filename(i),".") Jpeg.Save Path & thumb(0)&"-thumbnail"&"."&thumb(1) 'Libera memória Set Jpeg = Nothing i = i+1 Next for y = 0 to i-1 if filename(y) <> "" then Set objRS3 = Server.CreateObject("ADODB.Recordset") SQL2 = "INSERT INTO fotos (id_noticia, foto)" SQL2 = SQL2 & "VALUES (" SQL2 = SQL2 & " "& id_noticia &" , " SQL2 = SQL2 & "'"& filename(y) &"')" Set objRS3 = Conexao.Execute(SQL2) set objRS3 = nothing end if next response.Redirect "inserir_foto.asp?id_noticia="&id_noticia end if if request("a")="excluir" then set oFile = server.CreateObject("Scripting.FileSystemObject") if ofile.FileExists(path & request("foto")) then oFile.DeleteFile(path & request("foto")) end if if ofile.FileExists(path & request("thumb")) then oFile.DeleteFile(path & request("thumb")) end if Conexao.execute("delete FROM fotos Where foto = '"&request("foto")&"'") response.Redirect "inserir_foto.asp?id_noticia="&id_noticia end if %> <!-- © 2003-2004 - CKLESS - Soluções em Internet - www.ckless.com.br - Todos os direitos reservados. Todos os scripts contidos nesta página, desenvolvidos pela CKLESS, encontram-se protegidos pela legislação autoral vigente no país e pelas regras internacionais estabelecidas na Convenção de Berna. Desta sorte, excetuado o uso educacional e científico, são vedadas a reprodução, modificação e distribuição total ou parcial de quaisquer um dos scripts contidos nesta página, a menos que devidamente autorizadas pela CKLESS. Assim, é de responsabilidade do usuário do sistema qualquer violação às normas de direitos autorais nacionais ou internacionais. --> <!--#include file="verifica.asp"--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="libs/cpaint.inc.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> function abre_foto(id){ NewWindow('inserir_foto.asp?id_noticia='+id,'Isolucks',800,600); } function excluir_not(id){ if (id !=0){ if (confirm('Você realmente deseja excluir esta Noticia?')) { cpaint_call('excluir.asp','GET','ex_noticia', id,'noticias','id_noticia', resposta,'TEXT'); } else { }} } function resposta(s){ if (s==1){ alert("Notícia EXCLUIDA com Sucesso!!!") window.location.reload(); } else{ alert("Notícia NÃO ENCONTRADA!!!") } } var win = null; function NewWindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable' win = window.open(mypage,myname,settings) } </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Sistema de Administração - ISOLUCKS</title> <style type="text/css"> <!-- @import url("css/ckless.css"); .style1 {color: #FFFFFF} --> </style> </head> <body> <div align="center"> <form action="inserir_foto.asp?a=incluir&id=<%=request("id_noticia")%>" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table width="776" height="100%" border="0" cellpadding="0" cellspacing="0" class="borda_princ"> <tr> <td width="617" height="14" colspan="4" valign="top"><img src="imagens/login/topologin.jpg" alt="topo" width="776" height="14" /></td> </tr> <tr> <td height="5" colspan="4" valign="top" class="espc_lateral"><img src="imagens/admin/spacer.gif" width="1" height="5" /> </td> </tr> <tr> <td colspan="4" valign="top" class="espc_lateral scan"><img src="imagens/admin/spacer.gif" width="1" height="3" /></td> </tr> <tr> <td height="1" colspan="4" valign="top" class="espc_lateral"><img src="imagens/admin/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td height="10" colspan="4" valign="top" class="espc_lateral"><span class="style1">• </span><span class="tazul">Busque as imagens:<br /> <span class="style1">• <input name="foto1" type="file" class="campo-login" id="foto" size="57" /> <br /> </span> <span class="style1">• <input name="foto2" type="file" class="campo-login" id="foto" size="57" /> <br /> </span> <span class="style1">• <input name="foto3" type="file" class="campo-login" id="foto" size="57" /> <br /> </span> <span class="style1">• <input name="foto4" type="file" class="campo-login" id="foto" size="57" /> <br /> </span> <span class="style1">• <input name="foto5" type="file" class="campo-login" id="foto" size="57" /> <br /> </span><span class="tazul"> <input type="submit" name="Submit2" value="Inserir" /> </span><span class="style1"> </span> </span></td> </tr> <!-- cell de inserir fotos --> <!-- cell de inserir fotos--> <tr> <td height="17" colspan="4" valign="top" class="espc_lateral"><span class="style1">•</span><span class="tazul">Imagens ja cadastradas, clique nelas para excluir:</span></td> </tr> <% SQL = "Select * from fotos Where id_noticia="&request("id_noticia") Set RS4 = Conexao.Execute(SQL) if RS4.eof then %> <td height="17" colspan="4" valign="top" class="espc_lateral"><span class="style1">•</span><span class="tazul">Imagens Não existem fotos cadastradas para essa noticia</span></td> </tr> <% end if do while not RS4.eof thumb = split(RS4("foto"),".") x = RS4("foto") foto = thumb(0)&"-thumbnail"&"."&thumb(1) %> <tr> <td valign="top" class="espc_lateral"><% if not RS4.eof then thumb = split(RS4("foto"),".") foto = thumb(0)&"-thumbnail"&"."&thumb(1) response.Write "<img src=""../fotos/"&foto&""" alt=""foto"" /><br /> " response.Write "<a href=""inserir_foto.asp?a=excluir&id="&request("id_noticia")&"&thumb="&foto&"&foto="&x&""">excluir</a>" RS4.MoveNext end if %> </td> <td valign="top" class="espc_lateral"><% if not RS4.eof then thumb = split(RS4("foto"),".") foto = thumb(0)&"-thumbnail"&"."&thumb(1) response.Write "<img src=""../fotos/"&foto&""" alt=""foto"" /><br />" response.Write "<a href=""inserir_foto.asp?a=excluir&id="&request("id_noticia")&"&thumb="&foto&"&foto="&x&""">excluir</a>" RS4.MoveNext end if %> </td> <td valign="top" class="espc_lateral"> <% if not RS4.eof then thumb = split(RS4("foto"),".") foto = thumb(0)&"-thumbnail"&"."&thumb(1) response.Write "<img src=""../fotos/"&foto&""" alt=""foto"" /><br />" response.Write "<a href=""inserir_foto.asp?a=excluir&id="&request("id_noticia")&"&thumb="&foto&"&foto="&x&""">excluir</a>" RS4.MoveNext end if %> </td> </tr> <% loop %> <tr> <td colspan="4" valign="top" class="espc_lateral"> </td> </tr> </table> </form> </div> </body> </html> --------------------------------------------------------------------------------------------------------------------------------- Eu ficarei extremamente grato a alma caridosa que me ajudar!! :( Compartilhar este post Link para o post Compartilhar em outros sites
hgb7 3 Denunciar post Postado Setembro 29, 2008 http://www.vivaolinux.com.br/dica/Converte...m-ASP-para-PHP/ Espero que ajude... ;) Compartilhar este post Link para o post Compartilhar em outros sites
Mário Monteiro 179 Denunciar post Postado Setembro 29, 2008 é mais facil voce dizer o que precisa e desenvolver em PHP Compartilhar este post Link para o post Compartilhar em outros sites
kevin.veiga 0 Denunciar post Postado Março 6, 2009 Cara na boa, desenvolve o que tu precisa sem pegar o código da CKLESS - Soluções em Internet até pq diz ali que os direitos são reservados até pq esse código deve ter componentes que não funcionam em PHP Compartilhar este post Link para o post Compartilhar em outros sites