我一直在尝试在为我最后一年的项目创建的网站上构建一个活动页面。我希望主页事件页面显示带有标题的不太详细的事件列表。事件标题应该用作打开页面的链接,该页面显示用户决定单击或选择的事件的更详细描述。我设法在每个事件标题上创建了一个链接,但似乎无法将其正确链接到显示所选事件详细描述的页面。
我的 event.php 页面有代码:
<?php
include'session.php';
include"database.php";
//Retrieves data from MySQL
$data = mysql_query("SELECT * FROM employees") or die(mysql_error());
//Puts it into an array
while($info = mysql_fetch_array( $data ))
{
//Outputs the image and other data
//Echo "<img src=http://localhost/trial_Admin/events/" .$info['photo'] ."> <br>";
Echo "<b>Name:</b> <a href='more_details.php/?name='$name''/ >".$info['name']. "</a><br>";
Echo "<b>Email:</b> ".$info['email'] . " <br>";
Echo "<b>Phone:</b> ".$info['phone'] . " <hr>";
}
?>
还有more_details.php
<?php
include'session.php';
include"database.php";
$name=$_GET['name'];
//Retrieves data from MySQL
$data = mysql_query("SELECT * FROM employees WHERE name='$name'") or die(mysql_error());
//Puts it into an array
while($info = mysql_fetch_array( $data ))
{
//Outputs the image and other data
Echo "<img src=http://localhost/trial_Admin/events/" .$info['photo'] ."> <br>";
Echo "<b>Name:</b> <a href=''/ >".$info['name']. "</a><br>";
Echo "<b>Email:</b> ".$info['email'] . " <br>";
Echo "<b>Phone:</b> ".$info['phone'] . " <hr>";
}
?>