各位大侠啊帮帮忙,请尽量说的详细点,本人新手
Jun 13, 2016 pm 01:31 PM
address
gt
lt
name
quot
求助各位大侠啊,帮帮忙,请尽量说的详细点,本人新手
$first_name=$_POST['first_name'];
$last_name=$_POST['last_name'];
$email_address=$_POST['email_address'];
$sex=$_POST['sex'];
$posting=nl2br($_POST['posting']);
$name=$first_name.' '.$last_name;
print"
Thank you,$name for your posting:
"$posting
our team will send the lastest meassage to $email_address.
$name=urlencode($name);//使用urlencode进行链接
$email_address=urlencode($_POST['email_address']);
echo "
Clickhereto continue.
";?>
出现Parse error: syntax error, unexpected '$name' (T_VARIABLE) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\handle_posting.php on line 18错误
------解决方案--------------------
1.输出html的时候尽量使用界定符
2.另外还有引号使用错误的问题.
- PHP code
<meta http-equiv="Content-Type" content="text/html"> <title>handle_posting</title> <?php $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email_address = $_POST['email_address']; $sex = $_POST['sex']; $posting = nl2br($_POST['posting']); $name = $first_name . ' ' . $last_name; echo <<<html "<div>Thank you,$name for your posting: <p>$posting</p> <p>our team will send the lastest meassage to $email_address.</p> html; $name = urlencode($name);//使用urlencode进行链接 $email_address = urlencode($_POST['email_address']); echo "<p>Click<a href="hand_posting.php?name=%24name&email_address=%24email_address">here</a>to continue.</p>"; ?> <br><font color="#e78608">------解决方案--------------------</font><br><br>" 加个分号 笨蛋!<br><br><br>";<br><br>另外请用echo 输出 <br><font color="#e78608">------解决方案--------------------</font><br><br>出现Parse error: syntax error, unexpected '$name' (T_VARIABLE) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\handle_posting.php on line 18错误<br><br>这种错误几乎是:不是哪里少了个分号,就是哪里少了个引号。 <br><font color="#e78608">------解决方案--------------------</font><br>少分号 <div class="clear"> </div>
登录后复制
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门文章
仓库:如何复兴队友
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
击败分裂小说需要多长时间?
3 周前
By DDD
Hello Kitty Island冒险:如何获得巨型种子
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 周前
By 尊渡假赌尊渡假赌尊渡假赌
公众号网页更新缓存难题:如何避免版本更新后旧缓存影响用户体验?
3 周前
By 王林

热门文章
仓库:如何复兴队友
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
击败分裂小说需要多长时间?
3 周前
By DDD
Hello Kitty Island冒险:如何获得巨型种子
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 周前
By 尊渡假赌尊渡假赌尊渡假赌
公众号网页更新缓存难题:如何避免版本更新后旧缓存影响用户体验?
3 周前
By 王林

热门文章标签

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

Microsoft正在推出Windows 11 23H2版本到带有Copilot的发布预览频道
