Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Izčitati cijel sadrzaj iz *.txt filea - POMOZITE HITNO!!!!!

[es] :: Flash :: Izčitati cijel sadrzaj iz *.txt filea - POMOZITE HITNO!!!!!

[ Pregleda: 4572 | Odgovora: 5 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

blzz
mostar

Član broj: 36745
Poruke: 110
212.39.111.*

Sajt: www.chunoslav.tk


Profil

icon Izčitati cijel sadrzaj iz *.txt filea - POMOZITE HITNO!!!!!14.02.2005. u 09:48 - pre 233 meseci
Aje vidite sad ovo
Ovo sam nekad znao, a sad sam zastao na ovom glupom problemu...
Kako da iz nekog vanjskog *.txt filea isčitam cijel sadržaj.
Ja sam pokušavao ali mogu isčitati samo ako na početku *.txt file piše variable u stilu sadrzaj=.
Mene zanima može li se isčitati cijel tekst koji nikako nema određenu varijablu u sebi.
Ja sam uspio isčitati tekst ali je *.txt file sadrzavao ovo:

Sadrzaj= <b>akdhaskjhdasjldajslkda</b><br><b>djlifkdjoifsd</b>

isčito sam taj tekst iz *.txt filea ovim kodom:

Code:
loadVariablesNum("shoutbox.txt")

s tim da sam imao dynamic tekst unutar flash filea koji je imao variablu Sadrzaj.
Ovo sam napravio točno po helpu u flash mx 2004.

Sad me zanima moze li se sve isčitati iz *.txt filea ako on sadrži:
<b>akdhaskjhdasjldajslkda</b><br><b>djlifkdjoifsd</b>
, a da nema nikakvu variablu označenu unutar sebe.
Ovo mi je potrebno jer pravim shoutbox, i kada netko postavi novu poruku poruka će se upisati iza Sadrzaj=, a to mi netreba jer je flash neće isčitavati.

skraćeno: Može li se ikakvim actionscript kodom isčitati cijel sadržaj *.txt filea koji u sebi nema naznačenu nikakvu varijablu.

Molim Vas ako ste išta shvatili pomozite.

 
Odgovor na temu

blzz
mostar

Član broj: 36745
Poruke: 110
212.39.111.*

Sajt: www.chunoslav.tk


Profil

icon Re: Izčitati cijel sadrzaj iz *.txt filea - POMOZITE HITNO!!!!!15.02.2005. u 16:59 - pre 233 meseci
Aje recite barem jeli moguće ovo učiniti
ili ako netko ima ideju kako da prikažem sadržaj teksta u flashu, bez varijabla u tekstu tipa sadrzaj=. Ja mislim da se može nekako preko php-a
 
Odgovor na temu

noviKorisnik
Dejan Katašić
Novi Sad

Član broj: 13216
Poruke: 4533
*.dialup.neobee.net.

Sajt: www.novikorisnik.net


+5 Profil

icon Re: Izčitati cijel sadrzaj iz *.txt filea - POMOZITE HITNO!!!!!15.02.2005. u 17:57 - pre 233 meseci
Fajl mora da bude url enkodiran.
 
Odgovor na temu

blzz
mostar

Član broj: 36745
Poruke: 110
212.39.111.*

Sajt: www.chunoslav.tk


Profil

icon Re: Izčitati cijel sadrzaj iz *.txt filea - POMOZITE HITNO!!!!!16.02.2005. u 11:09 - pre 233 meseci
aje mi pomozi kako to url enkodiran
pojasni mi malo to ne razumijem sta si htio reci, ili mi napisi nekako ako ti znas ili imas ideju kako bi iscitao txt file.
Ja znam jedan način, pravim shoutbox, ali kada netko postavi novi post ova varijabla sadrzaj= koja bi trebala biti na pocetku txt filea bit ce biti iza posta i najnoviji post se nece vidjeti...
pomagajte na bilo kakav nacin

evo vam php kod koji upisuje sadrzaj u txt file, pise u njemu nesto &GuestBook da flash prepozna tu vrijablu, jer ovamo flash skripta isčitava sadrzaj u dynamic text sa variablom GuestBook, ali dođe problem jer u istom html-u nemogu stajati dva takva teksta u različitim swf animacijama. Može li netko preraditi mozda ovu php skriptu da natjera flash da dynamic text sa varijablom shoutbox iscita txt file:

Code:
<?php
// If you are using an old version of php, remove the next set of lines.
// or use $HTTP_POST_VARS["..."] instead.
$Submit     = $_POST["Submit"];
$Name         = $_POST["Name"];
$Email         = $_POST["Email"];
$Website     = $_POST["Website"];
$Comments     = $_POST["Comments"];
$NumLow     = $_REQUEST["NumLow"];
$NumHigh     = $_REQUEST["NumHigh"];

// Replace special characters - you can remove the next 5 lines if wanted.
$Name         = ereg_replace("[^A-Za-z0-9 ]", "", $Name);
$Email         = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Email);
$Comments    = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Comments);
$Website     = eregi_replace("http://", "", $Website);
$Website     = ereg_replace("[^A-Za-z0-9 \@\.\-\/\'\~\:]", "", $Website);

