Ir para conteúdo
Fórum Script Brasil
  • 0

Problema No Upload De Imagens


franciscocapelo

Pergunta

Eu uso o maxwebportal 1.3. Este é o ficheiro pic_add.asp

Por favor digam-e qual é o erro de codigo asp para o upload de fotos só funcionar da 1ª vez, e deixar de funcionar logo a seguir.

O código onde eu tenho feito alterações e onde penso estar o problema está a negrito.Obrigado.

'***********************************************************************
'** Copyright © 2001 - 2003 Max Yuan All Rights Reserved
'**
'** By using this program, you are agreeing to the terms of the
'** GNU General Public License.
'**
'** This program is free software; you can redistribute it and/or
'** modify it under the terms of the GNU General Public License
'** as published by the Free Software Foundation; either version 2
'** of the License, or any later version.
'**
'** All copyright notices regarding MaxWebPortal must remain intact
'** in the scripts and in the outputted HTML.
'** The "powered by" text/logo with a link back to 
'** [URL=http://www.maxwebportal.com]http://www.maxwebportal.com[/URL] in the footer of the pages MUST
'** remain visible when the pages are viewed on the internet or intranet.
'**
'** Support can be obtained from support forums at:
'** [URL=http://www.maxwebportal.com]http://www.maxwebportal.com[/URL]
'**
'** Email: maxwebportal@hotmail.com
'** ICQ: 148111300
'***********************************************************************
%>
<!--#INCLUDE FILE="config.asp" --> 
<!--#INCLUDE FILE="inc_functions.asp" --> 
<!--#INCLUDE FILE="inc_top.asp" -->

<%
if trim(Request.Form("cat")) = "" then
Response.Redirect("pic.asp")
else
cat = cLng(Request.Form("cat"))
end if
title = ChkString(Request.Form("title"),"title")
desc = replace(ChkString(ChkBadWords(Request.Form("desc")),"message"), "''","'", 1, -1, 1)
key = replace(ChkString(Request.Form("key"),"title"), "''","'", 1, -1, 1)
url = ChkString(Request.Form("url"),"url")
if URL = "" or URL = "http://" then 
URL = ChkString(Request.Form("URL2"),"url") 
end if
turl = ChkString(Request.Form("turl"),"url")
poster = strDBNTUserName
copyright = replace(ChkString(Request.Form("copyright"),"title"), "''","'", 1, -1, 1)
privatePic = Request.Form("private")
today = datetostr(strForumTimeAdjust)

strSQL = "SELECT CAT_ID FROM pic_SUBCATEGORIES WHERE SUBCAT_ID = " & cat
dim rsCategories
set rsCategories = server.CreateObject("adodb.recordset")
rsCategories.Open strSQL, my_Conn
parent = rsCategories("CAT_ID")
rsCategories.Close
set rsCategories = nothing


sString = ""

if len(trim(title)) = 0 then
sString = sString & "<li>Please enter a title.</li>"
else
Set RS=Server.CreateObject("ADODB.Recordset")

strSql="Select TITLE from pic where TITLE='" & title & "'"
RS.Open strSql, my_Conn

if not rs.eof then
sString = sString & "<li>This picture already exists in our database.</li>"
end if
RS.close
end if

if cat = "--Please select one--" then
sString = sString & "<li>Please select category that match your picture.</li>"
end if

if len(trim(desc)) => 255 then
sString = sString & "<li>" &len(trim(desc))&" characters. Your description is too long. 255 characters max.</li>"
end if

[b]if len(trim(URL)) = 7 or trim(URL) = "" then
sString = sString & "<li>You must invalid URL.</li>"
end if

if sString = "" then[/b]

if privatePic = 1 then
owner = "|"&getMemberNumber(STRdbntUserName)&"|"
else 
owner = "0"
end if

