Jump to content
  • 0

pomoc Prosím pomoc - POST


Jáá

Dotaz

$myfile = $_POST["meno"];
fwrite($myfile, $_POST["meno"]); 
fclose($myfile);
echo fgets($myfile); 
fclose($myfile);
?>

 

pls porad

je tam niekde chyba vraj

ale ja neviem kde

nechce sa vytvoriť súbor na to Post meno

Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0

$myfile = $_POST["meno"];
$handle = fopen($myfile, 'w') or die('Cannot open file:  '.$myfile);
$data = 'This is the data';
fwrite($myfile, $_POST["meno"]); 
fclose($myfile);

 

stále Cannot open file:

Link to comment
Share on other sites

  • 0

Chýba ti fopen (viz. Ewwe) a tam ako v Pawn zadávaš akú činnosť ideš robiť so súborom (read, write....)

LOOOL...přečetl jsi si kategorii a ten kód vůbec? :d Pawn do toho nepleť :d

Link to comment
Share on other sites

  • 0

$myfile = $_POST["meno"];
$handle = fopen($myfile, 'w+') or die('Cannot open file: '.$myfile);
$data = 'This is the data'; // zbytecna promenna? vis vubec co ten kod dela?!
fwrite($myfile, $_POST["meno"]);
fclose($myfile);

 

Mod "w" pouze otevre soubor a zapisuje (prepisuje!) soubor. Mod w+ vytvori soubor, kdyz neexistuje. Mel by jsi si neco precist o tom, nez to zacnes delat. Hlavne pred tim, nez se zeptas.

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

  • 0

LOOOL...přečetl jsi si kategorii a ten kód vůbec? :d Pawn do toho nepleť :d

 

Nieje na tom nič smiešne. Pawn som dal ako príklad, lebo si myslím, že má s ním nejaké skúsenosti... + io_write = w.... To som dal ako príklad, že sa dáva činnosť, ktorá bude vykonaná so súborom...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...