所以,即時通訊試圖獲得信息,你把一個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代碼,描述所需的行爲,並描述實際行爲,包括任何錯誤。 –