// Remove slashes.
$Name         = stripslashes($Name);
$Email         = stripslashes($Email);
$Website     = stripslashes($Website);
$Comments     = stripslashes($Comments);

// ###################################################################################
// ########## Reading and Writing the new data to the GuestBook Database #############

if ($Submit == "Yes") {
// Next line tells the script which Text file to open.
    $filename     = "GuestBook.txt";

// Opens up the file declared above for reading 

    $fp         = fopen( $filename,"r"); 
    $OldData     = fread($fp, 80000); 
    fclose( $fp ); 

// Gets the current Date of when the entry was submitted
    $Today         = (date ("l dS of F Y ( h:i:s A )",time()));

// Puts the recently added data into html format that can be read into the Flash Movie.
// You can change this up and add additional html formating to this area.  For a complete listing of all html tags
// you can use in flash - visit: http://www.macromedia.com/support/flash/ts/documents/htmltext.htm

    $Input = "Ime<b>$Name</b>= <b>$Name</b><br>Link<b>$Name</b>= <b><u><a href=\"$Website\" target=\"_blank\">$Website</a></u></b>";

/* This Line adds the '&GuestBook=' part to the front of the data that is stored in the text file.  This is important because without this the Flash movie would not be able to assign the variable 'GuestBook' to the value that is located in this text file  */

    $New = "$Input$OldData";

// Opens and writes the file.

    $fp = fopen( $filename,"w"); 
    if(!$fp) die("&GuestBook=cannot write $filename ......&");
    fwrite($fp, $New, 800000); 
    fclose( $fp ); 
}

// ###################################################################################
// ######### Formatting and Printing the Data from the Guestbook to the Flash Movie ##



// Next line tells the script which Text file to open.
    $filename = "GuestBook.txt";

// Opens up the file declared above for reading 

    $fp     = fopen( $filename,"r"); 
    $Data     = fread($fp, 800000); 
    fclose( $fp );

// Splits the Old data into an array anytime it finds the pattern .:::.
    $DataArray = split ("Title=", $Data);

// Counts the Number of entries in the GuestBook
    $NumEntries = count($DataArray) - 1;

    print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&GuestBook=";
    for ($n = $NumLow; $n < $NumHigh; $n++) {
    print $DataArray[$n];
        if (!$DataArray[$n]) {
            Print "<br><br><b>Nema vishe nichega</b>";
        exit
        }
    }
?>

 
Odgovor na temu

noviKorisnik
Dejan Katašić
Novi Sad

Član broj: 13216
Poruke: 4533
194.247.222.*

Sajt: www.novikorisnik.net


+5 Profil

icon Re: Izčitati cijel sadrzaj iz *.txt filea - POMOZITE HITNO!!!!!16.02.2005. u 12:19 - pre 233 meseci
probaj da malo drugačije finiširaš ovu skriptu (obrati pažnju na crvenilo)
    print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&GuestBook=";
for ($n = $NumLow; $n < $NumHigh; $n++) {
print urlencode ($DataArray[$n]);
if (!$DataArray[$n]) {
Print urlencode ("<br><br><b>Nema vishe nichega</b>");
exit
}
}

takođe virni na http://www.php.net/urlencode jer mož još neki detalj da zatreba
 
Odgovor na temu

blzz
mostar

Član broj: 36745
Poruke: 110
212.39.111.*

Sajt: www.chunoslav.tk


Profil

icon Re: Izčitati cijel sadrzaj iz *.txt filea - POMOZITE HITNO!!!!!17.02.2005. u 10:53 - pre 233 meseci

$Input = "Ime<b>$Name</b>= <b>$Name</b><br>Link<b>$Name</b>= <b><u><a href=\"$Website\" target=\"_blank\">$Website</a></u></b>";

/* This Line adds the '&GuestBook=' part to the front of the data that is stored in the text file. This is important because without this the Flash movie would not be able to assign the variable 'GuestBook' to the value that is located in this text file */

$New = "$Input$OldData";

// Opens and writes the file.

$fp = fopen( $filename,"w");
if(!$fp) die("&GuestBook=cannot write $filename ......&");
fwrite($fp, $New, 800000);
fclose( $fp );
}

e vidis ovo gdje pise // Opens and writes the file moze li se tu nesto nastimat da on upisevjest iza varijable sadrzaj=. Usput ovo $Input ti je oblik teksta koji ce se upisat u txt file
 
Odgovor na temu

[es] :: Flash :: Izčitati cijel sadrzaj iz *.txt filea - POMOZITE HITNO!!!!!

[ Pregleda: 4572 | Odgovora: 5 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.