所以当我在谷歌浏览器中打开它时,我继续收到以下错误:
此页面包含以下错误:
第 60 行第 28 列的错误:属性值中不允许未转义的 '<' 下面是第一个错误之前的页面呈现。
但是我看到很多人以这种方式获取 IP 地址的例子。我究竟做错了什么?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>GradeYourTeacher.Com</title>
<style type="text/css">
p{
color:black;
f ont-size:14pt;
font-family: "Comic Sans MS", cursive, sans-serif;
}
h1 {
color:purple;
text-align:center;
font-size:36pt;
font-family: "Trebuchet MS", Helvetica, sans-serif;
}
</style>
</head>
<!--This Website is made by Francisco Sanchez-->
<!--Try to get IP Address echo $_SERVER['REMOTE_ADDR']; -->
<body>
<h1>Grade Your Teacher</h1>
<p>
<form id="myform" action="http://learncompsci.com/web/examples/forms/formReader.php" method="get">
To Grade Your Teacher Please Enter The Following Information:
<br/>
<br/>
Display Name: <input name="loginName" type="text" id="loginName" size="14" maxlength="32"/> (For others to view)
<br/>
Email: <input name="email" type="text" id="email" size="20" maxlength="64"/>
<br/>
Email: <input name="password" type="password" id="password" size="14" maxlength="32"/>
<br/>
Confirm Password: <input name="passwordConfirm" type="password" id="passwordConfirm" size="10" maxlength="20" /><br />
First Name:: <input name="firstName" type="text" id="firstName" size="20" maxlength="40" /><br />
Grad Year:: <select name="gradYear" id="gradYear">
<option value="08">2008</option>
<option value="09">2009</option>
<option value="10">2010</option>
<option value="11">2011</option>
</select><br />
Gender:: <input name="gender" type="radio" value="male" checked="checked" />
male
<input type="radio" name="gender" value="female" />
female<br />
Sports: <input type="checkbox" name="sports" value="track" />
track
<input type="checkbox" name="sports" value="baseball" />
baseball
<input type="checkbox" name="sports" value="lacrosse" />
lacrosse
<input type="checkbox" name="sports" value="paintball" />
paintball
<br />
Banter: <textarea name="banter" cols="30" rows="5" id="banter"></textarea><br />
<input type="submit" name="Submit" value="Enter" />
<input type="hidden" id="IP" name="IP" value= "<?php echo $_SERVER['REMOTE_ADDR']; ?>" />
<br/>
</form>
</p>
</body>
</html>