メールを開いたときにあらゆる種類の情報を追跡するニュースレターシステムを作成しています。
私は次のような画像から始めました
<p><img src="http://xxx.com/newsletterInfo.php?newsletter=12&userid=234" width="314" height="20" alt="Cancel Newsletter Subscription"></p>
次に、newsletterInfo.phpファイルで、URLを画像にエコーします。
私はこれがこれを行う方法ではないと思いますか?
私の問題がどこにあるのか教えてください。
ありがとう
アップデート
メールの送信:
$name = stripslashes($fetchquery["name"]);
$email = stripslashes($fetchquery["email"]);
$content = $_POST["maincontent"];
$subject = $_POST["subject"];
$message = "<html><head><title>".$subject."</title></head><body>";
$message .= str_replace('{name}', $name, $content);
$message .= '<p><img src="http://xxx.com/newsletterInfo.php?newsletter='.$id.'" width="314" height="20" alt="Cancel Newsletter Subscription"></p>';
$message .= "</body></html>";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Username <email@here.com>' . "\r\n";
// Mail it
mail($email, $subject, $message, $headers);
情報ページで、私はこれを行いました:
if(isset($_GET["newsletter"])) {
$query = $pdo->prepare("UPDATE newsletter SET opened=`opened` +1 WHERE id=:id");
$query->execute(array(':id' => $_GET["newsletter"]));
$query_num = $query->rowCount();
if($query_num > 0){
echo 'http://xxx.com/cancel.png';
}
ご覧のとおり、メールはmail()関数を使用してニュースレターを送信し、画像がどこにあるかをphpファイルのURLに入力しました。このファイル内で変数を要求し、設定されている場合は画像のURLをエコーします。データベースにデータを入力します。データベースが更新されているため、これはすべて100%機能します。
持っている問題は、画像が壊れていることです。
右クリックしてnewsletterInfo.phpに移動すると、URLが表示されます。
私はこれが単にこれを行う方法ではないと思います。