strSql = "INSERT INTO PIC"
strSql = strSql & "(TITLE"
strSql = strSql & ", KEYWORD"
strSql = strSql & ", CATEGORY"
strSql = strSql & ", DESCRIPTION"
strSql = strSql & ", POST_DATE"
strSql = strSql & ", PARENT_ID"
strSql = strSql & ", SHOW"
strSql = strSql & ", HIT"
strSql = strSql & ", URL"
strSql = strSql & ", TURL"
strSql = strSql & ", COPYRIGHT"
strSql = strSql & ", OWNER"
strSql = strSql & ", POSTER"
strSql = strSql & ") "
strSql = strSql & " VALUES ("
strSql = strSql & "'" & replace(chkString(title, "SQLString"), "''","'", 1, -1, 1) & "'"
strSql = strSql & ", " & "'" & chkString(key, "SQLString") & "'"
strSql = strSql & ", " & "'" & cat & "'"
strSql = strSql & ", " & "'" & chkString(desc, "SQLString") & "'"
strSql = strSql & ", " & "'" & today & "'"
strSql = strSql & ", " & "'" & parent & "'"
if mlev=4 then
strSql = strSql & ", " & "1"
else
strSql = strSql & ", " & "0"
end if 
strSql = strSql & ", " & "0"
strSql = strSql & ", " & "'" & replace(chkString(url, "SQLString"), "''","'", 1, -1, 1) & "'"
strSql = strSql & ", " & "'" & replace(chkString(turl, "SQLString"), "''","'", 1, -1, 1) & "'"
strSql = strSql & ", " & "'" & chkString(copyright, "SQLString") & "'"
strSql = strSql & ", " & "'" & chkString(owner, "SQLString") & "'"
strSql = strSql & ", " & "'" & chkString(poster, "SQLString") & "'"
strSql = strSql & ")"

my_Conn.Execute (strSQL)
Session.Contents("lastUpload") = ""
Session.Contents("urlTxt2Status") = ""
Session.Contents("uploadBtnStatus") = ""
Session.Contents("clearBtnStatus") = ""
Session.Contents("loggedUser") = ""
%> 
<center>
 <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>"><% if mlev=4 then%>Your picture has been add to our database<%else%>Your picture has been accepted for review.<br>
Please wait 1-3 days for your picture to be reviewed and added.<%end if%></font>
<table border=0 cellpadding=0 cellspacing=0 valign=top align=center width=95%>
<tr>
<td valign=top>
<%mwpThemeBlock_open()%>
<tr>
<td bgcolor="<% =strForumCellColor %>" valign="middle" width=100%>
<table border="0" cellpadding="4" cellspacing="0" width="75%" align="center">
<tr>
<td valign=top width=30%>
<b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">Title:</font></b> 
</td>
<td valign=top align=left width=70%>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><%Response.write replace(replace(title, "''","'", 1, -1, 1), "''","'", 1, -1, 1) %></font>
</td>
</tr>
<tr>
<td valign=top>
<b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">Description:</font></b> 
</td>
<td valign=top align=left>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><% Response.write replace(desc, "''","'", 1, -1, 1) %></font>
</td>
</tr>
<tr>
<td valign=top>
<b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">Keywords:</font></b> 
</td>
<td valign=top align=left>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><% Response.write replace(key, "''","'", 1, -1, 1) %></font>
</td>
</tr>
<tr>
<td valign=top>
<b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">URL:</font></b> 
</td>
<td valign=top align=left>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><% Response.write replace(replace(url, "''","'", 1, -1, 1), "''","'", 1, -1, 1) %></font>
</td>
</tr>
<tr>
<td valign=top>
<b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">Thumbnail URL:</font></b> 
</td>
<td valign=top align=left>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><% Response.write replace(replace(turl, "''","'", 1, -1, 1), "''","'", 1, -1, 1) %></font>
</td>
</tr>
<tr>
<td valign=top>
<b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">Copyright:</font></b> 
</td>
<td valign=top align=left>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><% Response.write replace(copyright, "''","'", 1, -1, 1) %></font>
</td>
</tr>
<tr>
<td valign=top>
<b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">Private:</font></b> 
</td>
<td valign=top align=left>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><% if privatePic = "1" then Response.write "on" else response.write "off" end if%></font>
</td>
</tr>
</table>
</td>
</tr>
<%mwpThemeBlock_close()%>
</td>
</tr>
</table>
<p><a href="pic.asp"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>">Back to Picture Categories</font> </a></p> 
</center>
<meta http-equiv="Refresh" content="10; URL=pic.asp">
<%else%>
<br>
<table border=0 cellpadding=0 cellspacing=0 valign=top align=center width=95%>
<tr>
<td valign=top>
<%mwpThemeBlock_open()%>
<tr>
<td bgcolor="<% =strForumCellColor %>" valign="middle" width=100%>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign=top align=center>
<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">There Was A Problem.</font></p>
<table align="center" border="0">
<tr>
<td><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<ul>
<% =sString %>
</ul>
</font></td>
</tr>
</table>
<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript:history.go(-1)">Go Back To Enter Data</a></font></p>
</td>
</tr>
</table>
</td>
</tr>
<%mwpThemeBlock_close()%>
</td>
</tr>
</table>
<%end if%> 
<br>
<!--#INCLUDE FILE="inc_footer.asp" -->

Editado por bareta
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,3k
×
×
  • Criar Novo...