Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    non legge una variabile


    NON è POSSIBILE
    La variabile della riga rossa ok quella blu che fine fa?

    codice:
    <%
    percorso = "/public/immagini/"
    
    ByteRicevuti = Request.TotalBytes
    
    if ByteRicevuti > 0 then
    	DatiRicevuti = Request.BinaryRead(ByteRicevuti)
    	For i = 1 To lenB(DatiRicevuti)
    		FileBinario = FileBinario & chr(ascB(midB(DatiRicevuti,i,1)))
    	Next
    	FirmaFile = left(FileBinario,instr(FileBinario,"" & vbCrLf)-1)
    	ArrPezzi = split(FileBinario,FirmaFile)
    
    	for item = 1 to ubound(ArrPezzi)-1
    		Inizio = instr(ArrPezzi(item),"" & vbCrLf & "" & vbCrLf)
    		Intestazione = left(ArrPezzi(item),Inizio-1)
    		Inizio = Inizio + len("" & vbCrLf) + len("" & vbCrLf)
    	    	ContenutoFile =    mid(ArrPezzi(item),Inizio,len(ArrPezzi(item))-Inizio-1)
    
    		' Recupero i campi se sono compilati
    		if instr(Intestazione,"cognome") > 0 then
    			cognome = ContenutoFile
    		end if
    
    		if instr(Intestazione,"nome") > 0 then
    			nome = ContenutoFile
    		end if
    		
    		if instr(Intestazione,"citta") > 0 then
    			citta = ContenutoFile
    		end if
    		
    		if instr(Intestazione,"provincia") > 0 then
    			provincia = ContenutoFile
    		end if
    		
    		if instr(Intestazione,"email") > 0 then
    		    email = ContenutoFile
    		end if	
    			
    		if instr(Intestazione,"sesso") > 0 then
    			sesso = ContenutoFile
    		end if
    		
    		if instr(Intestazione,"eta") > 0 then
    		   eta = ContenutoFile
    		end if
    		
    		if instr(Intestazione,"descrizione") > 0 then
    			descrizione = ContenutoFile
    		end if	
    		
    		if instr(Intestazione,"aspettative") > 0 then
    			aspettative = ContenutoFile
    		end if	
    
    		' Qui recupero il file da uploadare (se presente) e lo scrivo
    		' sul server
    		if instr(Intestazione,"file1") > 0 then
    		    i = instr(Intestazione,"filename=")
    			j = instr(i + 10,Intestazione,chr(34))
    			NomeUpload = mid(Intestazione,i + 10,j-i-10)
    			i = instrRev(NomeUpload,"\")
    			if i<>0 then
        		    NomeFile = mid(NomeUpload,i + 1)
        		else
        			NomeFile = NomeUpload
        		end if
          		if i<>0 then
    				Set FSO = CreateObject("Scripting.FileSystemObject")
    				Upload1 = True
    				DimensioneFile1 = len(ContenutoFile)
    				EstensioneFile1 = right(ContenutoFile,3)
    				NomeFile1 = NomeFile
    				image_path_file1 ="/public/immagini/" & NomeFile1
         			Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFile1), True, False)
        			textStream.Write ContenutoFile
        			textStream.Close
        			Set textStream = Nothing
    	   			Set FSO = Nothing
        	   end if
    		end if
    		
    		if instr(Intestazione,"file2") > 0 then
    		    i = instr(Intestazione,"filename = ")
    			j = instr(i + 10,Intestazione,chr(34))
    			NomeUpload = mid(Intestazione,i + 10,j-i-10)
    			i = instrRev(NomeUpload,"\")
    			if i<>0 then
        		    NomeFile = mid(NomeUpload,i + 1)
        		else
        			NomeFile = NomeUpload
        		end if
          		if i<>0 then
    				Set FSO = CreateObject("Scripting.FileSystemObject")
    				Upload2 = True
    				DimensioneFile2 = len(ContenutoFile)
    				EstensioneFile2 = right(ContenutoFile,3)
    				NomeFile2 = NomeFile
    				image_path_file2 ="/public/immagini/" & NomeFile2
         			Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFile2), True, False)
        			textStream.Write ContenutoFile
        			textStream.Close
        			Set textStream = Nothing
    	   			Set FSO = Nothing
        	  end if
    		end if
    
    	next
    
    dim cn, sql 
    set cn = Server.CreateObject("ADODB.Connection") 
    cn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;"&_ 
    "Persist Security Info=False;"&_ 
    "Data Source="& Server.MapPath("/mdb-database/db_utenti.mdb") 
    cn.open() 
    sql = "INSERT INTO schede(cognome, nome, sesso, citta, email, descrizione, aspettative, provincia, path_immagine_file1, path_immagine_file2) VALUES( '"&cognome&"','"&nome&"', '"&sesso&"', '"&citta&"' , '"&email&"', '"&descrizione&"' , '"&aspettative&"','"&provincia&"','"&image_path_file1&"','"&image_path_file2&"')" 
    cn.execute(sql) 
    cn.close() 
    set cn = nothing 
    
    response.write (image_path_file1)
    response.write ("-")
    response.write (image_path_file2)
    Response.Write ("
    ")
    response.write(sql)
    %>

    codice:
    /public/immagini/ee.jpg-
    
    INSERT INTO schede(cognome, nome, sesso, citta, email, descrizione, aspettative, provincia, path_immagine_file1, path_immagine_file2) VALUES( 'p','p', 'sesso', 'p' , 'p', 'p' , 'p','PA','/public/immagini/ee.jpg','')
    ..: Serie A :..
    ..: FORZA PALERMOOOOoooo.....

  2. #2
    Sei sicuro che nella parte dove
    cè la stringa in blu ci entri realmente?
    Prova a mettere un Response.write("CIAO") appena prima dell'assegnazione della variabile blu e vedi se compare la scritta

  3. #3
    ok grazie risolto
    ..: Serie A :..
    ..: FORZA PALERMOOOOoooo.....

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.