Jump to content
php.lv forumi

Vajag palidzibu !!!


Recommended Posts

Posted

Man izdevas

<?
$faila_vards = 'texts.txt';
$faila_saturs = htmlspecialchars(file_get_contents($faila_vards));
if (isset($_POST['submit'])) {
$str = $faila_texts.'lol';
$faila_v = fopen("$faila_vards", "w");
fwrite($faila_v, $str);
fclose($faila_v);
echo'gatavs';
}
echo'<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
echo'<textarea name="faila_texts" cols="100" rows="40">'. $faila_saturs .'</textarea>';
echo'<input type="submit" name="submit" value="Save">';
echo'</form>';
?>

:rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes:

Posted

man jautajums kapec nestrada sis :

<?
function yea($fnamez) {
$faila_vards = $fnamez;
$faila_saturs = htmlspecialchars(file_get_contents($faila_vards));
if (isset($_GET['submit'])) {
$str = $faila_texts;
$faila_v = fopen("$faila_vards", "w");
fwrite($faila_v, $str);
fclose($faila_v);
echo'gatavs';
}
else {
echo'<form action="'.$_SERVER['PHP_SELF'].'" method="get">';
echo'<textarea name="faila_texts" cols="100" rows="40">'. $faila_saturs .'</textarea>';
echo'<input type="submit" name="submit" value="Save">';
echo'</form>';
}
}
yea('texts.txt')
?>

vins neieraxta failaa infu tip to pasu veco atgriez :/

Posted
function yea($fnamez) {

// prieksh kam defineet liekus mainiigos?
$faila_saturs = htmlspecialchars(file_get_contents($fnamez));
if (isset($_GET['submit'])) {
// nezinu kaa tev serveris nodefineets, bet pareizaaks mainiigos lasiit no $_GET vai $_POST
 $str = $_GET['faila_texts'];
//  "$fnamez" == $fnamez
 $faila_v = fopen($fnamez, 'w');
 fwrite($faila_v, $str);
 fclose($faila_v);
 echo'gatavs';
}
else {
 echo'<form action="'.$_SERVER['PHP_SELF'].'" method="get">';
 echo'<textarea name="faila_texts" cols="100" rows="40">'. $faila_saturs .'</textarea>';
 echo'<input type="submit" name="submit" value="Save">';
 echo'</form>';
}
}
yea('texts.txt');

Posted

Iepriekš tev bija kods:

  lasam/rakstam failu
  taisam echo formu

a tagad ir kods:

  lasam failu
  if (nosuutiiti dati) {
     rakstam failu
  } else {
     taisam echo formu
  }

Atšķirās tak bišķi, ne?

Posted

Bļin, tu vienreiz sāksi rakstīt normālus teikumus? Paskaidrojot, kas, kur nestrādā! Nevis pasakot tikai, ka nekas nestrādā!!!

 

Kas ir šis scp?

Kādam tekstam?

Un kas ir tās beigas?

Posted
nu blje tip sitam gala rezultatam kad tu saglaba failu spiezot Save ja taja faila ir zimes " vins tam prieksa pieliek \"

sk. stripslashes()

 

bēdu bērns

×
×
  • Create New...