全体的なアイデアは、php で画像を作成するフォームを作成し、それをメールとして送信するための確認ページを作成することです。
私の Web ホスティング サービスでは動作しますが、easyPHP を念頭に置いたコンピューターでは動作しません。何もせず、完全な画像が画面に残り、リダイレクトされません。
<?php
header( "Content-type: image/png" );
ob_start();
if(!isset($_POST['name']) ||
!isset($_POST['birth']) ||
!isset($_POST['date']) ||
!isset($_POST['asiakasnumero']))
{
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$name = $_POST['name']; // required
$birth = $_POST['birth']; // required
$date = $_POST['date']; // required
$asiakasnumero = $_POST['asiakasnumero']; // required
$my_img = @imagecreatefrompng('card.png');
$text_colour = imagecolorallocate( $my_img, 255, 255, 255 );
imagestring( $my_img, 3, 240, 155, $name,
$text_colour );
imagestring( $my_img, 3, 240, 215, $birth,
$text_colour );
imagestring( $my_img, 3, 240, 273, $date,
$text_colour );
imagestring( $my_img, 3, 140, 327, $asiakasnumero,
$text_colour );
$image_path = "images/card".".png";
imagesetthickness ( $my_img, 5 );
imagepng( $my_img );
imagecolordeallocate($my_img , $text_colour );
imagepng($my_img, $image_path);
imagedestroy( $my_img );
ob_end_flush();
sleep(5);//seconds to wait..
header('HTTP/1.1 301 Moved Permanently'); //optional
header("Location: http://www.domain.com");
exit();
?>
リダイレクトするために .htaccess を使用しようとしましたが、htaccess では関数がその機能を実行できません。また、画像作成スクリプトと確認ページを組み合わせてみましたが、無駄でした...
ありがとう!