要生成图片就得用GD2函数库,这是一个php内置的专用绘图库

解决方案 »

  1.   

    <input id="refresh" type="submit" class="button" onclick="this.previousSibling.src='createimage.php'" value="refresh">
      

  2.   

    <img src='createimage.php' name="test" width="681" height="422" id="image"/>
    <input id="refresh" type="submit" class="button" onclick="document.getElementById('image').src='createimage.php?'+Math.random();" value="refresh"> 
      

  3.   

    也可以在'createimage.php'设置
      header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
      header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
      header("Cache-Control: no-store, no-cache, must-revalidate");
      header("Cache-Control: post-check=0, pre-check=0", false);
      header("Pragma: no-cache");
      

  4.   

    有个小问题:怎么把a.php中的用户输入参数传到createimage.php?例如传一个字符串到createimage.php中昨天试验过了,如果不传参数按照楼上兄弟的方法可以达到要求,但如果传参数加个表单<form method="POST" action="createimage.php">
    当点击按钮后,页面会跳转到createimage.php,而不是在a.php的image标签下显示图像怎么传参数到createimage.php,又可以保证在a.php的标签下显示动态创建的图像(由createimage.php创建)?不知道是否说明白了:)
      

  5.   

    <img src='createimage.php' name="test" width="681" height="422" id="image"/>
    <input id="refresh" type="submit" class="button" onclick="document.getElementById('image').src='createimage.php?a=a&'+Math.random();" value="refresh">createimage.php?a=a&'+Math.random();其中a=a不是实现了传参,你在createimage.php用$_GET['a']就可以得到.
    Math.random()这个的作用就是清除缓存.你可以根据你实际需要改变a=后面的值.
    用<form method="POST" action="createimage.php"> 这种方法肯定会跳到createimage.php里面直接执行的.
      

  6.   


    基本上正确.
    但最好将type='submit'换成type='button',要不然当前页面会提交的.
      

  7.   

    这个和表单无关参数一:<input id="a" type="text" "> 
    参数二:<input id="b" type="text" "> 
    能数三:<input id="c" type="text" "> 
    <img src='createimage.php' name="test" width="681" height="422" id="image"/> 
    <input id="refresh" type="button" class="button" onclick="showimg()"> function showimg(){
      var a=document.getelementbyid('a').value
      var b=document.getelementbyid('b').value  var c=document.getelementbyid('c').value  document.getElementById('image').src='createimage.php?a='+a +'&b='+b+'&c='+c;}
      

  8.   

    这个和表单无关参数一:<input id="a" type="text" "> 
    参数二:<input id="b" type="text" "> 
    能数三:<input id="c" type="text" "> 
    <img src='createimage.php' name="test" width="681" height="422" id="image"/> 
    <input id="refresh" type="button" class="button" onclick="showimg()"> function showimg(){
      var a=document.getelementbyid('a').value
      var b=document.getelementbyid('b').value  var c=document.getelementbyid('c').value  document.getElementById('image').src='createimage.php?a='+a +'&b='+b+'&c='+c;}
      

  9.   


    你传参数与那个没有关系的,createimage.php?参数=参数值&'+Math.random();
    类似这样的
      

  10.   


    在a.php中有用户输入text,如何取出值用createimage.php?a=a&'+Math.random()方式表达?
      

  11.   

    <img src='createimage.php' name="test" width="681" height="422" id="image"/> 
    <input id="refresh" type="submit" class="button" onclick="document.getElementById('image').src='createimage.php?a=a&'+Math.random();" value="refresh"> createimage.php?a=a&'+Math.random();其中a=a不是实现了传参,你在createimage.php用$_GET['a']就可以得到. 
    Math.random()这个的作用就是清除缓存.你可以根据你实际需要改变a… 
      

  12.   


    <img src='createimage.php' name="test" width="681" height="422" id="image"/> 
    <input id="refresh" type="submit" class="button" onclick="document.getElementById('image').src='createimage.php?a='+document.getElementById('文本框的ID').vakue+'&'+Math.random();" value="refresh">