要配合html
css js
不是PHP能完成的

解决方案 »

  1.   

    PHP来做后台。JS做前后,运行下面的代码试试
    <!-- 在要显示形象预览的地方放置以下这句代码 -->
    <div id="bodyshow" style="border:1px solid #000000;padding:0;POSITION: relative; Left: 0px; TOP: 0px; HEIGHT: 226px; WIDTH: 140px;"></div> 
    <!-- 这是提交表单,把代表用户形象的字符串赋到隐藏域 userequip 提交 -->
    <form name="equipform" method="post" action="">
    <input name="userequip" type="hidden" value=""> 
    <input name="saveequip" type="submit" value="保存形象" > 
    <input name="toreequip" type="button" value="原始形象" onclick="shoiwit('df>df>df>0');return false;" > 
    </form><script language="JavaScript">
    <!--
    var myequip="df>df>df>0"; //最初显示的配置码,可由服务器读取并输出。function shoiwit(equip){ //这个函数由配置码为参数,显示虚拟形象
    showlayers=equip.split('>'); //以“>”为分隔符,分配各层图片名到一个数组 showlayers[]
    str="";
    for(i=0;i<showlayers.length;i++){
    if(showlayers[i]!='0'&&showlayers[i]!=''){ //如果图片名为0或空值则该层不显示。
    str+="<img src='http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/"+(i+1)+"/"+showlayers[i]+".gif' style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:"+(i+1)+";'>";
    }
    }
    //最后在最上一层覆盖一幅完全透明的图片,这样用户在上面右链>另存为也只能保存这幅图了:
    str+="<img src='http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/blank.gif' style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:100;'>";
    if(equipform.userequip) equipform.userequip.value=myequip=equip; //把配置码赋值到隐藏域中
    bodyshow.innerHTML=str; //显示各层图片。
    }
    //页面加载后先显示最初的虚拟形象:
    document.body.onload=new Function("shoiwit(myequip)");function dressit(layer,img){ //这个函数用于更换配置,参数为 层数,图片名
    showlayers=myequip.split('>');
    newequip="";
    for(i=0;i<showlayers.length;i++){
    if(i+1==layer){
    if(img==showlayers[i]) newequip+="df"; //如果该层已是这幅图片,则恢复为原始图片
    else newequip+=img; //否则换为这幅图
    }
    else newequip+=showlayers[i]; //其他层图片不变
    if(i+1!=showlayers.length) newequip+=">";
    }
    shoiwit(newequip); //显示最新配置
    }-->
    </script><!--
    以下是供选图片列表,点击一幅图则更改相应的层的这幅图片
    注意链接路径,javascript:dressit(4,1) 表示第4层换上/脱下图片"1.gif",依此类推;
    不过要注意若要第4层换上/脱下图片“df.gif”,则应加引号,写成 javascript:dressit(4,'df')
    -->
    <table border="0" cellspacing="0" cellpadding="0">
    <tr> 
    <td width="84"><a href="javascript:dressit(4,1)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/4/1x.gif" width="84" height="84" border="0"></a></td>
    <td width="84"><a href="javascript:dressit(4,2)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/4/2x.gif" width="84" height="84" border="0"></a></td>
    <td width="84"><a href="javascript:dressit(4,3)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/4/3x.gif" width="84" height="84" border="0"></a></td>
    <td width="84"><a href="javascript:dressit(4,4)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/4/4x.gif" width="84" height="84" border="0"></a></td>
    </tr>
    <tr> 
    <td><a href="javascript:dressit(3,1)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/3/1x.gif" width="84" height="84" border="0"></a></td>
    <td><a href="javascript:dressit(3,2)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/3/2x.gif" width="84" height="84" border="0"></a></td>
    <td><a href="javascript:dressit(3,3)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/3/3x.gif" width="84" height="84" border="0"></a></td>
    <td><a href="javascript:dressit(3,4)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/3/4x.gif" width="84" height="84" border="0"></a></td>
    </tr>
    <tr> 
    <td><a href="javascript:dressit(2,1)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/2/1x.gif" width="84" height="84" border="0"></a></td>
    <td><a href="javascript:dressit(2,2)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/2/2x.gif" width="84" height="84" border="0"></a></td>
    <td><a href="javascript:dressit(2,3)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/2/3x.gif" width="84" height="84" border="0"></a></td>
    <td><a href="javascript:dressit(2,4)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/2/4x.gif" width="84" height="84" border="0"></a></td>
    </tr>
    <tr> 
    <td><a href="javascript:dressit(1,1)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/1/1x.gif" width="84" height="84" border="0"></a></td>
    <td><a href="javascript:dressit(1,2)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/1/2x.gif" width="84" height="84" border="0"></a></td>
    <td><a href="javascript:dressit(1,3)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/1/3x.gif" width="84" height="84" border="0"></a></td>
    <td><a href="javascript:dressit(1,4)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/1/4x.gif" width="84" height="84" border="0"></a></td>
    </tr>
    </table>
      

  2.   

    文章: http://www.pconline.com.cn/pcedu/empolder/wz/javascript/0305/169147.html
    打包下载:  http://arch.pconline.com.cn/pcedu/redian/code_2003/example.rar
      

  3.   

    只要把前台提交的数据保存到数据库就可以保存形像了 :) goodluck
      

  4.   

    rt   nod
    严重同意楼上...
      

  5.   

    PHP+JS,找这些方面的资料应该可以。
      

  6.   

    晕,后台进行图片管理前面用css与js进行效果显示就可以了.
      

  7.   

    discuz的一个叫虚拟形象的插件不是用PHP实现的吗?
    好象也没用到JS呀
      

  8.   

    discuz的一样用js的,只是拍照那里用了GB库而已!