【发布时间】:2014-01-22 16:47:39
【问题描述】:
我是 PHP 新手,正在开发登录表单。请在下面找到我使用的代码。当我尝试时,它给了我以下错误:
致命错误:无法在写入上下文中使用函数返回值 C:\xampp\htdocs\forsiteSystem\login.php 在第 3 行
请帮我解决问题。
thems/login.html的源代码:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form action=".\login.php" method="get">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit" id="Submit_button">
</form>
</body>
</html>
index.php的源代码:
<?php
// venushka thisara dharmasiri
require 'config.php';
require 'thems\login.html';
?>
login.php的源代码:
<?php
if(isset($_POST("Submit_button"))==true)
print("Submit button pressed");
else
print("submit button sorry");
?>
config.php的源代码:
<?php
$dbUser="root";
$dbPassword="";
$dbName="forsitelogin";
$dbHost="localHost";
$dbConnection= mysql_connect($dbHost, $dbUser, $dbPassword);
if($dbConnection)
{
mysql_select_db($dbName);
//print("Sucessfully connected to database");
}
else
die("<strong>Cound not connect to database </strong> ");
?>
【问题讨论】:
标签: php mysql function login runtime-error