ユーザーがテキストエリアにテキストを入力できるようにしようとしています。これにより、データベース「ptb_profiles」内のmysqlテーブル「bio」が更新されます。
現在、彼らの情報はこのテキストエリアに取り込まれていますが、入力した内容がすべてテーブルを更新するようにしたいと思います。
次のコードを使用していますが、機能していませんか?phpとmysqlは初めてなので、間違いです。
どんな助けでも本当にありがたいです。ありがとう。
<?php
//We check if the form has been sent
if(isset($_POST['bio']))
{
$content = $_POST['bio'];
//We remove slashes depending on the configuration
if(get_magic_quotes_gpc())
{
$content = stripslashes($content);
}
//We check if all the fields are filled
if($_POST['bio']!='')
{
$sql = "INSERT INTO ptb_profiles.bio VALUES (NULL, '".$_SESSION['user_id']."', '".$message['bio']."');";
mysql_query($sql, $connection);
echo "<div class=\"infobox-message\">Your Profile Information has been updated..</div>";
}
}
?>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<textarea id="bio" rows="10" style="width: 456px;
margin-top:3px;
text-align:left;
margin-left:-2px;
height: 122px;
resize: none;
border: hidden;"><?php echo $profile['bio'] ?> </textarea>
<input type="submit" name="send_button" id="send_button" value="Send">