当我输入:
$site = "http://localhost";
双斜杠后的所有内容都被注释掉。我该如何防止这种情况? 编辑谢谢你的帮助。我想我应该详细说明。我正在设置这个变量,以便我可以在这段代码中使用它:
if ($numrows == 1){
$site = "http://localhost";
$webmaster = "myemail@somemail.com"; //not my email
$headers = "From: $webmaster";
$subject = "Activate Your Account";
$message = "Thank you for registering! Click the link below to activate your account.\n";
$message .= "$site/activate.php?user=$getuser&code=$code\n";
$message .= "You must activate your account to log in.";
if(mail($getemail, $subject, $message, $headers)){
$errormsg = "You have been registered. You must activate your account from the activation link sent to <b>$getemail</b>.";
$getuser = "";
$getemail = "";
}else
$errormsg = "An error has occurred. Your activation email was not sent.";
}else
$errormsg = "An error has occurred. Your account was not created.";
我认为问题可能是我的本地主机未设置为发送电子邮件。如果页面实际上在网络上并且我为“$site”变量使用了真实的 URL,这会起作用吗?