Forum » Programiranje » Zagon PHP ukaza v Javascript-u ?
Zagon PHP ukaza v Javascript-u ?
Cokolesnik ::
V Javascriptu imam naslednjo vrstico:
myFlashObject.addVariable("photosXmlFile", "slike.php");
V slike.php imam narejen querry po določeni tabeli in nato izpis podatkov na zaslon, vendar javascript slike.php po mojem sploh ne sprocesira ampak direkt pogleda fajl in "prebere" vse - tudi programsko sintakso (kar ne bi smel ampak bi jo moral izvesti) kot bi se denimo v primeru ce bi slike.php z ukazom INCLUDE vkljucil v nek php ali html fajl.
Kako naj rešim ta problem?
myFlashObject.addVariable("photosXmlFile", "slike.php");
V slike.php imam narejen querry po določeni tabeli in nato izpis podatkov na zaslon, vendar javascript slike.php po mojem sploh ne sprocesira ampak direkt pogleda fajl in "prebere" vse - tudi programsko sintakso (kar ne bi smel ampak bi jo moral izvesti) kot bi se denimo v primeru ce bi slike.php z ukazom INCLUDE vkljucil v nek php ali html fajl.
Kako naj rešim ta problem?
Uporabniki naj pred pisanjem sporočil uporabljajo iskalnik www.google.com.
Čokolešnik ne vsebuje nobenih aditivov, konzervansov ali umetnih barvil.
Čokolešnik ne vsebuje nobenih aditivov, konzervansov ali umetnih barvil.
MUC ::
JS ne more pogledat v datoteko ampak jo server prej izvede, ker je JS client-side .. problem imaš drugje.
Cokolesnik ::
Kako bi napisal ukaz v phpju, da se mi dolocen querry ki se izvede, zapise v neko datoteko na serverju in jo, ce ze obstaja pred tem pobrise.
Uporabniki naj pred pisanjem sporočil uporabljajo iskalnik www.google.com.
Čokolešnik ne vsebuje nobenih aditivov, konzervansov ali umetnih barvil.
Čokolešnik ne vsebuje nobenih aditivov, konzervansov ali umetnih barvil.
Cokolesnik ::
Sem že našu:
We can use php to write to a text file. The fwrite function allows data to be written to any type of file. Fwrite's first parameter is the file handle and its second parameter is the string of data that is to be written. Just give the function those two bits of information and you're good to go!
Below we are writing a couple of names into our test file test.txt and separating them with a carriaged return.
PHP Code:
$myFile = "test.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Bobby Bopper\r";
fwrite($fh, $stringData);
$stringData = "Tracy Tanner\r";
fwrite($fh, $stringData);
fclose($fh);
The $fh variable contains the file handle for test.txt. The file handle knows the current file pointer, which for writing, starts out at the beginning of the file.
We wrote to the file test.txt twice. Each time we wrote to the file we sent the string $stringData that first contained Bobby Bopper and second contained Tracy Tanner. After we finished writing we closed the file using the fclose function.
VIR
We can use php to write to a text file. The fwrite function allows data to be written to any type of file. Fwrite's first parameter is the file handle and its second parameter is the string of data that is to be written. Just give the function those two bits of information and you're good to go!
Below we are writing a couple of names into our test file test.txt and separating them with a carriaged return.
PHP Code:
$myFile = "test.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Bobby Bopper\r";
fwrite($fh, $stringData);
$stringData = "Tracy Tanner\r";
fwrite($fh, $stringData);
fclose($fh);
The $fh variable contains the file handle for test.txt. The file handle knows the current file pointer, which for writing, starts out at the beginning of the file.
We wrote to the file test.txt twice. Each time we wrote to the file we sent the string $stringData that first contained Bobby Bopper and second contained Tracy Tanner. After we finished writing we closed the file using the fclose function.
VIR
Uporabniki naj pred pisanjem sporočil uporabljajo iskalnik www.google.com.
Čokolešnik ne vsebuje nobenih aditivov, konzervansov ali umetnih barvil.
Čokolešnik ne vsebuje nobenih aditivov, konzervansov ali umetnih barvil.
Ziga Dolhar ::
Zdej bo pa prišlo do težave, ko boš ugotovil, da mysql_query() v bistvu ne vrne nekega tabularičnega sistema podatkov, ampak referenco na rezultat, ki ti sploh ni na voljo v kaki prijazni obliki.
https://dolhar.si/
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | JavaScript v PHP-juOddelek: Izdelava spletišč | 1025 (810) | drola |
» | [php] unlink - problemčekOddelek: Izdelava spletišč | 1720 (1266) | PaX_MaN |
» | [visual basic 05] - kreiranje datoteke in pisanje vanjoOddelek: Programiranje | 1495 (1291) | gzibret |
» | PHP problem z branjem iz datoteke.Oddelek: Programiranje | 1381 (1300) | [MYTiX] |
» | UnicodeOddelek: Programiranje | 1290 (1181) | Vesoljc |