Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
if($submit)
{
$thetext = $_POST['write'];
$fp = fopen ('info.php',"w");
$text = stripslashes($thetext);
fwrite($fp, $text );
$file = fread($fp, 100);
fclose($fp);
}
echo ("
<form method='post' action='' >
<center><textarea name='write' COLS='80' ROWS='30'>");
echo $file;
echo "</textarea><br><INPUT TYPE=SUBMIT VALUE='Edit'></center>
</form>";
?>
<html>
<head>
<title>Промяна на файл</title>
</head>
<body>
<?php
$fp = fopen ('info.php',"w");
$file = fread($fp, 100);
?>
<form method='post' action="edit.php">
<center>
<textarea name='write' COLS='80' ROWS='30'>");
<?php echo $file; ?>
</textarea><br />
<input type="submit" name="submit" value="Edit">
</center>
</form>
</body>
</html>
<?php
if($submit)
{
$thetext = $_POST['write'];
$fp = fopen ('info.php',"w");
$text = stripslashes($thetext);
fwrite($fp, $text );
$file = fread($fp, 100);
fclose($fp);
}
vesku каза:ами за това говоря ще се изпулни даье и да не е натиснат бутонаКод:<?php if($submit) { $thetext = $_POST['write']; $fp = fopen ('info.php',"w"); $text = stripslashes($thetext); fwrite($fp, $text ); $file = fread($fp, 100); fclose($fp); } echo (" <form method='post' action='' > <center><textarea name='write' COLS='80' ROWS='30'>"); echo $file; echo "</textarea><br><INPUT TYPE=SUBMIT VALUE='Edit'></center> </form>"; ?>
our каза:Направи го така. Давам ти го в два файла, за да го разбереш
form.php
edit.phpКод:<html> <head> <title>Промяна на файл</title> </head> <body> <?php $fp = fopen ('info.php',"w"); $file = fread($fp, 100); ?> <form method='post' action="edit.php"> <center> <textarea name='write' COLS='80' ROWS='30'>"); <?php echo $file; ?> </textarea><br /> <input type="submit" name="submit" value="Edit"> </center> </form> </body> </html>
Код:<?php if($submit) { $thetext = $_POST['write']; $fp = fopen ('info.php',"w"); $text = stripslashes($thetext); fwrite($fp, $text ); $file = fread($fp, 100); fclose($fp); }
<?php
$thetext = $_POST['write'];
if ( !$thetext ){
echo ("
<form method='post' action='' >
<center><textarea name='write' COLS='80' ROWS='30'>");
echo $file;
echo "</textarea><br><INPUT TYPE=SUBMIT VALUE='Edit'></center>
</form>";
} else {
$fp = fopen ('info.php',"w");
$text = stripslashes($thetext);
fwrite($fp, $text );
$file = fread($fp, 100);
fclose($fp);
}
?>