Php 有人能帮我解决这个问题吗

Php 有人能帮我解决这个问题吗,php,javascript,gd,Php,Javascript,Gd,这是我的网站。目前,我正在尝试创建自己的测试URL: 如果你看着它,你就会明白我在做什么。我正在尝试将JavaScript链接到我的PHP,因此文字显示为effects/effect colors/colors。它都是通过我正在编写的PHP脚本生成的 以下是我的PHP: <?php header("Content-type: image/png"); $string = $_GET['text']; $currentFont =$_GET['font']; $cu

这是我的网站。目前,我正在尝试创建自己的测试URL:

如果你看着它,你就会明白我在做什么。我正在尝试将JavaScript链接到我的PHP,因此文字显示为effects/effect colors/colors。它都是通过我正在编写的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,请告诉我。

您可以尝试将第一行更改为此以调试问题:


标题('Content-Type:text/plain')

能否请您对标题进行描述性描述?请在代码块中使用适当的换行符。您不必按行付费。您可以尝试将第一行更改为该行以调试问题:That is true header('Content-Type:text/plain');