我的PHP存在问题,因为我的网页上的表单输入的数据显示为空白。
这是我的PHP:
<?php
//the example of inserting data with variable from HTML form
//input.php
mysql_connect("localhost", "bashletc_upload", "fakepassword", "bashletc_font- database");//database connection
//inserting data order
$order = "INSERT INTO `bashletc_font-database`.`fonts`
(filename, filelocation)
VALUES
('$filename',
'$filelocation')";
//declare in the order variable
$result = mysql_query($order); //order executes
if($result){
echo("<br>File has been logged.<br> All your font are belong to us.");
} else{
echo("<br>Input Failure.");
}
?>
编辑:这是HTML表单。
<form action="insert.php" method="post">
<p> Please enter this information into our public <br> database so others can use this font!<br> This feature is not implemented yet.</p>
File-Name: <input type="text" name="$filename"><br>
File-Location: <input type="text" name="$filelocation">
<input type="submit">
</form>