它应该允许您向数据库添加个人链接,并且服务器正在运行带有 MySQL 和 Active Directory 的 Windows Server 2008 R2。
<?php
$dbl = mysql_connect('localhost', 'USERNAME', 'PASSWORD') or die('failed to connect to mysql');
mysql_select_db('linksdatabase') or die('failed to select database');
if(isset($_POST['linkaddress']) && isset($_POST['linkname']))
$sql = "INSERT INTO userlinks (username, linkaddress, linkname) VALUES ('%s','%s','%s')";
mysql_query ( sprintf ( $sql, mysql_real_escape_string ( $_SERVER ['AUTH_USER'] ), mysql_real_escape_string ( $_POST ['linkaddress'] ), mysql_real_escape_string ( $_POST ['linkname'] ) ) );
echo '<p>Links:</p><ul>';
$result = mysql_query ( sprintf ( "SELECT linkaddress, linkname FROM userlinks WHERE username = '%s'", mysql_real_escape_string ( $_SERVER ['AUTH_USER'] ) ) );
while($row = mysql_fetch_array($result))
echo '<li><a href="', htmlentities($row['linkaddress']), '">', htmlentities($row['linkname']), '</a></li>';
echo '</ul>';
?>
<form action="" method="post">
<fieldset>
<legend>Add a Link</legend>
Address: <input type="text" name="linkaddress" /><br />
Name: <input type="text" name="linkname" /><br />
<input type="submit" value="Add" />
</fieldset>
</form>