これは、答えが非常に単純であると私が信じている小さな問題ですが、木には木が見えない可能性があります。
データを表示するフォームがあります。ユーザーはデータを編集するように求められます。これにより、データベースが更新され、更新されたデータが記載された電子メールが送信されます。メールは届きますが、タイトルは表示されますがデータは表示されません。
私は何を間違っていますか?
メールに表示されるテキスト:
名前:
メール:
電話:
phpコード:
$email_to = 'someone@here.com';
$name=$row['name'];
$email=$row['email'];
$phone=$row['mobtel'];
$email_subject = 'Feedback from website';
$headers = 'From: someone@there.com\r\n';
someone$message='Name: ' .$name. "\r\n". 'Email: ' .$email. "\r\n". 'Phone: ' .$phone;
$sent = mail($email_to, $email_subject, $message, $headers);
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
これは、上記に先行する php コードです。
mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db($dbname) or die("Unable to connect: " . mysql_error());
if (isset($_GET['view']))
{
$user = sanitizeString($_GET['view']);
$data = "SELECT * FROM names WHERE id='$user'";
$result=mysql_query($data) or die(mysql_error());
while($row=mysql_fetch_array($result)){
?>
<caption>Personal Record</caption>
<tr>
<th>ID</th>
<td><?php
echo $row['id'];
?></td>
</tr>
<tr>
<th>Name</th>
<td><?php
echo $row['name'];
?></td>
</tr>
<tr>
<th>E-Mail</th>
<td><?php
echo $row['email'];
?></td>
</tr>
<tr>
<th>Main Telephone</th>
<td><?php
echo $row['maintel'];
?></td>
</tr>
<tr>
<th>Mobile Telephone</th>
<td><?php
echo $row['mobtel'];
?></td>
</tr>
<tr>
<th>Organisation</th>
<td><?php
echo $row['organisation'];
?></td>
</tr>
<tr>
<th>Group Leader</th>
<td><?php
echo $row['group_leader'];
?></td>
</tr>
<tr>
<th>Supervisor</th>
<td><?php
echo $row['supervisor'];
?></td>
</tr>
<tr>
<th>Volunteer</th>
<td><?php
echo $row['volunteer'];
?></td>
</tr>
<tr>
<th>Assessor</th>
<td><?php
echo $row['assessor'];
}
}
?></td>
</tr>
</table>
<br />
<form method="post" action="update.php">
<input name="Submit1" type="submit" value="Edit" style="width: 67px" /></form>
<p> </p>