我有一个网站,显示来自存储在数据库中的用户的按摩。我想要的是当我单击每条消息旁边的回复链接时,必须加载一个新页面,并且必须填写每条消息的详细信息以及如何在循环后获取特定行的特定数据。
<?php
$dbcon=mysqli_connect("localhost","root","","technoage");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_select_db($dbcon,"technoage") or die ("database not found!!!");
$r = mysqli_query($dbcon,"SELECT * FROM messages LIMIT $startrow,10 "); // Run the query.
if($r) { // If it ran OK, display the Table header.
echo '<table class="table"> <tr><td><b>Name of sender</b></td><td><b>Senders Details</b></td><td><b>Message</b></td><td><b>Reply To Massage</b><td/></tr>';
while ($row = mysqli_fetch_array($r,MYSQLI_ASSOC))
{
echo'<tr><td>'.'Name: '.$row['name'].'</td><td> '.'Email: '.$row['email_address'] .'<br>Subject: '.$row['message_subject'].'<br>Phone: '.$row['phone'].'<br>Date Sent: '.$row['date_sent']. '</td><td>'.'Message: '.$row['message'].'</td><td><a href="#">Reply</a></td></tr>';
}
echo '</table>';
}
当点击回复链接时,页面必须加载点击按摩的详细信息。
回复文件是
<?php
$dbcon=mysqli_connect("localhost","root","","technoage");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_select_db($dbcon,"technoage") or die ("database not found!!!");
// Run the query.
echo'<form method="post" action="includes/insert.php">';
echo'<label for="name">Name:</label><br>';
echo'<input type="text" class="text" name="name" id="name" /><br>';
echo'<label for="email">E-mail Address:</label><br>';
echo'<input type="text" class="text" name="email" id="email" /><br>';
echo'<label for="phone">Phone:</label><br>';
echo'<input type="text" class="text" name="phone" id="phone" /><br>';
echo'<label for="text">Message Subject:</label><br>';
echo'<input type="text" class="text" name="message_subject" id="message_subject"></textarea><br>';
echo'<label for="text">Message:</label><br>';
echo'<textarea class="text" name="message" id="text"></textarea><br>';
echo'<input type="submit" class="submit" value="Send" />';
echo'</form>';
?>