Visualizzazione dei risultati da 1 a 7 su 7

Discussione: Da Php ad Asp

  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786

    Da Php ad Asp

    Salve,

    ho questo scritp in php:
    codice:
    <?
    header("Cache-Control: no-cache, must-revalidate"); 
    header("Pragma: no-cache"); 
    
    $level = null;
    $level = $_GET['level'];
    
    if (empty($level))
    	$level = 1;
    $fp = fopen("level$level.txt","r");
    $i = 0;
    while ($line = fgets($fp,1000))
    {
    	echo "&asparray$i=".$line;
    	$i++;
    }
    fclose($fp);
    ?>
    si può tradurre in Asp ?

    Grazie !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  2. #2
    Utente di HTML.it L'avatar di kluster
    Registrato dal
    Jul 2003
    Messaggi
    1,288
    ci provo:

    codice:
    <%
    Response.AddHeader "Cache-Control","no-cache, must-revalidate" 
    Response.AddHeader "Pragma","no-cache"
    Dim Fso,Fp
    level = Request.QueryString("level")
    If IsNull(level) Or (level = "") Then level = 1
    Set Fso = Server.CreateObject("Scripting.FileSystemObject") 
    Set Fp = Fso.OpenTextFile(Server.MapPath("level" & level & ".txt"),1,true)
    i = 0
    While Not Fp.AtEndOfStream
    'Ma 1000 per fgets intende byte o char?
    	line  = Fp.Read(1000)' Nel caso intendevi linea [line  = " & Fp.ReadLine]
    	Response.Write "&asparray" & i & "=" & line	
    	i = i + 1
    Wend
    Set Fp  = Nothing
    Set Fso = Nothing
    %>

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    c'è qualcosa che non va,

    questo file Asp mi serve per fare dei Livelli di un gioco in flash esterni su file txt,

    col file Php me li visualizza, i livelli in flash, con il file Asp che mi ai fatto no.


    cosa puo' essere ?

    Grazie !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  4. #4
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    il problema è quello che ritorna:
    ad esempio:

    il file php torna:

    codice:
    &asparray0=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray1=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray2=3,3,3,3,3,3,3,3,3,3,3,3,3,0
    &asparray3=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray4=5,5,5,5,5,5,5,5,5,5,5,5,5,0
    &asparray5=4,4,4,4,4,4,4,4,4,4,4,4,4,0
    &asparray6=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray7=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray8=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray9=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray10=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray11=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray12=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray13=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray14=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray15=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    &asparray16=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    mentre il file Asp torna:

    codice:
    &asparray0=0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    3,3,3,3,3,3,3,3,3,3,3,3,3,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    5,5,5,5,5,5,5,5,5,5,5,5,5,0
    4,4,4,4,4,4,4,4,4,4,4,4,4,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,0
    è questo da Corregere

    ma io non lo riesco a corregere

    Aiuto x favore
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  5. #5
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    up
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  6. #6
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    ho risolto !!!!!!!!
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  7. #7
    Utente di HTML.it L'avatar di kluster
    Registrato dal
    Jul 2003
    Messaggi
    1,288
    che modifiche hai fatto (per curiosita)

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.