如题:
<img src='index.php' alt='看不清楚'>
在浏览器运行时,会去解析src中的index.php文件吗

解决方案 »

  1.   

    不会,如果是php 代码,会得到执行。
      

  2.   

    浏览器会向服务器请求index.php,请求提交到服务器后会像其它动态页面一样的处理滴。
      

  3.   

    怎么说呢?如果php文件是输出图片的,如用gd库生成的图片?
    举个例子:
    gd.php
    <?php$img_width=100;
    $img_height=20;
    srand(microtime()*100000); //随机数
    for($i=0; $i<4; $i++){
      $new_number[]=dechex(rand(0,15));
    }
    $_SESSION["check_auth"]=$new_number;header("content_type:image/png");
    $image=@imagecreate($img_width,$img_height); //创建图像对象
    $background_color=imagecolorallocate($image,222,45,58); //背景色
    $text_color=imagecolorallocate($image,233,14,91);
    for($i=0; $i<count($_SESSION["check_auth"]); $i++){
      $font=mt_rand(3,7);
      $x=mt_rand(1,8)+$img_width*$i/4;
      $y=mt_rand(1,$img_height/4);
      $color=imagecolorallocate($image,mt_rand(0,100),mt_rand(0,150),mt_rand(0,200)); //字符颜色
      $str=$_SESSION["check_auth"][$i];
      imagestring($image,$font,$x,$y,"{$str}",$color); //输出字符
    }imagepng($image); //输出png图像
    imagedestroy($image); //销毁图像对象?>index.php
    <img src='gd.php' alt='看不清楚'><!--可以生成图片->再比如:
    gd.php
    <?php echo "带X的图片"?>
    index.php
    <img src='gd.php' alt='看不清楚'><!--可以带X的图片->
      

  4.   

    看错了。是src。有些动态显示图像就是这样做的。
      

  5.   

    会运行这个php页面的代码.说错老.