したがって、テキストボックスにテキストを入力して送信ボタンを押すと、データが update.php に送信され、update.php がデータベースにデータが送信され、update.php が edit.php にリダイレクトされ、テキストボックス全体のテキストが下向きになります、 何か案は ?
Edit.php
<html>
<head></head>
<body>
<form method="post" action="update.php">
Meist<br>
<textarea style="resize:none" cols="100" rows="10" method="post" type="text" id="meist" name="meist"><?php
include_once("connect.php");
$sql = 'SELECT meist FROM content WHERE id=1';
mysql_select_db('fava');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
{
echo "{$row['meist']}";
}
mysql_close($conn);
?>
</textarea><br>
<input type="submit" value="salvesta"/>
</form>
</body>
</html>
update.php
<?php
// configuration
$dbhost = "localhost";
$dbname = "fava";
$dbuser = "root";
$dbpass = "";
// database connection
$conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass);
// new data
$meist =$_POST["meist"];
$id = 1;
// query
$sql = "UPDATE content SET meist=? WHERE id=?";
$q = $conn->prepare($sql);
$q->execute(array($meist,$id));
echo "Edukalt salvestatud";
header('Refresh: 2; URL=http://localhost/php_sandbox/edit.php');
?>
説明するのがちょっと難しいので、質問があれば撃ってください。