解析错误:语法错误,第1行/home/content/91/7287991/html/employeelogin/loginp.php中的意外T_CONSTANT_ENCAPSED_STRING [英] Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/91/7287991/html/employeelogin/loginp.php on line 1
问题描述
嗨朋友们
请为此错误提供解决方案我已经连续两天徘徊
i当我尝试登录服务器系统时出现此错误...但我的本地(Xamp)系统工作正常
解析错误:语法错误,第1行/home/content/91/7287991/html/employeelogin/loginp.php中的意外T_CONSTANT_ENCAPSED_STRING
for这个错误我修复了白色空间cookie和escae函数也得到同样的错误
plz给出解决方案
index.php: -
Hi friends
please give solution for this error i have strugling for 2 days
i am getting this error in when i try to login server system... but my local (Xamp) system working fine
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/91/7287991/html/employeelogin/loginp.php on line 1
for this getting error i fixed white spaces cookies and escae functions also getting same error
plz give solution
index.php:-
<?php
include "index_header.php";
$failed=$_GET['failed'];?><script type="text/javascript"><!--function validate_login ( ){ valid = true; if ( document.login.user.value == "" ) { alert ( "Please fill the user name." ); valid = false; } else if ( document.login.pass.value == "" ) { alert ( "Please fill in the password." ); valid = false; } return valid;}//--></script><br><br><?phpif(isset($failed)){?><div class="empty" style="text-align:center;padding:10px;">Invalid username or password</div><?php}?> <form name="login" method="post" action="loginp.php" onSubmit="return validate_login( );"> <table cellspacing="0" cellpadding="5" class="miniLogOn"> <tr> <td colspan="2"> <h1 class="welcome">Log on to Admin Dashboard</h1> <br /> </td> </tr>
<tr ><th class="dlg" valign="top">Username:</th><td class="dlg" >
<input type="text" name="user" id="sPerson" size="30" class="dlgText" style="width:180px" value="" />
</td></tr><tr ><th class="dlg" valign="top">Password:</th><td class="dlg" >
loginp.php:------
loginp.php:------
<?phpinclude "db.php";phpinfo();$username=$_POST["user"];
$password=$_POST["pass"];
$p=$password;
$username=mysql_real_escape_string($username);
$password=mysql_real_escape_string($password);
//now md5 the password
if(!isset($username)){
include "error.php";
exit();
}
if(!isset($password)){
include "error.php";
exit();
}
$password=md5($password);
$mysqlqry="select username,id,name,email from users where username='".$username."'and password='".$password."'";
//echo $mysqlqry;
$result = mysql_query($mysqlqry);
//echo "Result is ".$result;
if (!$result)
{
header("Location:login.php?failed=1");
exit();
}
else{
$affected=mysql_num_rows($result);
if($affected == 1){$row = mysql_fetch_array($result);
//$id=$row["userid"];
$emailid=$row["email"];
$name=$row["name"];
$id=$row["id"];
setcookie("lu",$id,time()+10*3600);
header("Location:dashboard.php");
}
else{
?>
<?php
header("Location:login.php?failed=1");
}
}
?
>
DB.php:----
>
DB.php:----
<?php
$dbcnx = mysql_connect("xyz.com", "xyz", "asd123");
if(!$dbcnx)
{
echo("<P>Unable to connect to the " . "database server at this time.</P>" . mysql_error());
exit();
}
if (! @mysql_select_db("sbsemployee") )
{
echo( "<P>Unable to locate the database at this time.</P>" );
exit();
}
?>
谢谢&问候
Mallesh(Malleshsgd@gmail.com
Thanks & Regards
Mallesh(Malleshsgd@gmail.com
推荐答案
失败 =
failed=
_GET [' 失败'];? > < 脚本 类型 = text / javascript > <! - function validate_login(){valid = true; if(document.login.user.value ==){alert(请填写用户名。); valid = false;}否则if(document.login.pass.value ==){alert(Please fill在密码中。);有效=假; } return valid;} // - > < < span class =code-leadattribute> / script > < br > < br > <? phpif(isset(
_GET['failed'];?><script type="text/javascript"><!--function validate_login ( ){ valid = true; if ( document.login.user.value == "" ) { alert ( "Please fill the user name." ); valid = false; } else if ( document.login.pass.value == "" ) { alert ( "Please fill in the password." ); valid = false; } return valid;}//--></script><br><br><?phpif(isset(
failed)){? > < div class = 空 style = tex t-align:center; padding:10px; > 无效的用户名或密码< / div > <? php}? > < < span class =code-leadattribute> form 名称 = 登录 方法 = post action = loginp.php onSubmit = return validate_login(); > < table cellspacing = 0 cellpadding = < span class =code-keyword> 5 class = miniLogOn > < tr > < ; td colspan = 2 > < h1 class = 欢迎 > 登录管理员仪表板< / h1 > < br / > < / td > < span class =code-keyword>< / tr >
< tr < span class =code-attribute> > < th class = dlg valign = top > 用户名: < / th > < td 类 = dlg >
< ; 输入 type < span class =code-keyword> = text 名称 = 用户 id = sPerson size = 30 class = dlgText 样式 = width:180px value = / >
< / td > ; < / tr > < tr > < th class = dlg valign = top > 密码: < / th > < td class = dlg >
failed)){?><div class="empty" style="text-align:center;padding:10px;">Invalid username or password</div><?php}?> <form name="login" method="post" action="loginp.php" onSubmit="return validate_login( );"> <table cellspacing="0" cellpadding="5" class="miniLogOn"> <tr> <td colspan="2"> <h1 class="welcome">Log on to Admin Dashboard</h1> <br /> </td> </tr> <tr ><th class="dlg" valign="top">Username:</th><td class="dlg" > <input type="text" name="user" id="sPerson" size="30" class="dlgText" style="width:180px" value="" /> </td></tr><tr ><th class="dlg" valign="top">Password:</th><td class="dlg" >
loginp.php: - ----
loginp.php:------
<?phpinclude "db.php";phpinfo();
这篇关于解析错误:语法错误,第1行/home/content/91/7287991/html/employeelogin/loginp.php中的意外T_CONSTANT_ENCAPSED_STRING的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!