2012-04-25 17 views
0

私のサイトです。私はしばらくの間、独自のテストのURLを作成しようとしている:あなたがそれを見ればあなたは私が何をしようとしていますかを見ることができますいくつか私はこれを働かせることができます

http://boats.instantonlinesuccess.co.uk/boat-names.html

。 JavaScriptをPHPにリンクしようとしています。そのため、効果/効果の色/色が表示されます。それはすべて私が書こうとしているPHPスクリプトを介して生成されます。

<?php header("Content-type: image/png"); 
    $string = $_GET['text']; 
    $currentFont =$_GET['font']; 
    $currentTextColour = $_GET['colour']; 
    $currentEffect = $_GET['effect']; 
    $currentEffectColour = $_GET['effectcolour']; 
    $im = imagecreatefrompng("images/test.png"); 
    $px = (imagesx($im) - 7.5 * strlen($string))/2; 
    //if you exactly know the RGB color indexes// 
    $rgb = imagecolorexact($im, 0, 0, 0); 
    //or keep the rgb color by position so at top 0 left 0 
    $rgb = imagecolorat($im, 0, 0); 
    imagecolortransparent($im, $rgb); 
    imagestring($im, 64, $px, 16, $string, $currentTextColour); 
    imagepng($im); imagedestroy($im); 
?> 

JavaScriptを必要とする場合、私に知らせてください:

は、ここに私のPHPです。

+4

あなたのタイトルを記述してくださいもらえますか? – PeeHaa

+5

あなたのコードブロックで適切な改行を使用してください。 1行につき支払う必要はありません。 – PeeHaa

+2

何が問題なのですか? – jeroen

答えて

0

あなたは、問題をデバッグするためにこれにあなたの最初の行を変更してみてください:

header('Content-Type: text/plain');

関連する問題