codice:
function createKey(argLen)
dim alphaArray, ii, position, key
'* definisce l'alfabeto
alphaArray = Array("a","b","c","d","e","f","g","h","i","l","j","k","m","n","o","p","q","r","s","t","u","v","w","x","y","z", _
"A","B","C","D","E","F","G","H","I","L","J","K","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", _
"0","1","2","3","4","5","6","7","8","9","0")
ii = 1
while ii < int(argLen)+1
randomize int(timer * 100)*ii
position = (Int((Rnd * ubound(alphaArray))))
key = key & alphaArray(position)
ii = ii + 1
wend
createKey = key
end function
sub createOrderPdf(file)
'********************************************
'** ISTANZA ******
dim pdf
Set pdf=CreateJsObject("FPDF")
pdf.CreatePDF()
pdf.SetPath("includes/fpdf/")
pdf.Open()
'********************************************
'tutte le tue belle operazioncine di scrittura pdf
'********************************************
pdf.Close()
if file <> "" then
pdf.Output file
else
pdf.Output
end if
end sub
Dim strUrl,strFile
if request.QueryString("save") = "0" then
strUrl = ""
strFile = ""
call createPdf("")
else
strUrl = "public/pdf/" & formatDate(now,"yyyymmdd") & "_" & createKey(5) & ".pdf"
strFile = server.MapPath(strUrl)
call createPdf(strFile)
response.Redirect(strUrl)
end if
%>
dovrebbe andare (l'ho modificato ora ad occhio per togliere tutte le cose che non ti interessano e renderlo più immediato)