1

私が入るとき:

$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.";

問題は、ローカルホストがメールを送信するように設定されていないことにあると思います。ページが実際に Web 上にあり、「$site」変数に実際の URL を使用した場合、これは機能しますか?

4

3 に答える 3