如何修复解析错误:语法错误,第114行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ [英] How do I fix parse error: syntax error, unexpected 'header' (T_STRING) in C:\xampp\htdocs\new.php on line 114

查看:103
本文介绍了如何修复解析错误:语法错误,第114行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是php编程的初学者,我正在设计一个基本网站,可以添加记录,删除记录并查看使用PHPmyAdmin创建的数据库中的所有记录。



我添加了一条记录后,我想回到我来自的页面,为此我被告知要使用 -



header(位置:查看。 php);



对于这行代码,出现以下错误 -



解析错误:语法错误,第114行C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\要解决它吗?



我尝试了什么:



试过搜索网站和youtube视频,希望他们可以告诉我这是什么问题,可以做些什么,但没有找到任何有用的东西。

解决方案

该行

 header( 位置:View.php); 

看起来很好。但解析错误也可能是由前一行的错误引起的。因此,检查这些或编辑您的问题以显示它们。常见错误是行末端缺少分号和未终止的字符串文字(缺少终止单引号或双引号字符或使用错误的字符)。这似乎适用于此,因为 T_STRING 表示字符串文字存在问题。



此代码应该例如生成类似的错误:

  echo   使用header()函数; 
header(
位置:View.php );


I am beginner in php programming and am designing a basic website that can add a record, delete records and view all records in a database that was created using PHPmyAdmin.

After I have added a record I want to return to the page I came from, for this I was told to use -

header("Location: View.php");

For this line of code the following error appears -

Parse error: syntax error, unexpected 'header' (T_STRING) in C:\xampp\htdocs\New.php on line 114

Why is this happening and what can I do to fix it ?

What I have tried:

Tried searching websites and youtube videos hoping that they may tell me what the issue is and what can be done about it, but haven't found anything useful.

解决方案

The line

header("Location: View.php");

looks fine. But parsing errors may be also sourced by errors on previous lines. So inspect those or edit your question to show them. Common errors are a missing semicolon at the line end and unterminated string literals (missing the terminating single or double quote character or using the wrong one). That seems to apply here because T_STRING indicates a problem with a string literal.

This code should for example generate a similar error:

echo "Using header() function;
header("Location: View.php");


这篇关于如何修复解析错误:语法错误,第114行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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