我该如何解决这个错误 [英] How do I fix this error

查看:68
本文介绍了我该如何解决这个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在浏览我的编辑页面并且遇到了这个错误并且一直试图解决它但似乎无法找到它。



这是错误就是这个



(!)解析错误:语法错误,C:\ wamp64 \过去的文件意外结束:\ theana_itec244第95行的\php\edit.php 







这里是我的代码用过的。任何帮助将不胜感激



我尝试过:



< pre lang =PHP> < pre > <? php

session_start();

if(isset($ _ SESSION [' userName']))
{
$ title = $ _SESSION [' 用户名];
}

?>
< html >
< head >
< title > 编辑页面< / title >
< / head >
< ; 正文 >

<? php

$ db_host = ' localho ST';
$ db_username = ' root';
$ db_password = ;
$ con = mysqli_connect($ db_host,$ db_username,$ db_password) die(mysqli_connect_error) ());

mysqli_select_db($ con,' staff' die(mysqli_error($ con));

$ sql = SELECT * FROM applicant WHERE uname ='。 $ _SESSION [' user']。 ';

if($ result = mysqli_query($ con,$ sql))
{
$ data = mysqli_fetch_array($ result);
mysqli_close($ con);
}
else
{
mysqli_connect_error();
}
?>

< 表格 方法 = post 操作 = php / luana_insert.php >
< fieldset >
< 图例 > 用户信息< / legend >

<
select id = title 名称 = title >
< 选项 value = 已选择 = 已选择 > 请选择标题< / o ption >

< 选项 <?php 如果 ($ row [' title'] = = Ms )

echo 已选中;? > value =Ms> Ms < / option >

< 选项 <?php if($ row ['title'] = = 太太)

echo selected;? > value =Mr> Mr < / option >

< < span class =code-leadattribute>选项
<?php if($ row ['title'] = = 太太)
< span class =code-attribute>
< span class =code-attribute> echo selected; > value =Mrs> Mrs < span class =code-keyword>< / option >

< 选项 <?php if($ row ['title' ] = = Mr)

< span class =code-attribute> echo selected; > value =Mr> Mr < / option >

< / select >

< 标签 > 名字:< / label >
< 输入 type = text id = fname 名称 = < span class =code-keyword> fname size = 25 = <?php echo $ row ['fname'];?>
/ >

< label > 姓氏:< / label >
< 输入 type = text < span class =code-attribute> id = lname 名称 = lname size = 25 value = < ?php echo $ row ['lname'];?> / > < br / > < / br / >

< 标签 > 地址:< / label >
< textarea id = address name = 地址 = 9 cols = 25 < span class =code-attribute> value = <?php echo $ row ['address '];?> / > < / textarea > < br / > < br / >

电子邮件< 输入 < span class =code-attribute> type = text 名称 = txtemail id = txtemail value = <?php echo $ email;?> >
< span class = 错误 > * < ? php echo $ emailErr ; ?> ; < / span >

< label > 性别:< / label >
< input type = radio id = 性别 name = gender <?php if(isset) ($性别) && 性别 = = female)

{

echo 已选中? > value =female>女性
}
< 输入 类型 = radio id = 性别 名称 = 性别 <?php if(isset($ gender) && 性别 = = male )

< span class =code-attribute> {

echo 已检查;? > value =male>男性
}
< label > 用户名:< / label >
< 输入 类型 = text 名称 = userName id = userName size = 35 value = <?php echo $ row ['userName'];?> ; > < br / > < br / >

< 标签 > 密码; < / label >
< input type = 密码 名称 = pword id = pword < span class =code-attribute> size = 35 / > ; < br / > < br / >

< label > 确认密码< / label >
< 输入 type = 密码 名称 = cword id = cword size = 35 / > < br / > < br / >

< 输入 类型 = 提交 value = 提交 / > < 输入 type = 重置 < span class =code-attribute> value = RESET / >

< / fieldset >
< / form >
< / body >
< / html >

解决方案

_SESSION [' < span class =code-string> userName']))
{


title =


_SESSION [' userName'];
}

?>
< html >
< head >
< title > 编辑页面< / title >
< / head >
< ; 正文 >

<? PHP

i am going through my edit page and this error I come across and have been trying to figure it out but cant seem to find it.

this is the error is this

( ! ) Parse error: syntax error, unexpected end of file in C:\wamp64\www\luana_itec244\php\edit.php on line 95




and here is the code that i have used. any help would be appreciated

What I have tried:

<pre><?php
	
		session_start();
		
		if(isset($_SESSION['userName']))
		{
			$title = $_SESSION['userName'];
		}
		
?>
<html>
		<head>
			<title> Edit Page</title>
		</head>
		<body>
		
			<?php
			
				$db_host='localhost';
				$db_username='root';
				$db_password="";
				$con = mysqli_connect($db_host, $db_username, $db_password) or die(mysqli_connect_error());
				
				mysqli_select_db($con,'staff') or die(mysqli_error($con));
				
				$sql= "SELECT * FROM  applicant WHERE uname='".$_SESSION['user']."'";
				
				if($result=mysqli_query($con, $sql))
				{
					$data=mysqli_fetch_array($result);
					mysqli_close($con);
				}
				else
				{
					mysqli_connect_error();
				}
			?>
			
				<form method="post" action="php/luana_insert.php" >
					<fieldset>
						<legend> User Information</legend>
						
							<select id="title" name="title" >
								<option value="" Selected="selected">Please select a Title</option>
								
								<option <?php if ($row['title']=="Ms")

								echo "selected";?> value="Ms">Ms</option>
							
								<option <?php if($row['title']=="Mrs")

									echo "selected";?> value="Mr">Mr</option>
							
								<option <?php if($row['title']=="Mrs")

									echo "selected"; ?> value="Mrs">Mrs</option>
								
								<option <?php if($row['title']=="Mr")

									echo "selected"; ?> value="Mr">Mr</option>
								
							</select>   
							
							<label> First Name:</label>
							<input type="text" id="fname" name="fname" size="25" value="<?php echo $row['fname'];?>"/>   
							
							<label> Last Name:</label>
							<input type="text" id="lname" name="lname"  size="25" value="<?php echo $row['lname'];?>"/><br/></br/>
							
							<label> Address:</label>
							<textarea id="address" name="address" rows="9" cols="25" value="<?php echo $row['address'];?>" /></textarea><br/><br/>
							
							Email<input type="text" name="txtemail" id="txtemail" value="<?php echo $email;?>" >
							<span class="error">* <?php echo $emailErr;?></span>
							
							<label> Gender:</label>
							<input type="radio" id="gender" name="gender" <?php if(isset($gender) && gender=="female")

							{

								echo "checked"?> value="female">Female
							}
							<input type="radio" id="gender" name="gender" <?php if(isset($gender) && gender=="male")

							{

								echo "checked";?> value="male">Male
							}
							<label> UserName:</label>
							<input type="text" name="userName" id="userName" size="35" value="<?php echo $row['userName'];?>"><br/><br/>
							
							<label>Password;</label>
							<input type="password" name="pword" id="pword" size="35" /><br/><br/>
							
							<label> Confirmed Password</label>
							<input type="password" name="cword" id="cword" size="35" /><br/><br/>
							
							<input type="submit" value="SUBMIT" />  <input type="reset" value="RESET" />
							
					</fieldset>
				</form>
		</body>
 </html>

解决方案

_SESSION['userName'])) {


title =


_SESSION['userName']; } ?> <html> <head> <title> Edit Page</title> </head> <body> <?php


这篇关于我该如何解决这个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