概述:我正在创建一个用于学习目的的虚拟网站,因此它的功能主义者是基本的和安全的,不在议程 atm 上。
问题:当我登录系统并单击编辑帐户按钮时,我收到此错误:
解析错误:语法错误,第 104 行 C:\xampp\htdocs\eshop\userEditAccount.php 中的文件意外结束
userEditAccount.php 文件:
<?php
session_start();
require_once('userEditAccount.php');
include('connect_mysql.php');
if(isset($_POST['Editsubmited'])){
$userid = $_SESSION['user_id'];
$Newusername = $_POST['username'];
$Newpassword = $_POST['password'];
$Newfirstname = $_POST['first_name'];
$Newlastname = $_POST['last_name'];
$Newemail = $_POST['email'];
$sql = "UPDATE users SET username='$Newusername', password='$Newpassword',
first_name='$Newfirstname', last_name='$Newlastname WHERE user_id='$userid'";
$result = mysql_query($sql) or die("Query failed : " . mysql_error());
if(!$result){
exit("Error Ocured whilsd updating $ud_id record");
}
echo "Record $ud_id has been sucesfully updated";
mysql_close($con);
?>
<html>
<head>
<title>Edit Account</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<header><h1>E-Shop</h1></header>
<article>
<h1>Welcome</h1>
<h1>Edit Account</h1>
<div id="login">
<ul id="login">
<form method="post" name="editAccount" action="userEditAccount.php" >
<fieldset>
<legend>Fill in the form</legend>
<label>Select Username : <input type="text" name="username" /></label>
<label>Password : <input type="password" name="password" /></label>
<label>Enter First Name : <input type="text" name="first_name" /></label>
<label>Enter Last Name : <input type="text" name="last_name" /></label>
<label>Enter E-mail Address: <input type="text" name="email" /></label>
</fieldset>
<br />
<input name="Editsubmited" type="submit" submit="submit" value="Edit Account" class="button">
</form>
<?
echo $newrecord;
?>
</div>
<form action="userhome.php" method="post">
<div id="login">
<ul id="login">
<li>
<input type="submit" value="back" onclick="index.php" class="button">
</li>
</ul>
</div>
</article>
<aside>
</aside>
<div id="footer">This is my site i Made coppyrights 2013 Tomazi</div>
</div>
</body>
</html>
查看代码一切看起来都是正确的,错误没有意义意外的文件结尾......
当我在单独的文件中使用 php 代码并将此文件与 html 文件链接时,我在 php 所在的文件中得到相同的错误,因此我猜它与 php 有关系......
任何建议Overflowers:.....?