各位大侠啊帮帮忙,请尽量说的详细点,本人新手

WBOY
풀어 주다: 2016-06-13 13:31:21
원래의
852명이 탐색했습니다.

求助各位大侠啊,帮帮忙,请尽量说的详细点,本人新手



handle_posting


$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>
로그인 후 복사
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!