Jump to content
php.lv forumi

Vajag palidzibu !!!


Faplo

Recommended Posts

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:

Link to comment
Share on other sites

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 :/

Link to comment
Share on other sites

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');

Link to comment
Share on other sites

×
×
  • Create New...