所以,即时通讯试图获得信息,你把一个HTML到一个表中的PHP,问题是,我无法找到任何解决方案在线。并且我对php还不太了解。这只是我第二次问一些问题,所以我还是不太清楚你应该填写问题的方式。总之,这里是有问题的代码:Html表格到Php表
HTML
</head>
<body>
<form action="http://www.cs.tut.fi/cgi-bin/run~jkorpela/echo.cgi"method="post">
<div>
<label for="vnaam">Voornaam</label>
<input type="text" id="vnaam" name="vnaam" required/>
</div>
<div>
<label for="anaam">Achternaam</label>
<input type="text" id="anaam" name="anaam" required/>
</div>
<div>
<label for="tnum">Telefoon Nummer</label>
<input type="text" id="tnum" name="tnum" />
</div>
<div>
<label for="tnum">E-mail</label>
<input type="email" id="tnum" name="tnum" />
</div>
<div>
<label for="adres">Adres</label>
<input type="" id="adres" name="adres" required/>
</div>
<div>
<label for="land">Land</label>
<select id="land" name="land">
<option value="ned">Nederland</option>
<option value="usa">Amerika</option>
<option value="eng">Engeland</option>
<option value="bel">België</option>
<option value="fr">Frankrijk</option>
<option value="ger">Duitsland</option>
</select>
</div>
<div class="button">
<button type="submit">Opsturen</button>
</div>
</form>
</body>
</html>
的CSS
<style type="text/css">
form {
/* Just to center the form on the page */
margin: 0 auto;
width: 400px;
/* To see the outline of the form */
padding: 1em;
border: 1px solid #CCC;
border-radius: 1em;
}
form div + div {
margin-top: 1em;
}
label {
/* To make sure that all labels have the same size and are properly aligned */
display: inline-block;
width: 90px;
text-align: right;
}
input, textarea {
/* To make sure that all text fields have the same font settings
By default, textareas have a monospace font */
font: 1em sans-serif;
/* To give the same size to all text field */
width: 300px;
-moz-box-sizing: border-box;
box-sizing: border-box;
/* To harmonize the look & feel of text field border */
border: 1px solid #999;
}
input:focus, textarea:focus {
/* To give a little highlight on active elements */
border-color: #000;
}
textarea {
/* To properly align multiline text fields with their labels */
vertical-align: top;
/* To give enough room to type some text */
height: 5em;
/* To allow users to resize any textarea vertically
It does not work on all browsers */
resize: vertical;
}
.button {
/* To position the buttons to the same position of the text fields */
padding-left: 90px; /* same size as the label elements */
}
button {
/* This extra margin represent roughly the same space as the space
between the labels and their text fields */
margin-left: .5em;
}
</style>
既然你刚刚开始学习PHP,那么做对 - 完全避免mysql_'的扩展!您可以使用'mysqli_'(注意末尾的'i')或PDO。请务必使用带有占位符的准备好的语句来保护您的数据库。查看下面的例子:http://php.net/manual/en/mysqli.prepare.php或者你想尝试PDO http://php.net/manual/en/pdo.prepare.php - CSS也与此问题无关,因为CSS与页面的外观/样式有关,而PHP是后端语言,根本不在乎它的外观;-) – Qirel
阅读关于php表单处理 http: //www.w3schools.com/php/php_forms.asp –
有很多关于PHP处理表单的教程。仔细阅读一些内容,然后花时间去真正理解。然后自己尝试一下。之后,如果您仍然遇到问题,请发布您正在使用的PHP代码,描述所需的行为,并描述实际行为,包括任何错误。 –