2013-07-01 32 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

ty會做出更改 – Sherry

1

首先,if($doublecheck = 0)大概應該是一個==代替。

其次,你必須S「將其與"創建一個字符串中的S」 "。你應該改變它。使用\可以在$msgToUser內轉義"。你也可以只改變第一和最後一個引號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

ty會進行更改並重試 – Sherry

0

看38行:

<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> 

OR

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

ty會更改並重試 – Sherry