2013-07-01 3 views
-4

오류가 발생하는 경우 도움을받을 수있는 사람이 있습니까?PHP 코드를 실행하는 동안 구문 분석 오류가 발생했습니다.

오류

Parse error: syntax error, unexpected T_STRING in activation.php 

코드 당신은 다음 줄에 따옴표를 이스케이프 할 필요가

<?php 
error_reporting(E_ALL); 
ini_set('display_errors', '1'); 

if ($_GET['id'] != "") {  

    include_once "../scripts/connection.php"; 

    $id = $_GET['id']; 
    $hashpass = $_GET['sequence']; 

    $id = mysql_real_escape_string($id); 
    $id = eregi_replace("`", "", $id); 

    $hashpass = mysql_real_escape_string($hashpass); 
    $hashpass = eregi_replace("`", "", $hashpass); 

    // activates member by adding a 1 to activated in the database // 

    $sql = mysql_query("UPDATE memberAdmin SET activated='1' WHERE id='$id' AND password='$hashpass'"); 
    $sql_doublecheck = mysql_query("SELECT * FROM memberAdmin WHERE id='$id' AND password='$hashpass' AND activated='1'"); 
    $doublecheck = mysql_num_rows($sql_doublecheck); 

    // shows this info on the msgToUser.php page // 

    if($doublecheck = 0){ 
    $msgToUser = "<p><strong>Blackberry Creek Mini Farm Newsletter Site</strong></p> 
<p><strong>Sorry, your account could not be activated!</strong></p><br /> 
<p>Please click the Contact Us link below to email the site administrator and request manual activation.</p>"; 
    include 'msgToUser.php'; 
    exit(); 
    } elseif ($doublecheck > 0) { 

    $msgToUser = "<h1>Welcome to the Blackberry Creek Mini Farm Newsletter Site</h1> 
        <h2>Your membership has been activated!</h2>  
        <p>Please<strong> 
        <a href="news.galink.net/users/login.php">Log In</a> 
        </strong></p> 
        <p>Thank you for joining the Blackberry Creek Mini Farm Newsletter Site</p>";  

    include 'msgToUser.php'; 
    exit(); 
    } 
} 

print "Sorry, essential data from the activation URL is missing! Close your browser, go back to your email inbox, and please use the full URL supplied in the activation link we sent you.<br /> 
<br />[email protected]<br />"; 
?> 
+0

아마 soure 코드를 제공하고 싶습니까? –

+2

이 질문은 너무 현지화되어있어 주제와 관련이없는 것으로 보입니다. – halfer

답변

1

:

<p>Please<strong> <a href="news.galink.net/users/login.php">Log In</a></strong></p> 

\를 사용하여.

<p>Please<strong> <a href=\"news.galink.net/users/login.php\">Log In</a></strong></p> 
+0

타이가 변경하게 할 것입니다 – Sherry

1

첫째, if($doublecheck = 0) 아마 대신 ==해야한다.

두 번째로 "의 문자열로 "이 있습니다. 이걸로 변경해야합니다. \을 사용하여 $msgToUser 내에있는 "을 탈출하십시오. 당신이 따옴표 문자열을 가지고 있기 때문에

<p>Please<strong> <a href="news.galink.net/users/login.php">Log In</a></strong></p> 

, 당신의 따옴표를 탈출 할 수 있습니다 : 당신은 또한 단지 라인 (38)에 apostrophies에

$msgToUser = "<h1>Welcome to the Blackberry Creek Mini Farm Newsletter Site</h1> 

<h2>Your membership has been activated!</h2>   

<p>Please<strong> <a href=\"news.galink.net/users/login.php\">Log In</a></strong></p> 

<p>Thank you for joining the Blackberry Creek Mini Farm Newsletter Site</p>"; 
+0

타이가 변경하고 다시 시도하십시오 – Sherry

0

봐 처음과 마지막 따옴표를 변경할 수 있습니다 그 라인, 또는 사용 작은 따옴표

<p>Please<strong> <a href=\"news.galink.net/users/login.php\">Log In</a></strong></p> 

또는

<p>Please<strong> <a href='news.galink.net/users/login.php'>Log In</a></strong></p> 
+0

타이 변경하고 다시 시도 할 것입니다 – Sherry

관련 문제