PHP Online Graphics program code

Source: Internet
Author: User
Tags php file php online

<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>php Tutorials Online Diagram program code
</title>
<style>
/* {-moz-box-sizing:border-box;} * *

Body {
Background-color: #aaa;
Font-family:tahoma;
font-size:12px;
}
A
Text-decoration:none;
Outline:none;
}
A:focus {
-moz-outline:none;
Outline:none;
}

#window {
Background-color:threedface;
Position:absolute;
width:850px;
height:500px;
left:10%;
top:10%;

BORDER:1PX solid;
Border-top-color:threedlightshadow;
Border-left-color:threedlightshadow;
Border-right-color:windowframe;
Border-bottom-color:windowframe;

Z-index:2;
}

#workspace {
Background-color: #ece9d8; /*threedface*/
Overflow:auto;

Position:absolute;
width:98%;
height:84%;
top:51px;
left:8px;
right:0;
bottom:74px;
Z-index:3;

BORDER:1PX solid;
Border-top-color:threeddarkshadow;
Border-left-color:threeddarkshadow;
Border-right-color:threedhighlight;
Border-bottom-color:threedhighlight;
}

#myimg {
Display:none;
Position:absolute;
margin:3px;
}
#canvas, #canvastemp {
Display:none;
Position:absolute;
margin:3px;
Background-color:transparent;
border:1px solid #666666;
/* Background-image:url (Back.gif); */
}
#shapes {
Position:absolute;
margin:3px;
}

#titlebar, #menubar, #statusbar, #resize {
Background-color:threedface;
Z-index:10;
Position:absolute;
}

#titlebar {
left:2px;
top:2px;
height:22px;
width:99.4%;
Overflow:hidden;

}
#gradient {
width:100%;
}
#menubar {
left:0px;
top:27px;
height:20px;
width:100%;
List-style:none;
margin:0;padding:0;
Z-index:10;
border-bottom:1px solid Threedshadow;
}

#menubar Li {
border:0px;
margin:0;
margin-top:1px;
Font:menu;
Float:left;
padding:1px;
Padding-left:0.4em; Padding-right:0.4em;
Cursor:default;
}

#statusbar {
Z-index:6;
left:8px;
bottom:0;
height:26px;
width:98%;
border-top:1px solid threedhighlight;
padding-top:2px;
}

#resize {
z-index:100;
bottom:0; right:0;
width:15px; height:15px;
Background:transparent url ('.. /resize.gif ') 3px 3px no-repeat;
Cursor:nw-resize;
}

#titlebar Canvas {
Position:absolute;
width:100%;
}
#titlebar H1 {
Background:transparent url ('.. /cut.gif ') 1px 2px no-repeat;
Position:absolute;
Color:captiontext;
font-size:12px;
margin:0;padding:0;
padding-left:20px;
padding-top:2px;
Cursor:default;
}
#titlebar H2 {
Position:absolute;
Color:yellow;
font-size:12px;
margin:0;padding:0;
right:8px;
padding-top:2px;
Cursor:default;
}
#statusbar2 {
margin-left:0px;
}

#statusbar2 > Div {
Float:left;
}

#statusbar2 #status {float:left; width:57%;}
#statusbar2 #xy {float:left; width:20%;}
#statusbar2 #txy {float:left; width:20%;}

#status Div, #xy Div, #txy div {
padding:3px;
BORDER:1PX solid;
Border-top-color:threedshadow;
Border-left-color:threedshadow;
Border-right-color:threedhighlight;
Border-bottom-color:threedhighlight;
Height:1.3em;
*height:1.7em;
Line-height:1.3em;
Overflow:hidden;
}
</style>
<script>
var mode = 1;
var inout = Toubai = 0;
var img, Imgurl = ', Imgdata = ';
var p = ';
var xydir = 15;
var startangle=0, endangle= (math.pi/180) *270;
var m;
Var win, WSP, Canvas, C, canvastemp, ctemp, shapes;
var w,h,f;
var isshift = 0;
var shape = 0;
var theobject = null;
var dx, dy, DW, DH;
var des = ';
var iface = {dragging:false, resizing:false, Status:null, Xy:null, txy:null}
var anyt = 1;

var Isie =/msie/i.test (navigator.useragent);
var ISFF =/firefox/i.test (navigator.useragent);

Window.onload = function ()
{
Win = document.getElementById (' window ');
wsp = document.getElementById (' workspace ');

img = document.getElementById (' myimg ');
Canvas = document.getElementById (' canvas ');
Canvastemp = document.getElementById ("Canvastemp");
Shapes = document.getElementById (' shapes ');
Rects = document.getElementById (' rect ');

Win.style.left = document.body.clientwidth/2-425+ ' px ';
if (Canvas.getcontext)
{
c = Canvas.getcontext ("2d");
C.linewidth = 1;
C.strokestyle = ' #f00 ';
C.fillstyle = "Rgba (255,255,255,0.3)";
C.strokefill = 1;

Ctemp = Canvastemp.getcontext ("2d");


Ctemp.linewidth = 1;


Ctemp.strokestyle = ' #f00 ';


Ctemp.fillstyle = "Rgba (255,255,255,0.3)";


Ctemp.strokefill = 1;





var Gradientcanvas = document.getElementById (' gradient ');


if (Gradientcanvas.getcontext)


{


var g = Gradientcanvas.getcontext (' 2d ');


var grad = g.createlineargradient (0, 0, 1200, 22);


Grad.addcolorstop (0, ' #036 ');


Grad.addcolorstop (1, ' #acf ');


G.fillstyle = Grad;


G.fillrect (0, 0, 1200, 22);


}





Iface.status = document.getElementById (' status '). FirstChild;


Iface.xy = document.getElementById (' xy '). FirstChild;


Iface.txy = document.getElementById (' Txy '). FirstChild;





Document.onmouseup = Window.onmouseup = Bodyup;


Document.onmousemove = Window.onmousemove = Bodymove;


Document.onkeydown = Window.onkeydown = KeyDown;


Document.onkeyup = Window.onkeyup = KeyUp;


Img.onmousedown = Canvas.onmousedown = Canvastemp.onmousedown = Shapes.onmousedown = C_down;


Img.onmousemove = Canvas.onmousemove = Canvastemp.onmousemove = Shapes.onmousemove = C_move;


Img.onmouseup = Canvas.onmouseup = Canvastemp.onmouseup = Shapes.onmouseup = c_up;


Img.onmouseo tutorial ut = canvas.onmouseout = Canvastemp.onmouseout = C_out;


}


else//Does not support canvas properties


{


Alert (' does not support canvas ');


}

}

function openimg ()
{
var form = document.upimg;

var file = Form.ifile.value;
var pos = File.lastindexof ('. ');
var ext = file.substring (pos + 1). toLowerCase ();
if (ext!= ' jpg ' && ext!= ' gif ' && ext!= ' BMP ' && ext!= ' png ')
{
Alert (' ERROR: Upload image must be jpg/gif/bmp/png format! ');
Return
}
Form.submit.click ();
document.getElementById (' upimg '). style.display = ' None ';
}

function upimg (URL, size, WW, hh, ff)


{


shape = 0;


Des = ' size: ' +size+ ' byte &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frame number: ' +ff+ ' frame &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width : ' +ww+ ' pixel &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: ' +hh+ ' pixel ';


Iface.status.innerhtml=des;


Imgurl = URL;


Imgdata = ' imgurl= ' +imgurl+ ';


if (ww&gt;800) {w =-H = hh/(ww/800);}


else {w = ww; h= hh;}


f = ff;


IMG.SRC = Imgurl;


document.getElementById (' myimg '). style.display = ' block ';


document.getElementById (' myimg '). src = imgurl;


canvas.style.display= ' block ';


canvastemp.style.display= ' block ';


Canvas.width = Canvastemp.width = W;


Canvas.height = Canvastemp.height = h;


Canvas.style.width = Canvastemp.style.width = w+ ' px ';


Canvas.style.height = Canvastemp.style.height = h+ ' px ';


C.clearrect (0, 0, canvas.width, canvas.height);


Ctemp.clearrect (0, 0, canvastemp.width, canvastemp.height);


C.strokestyle = ' #f00 ';


C.fillstyle = "Rgba (255,255,255,0.3)";


Ctemp.strokestyle = ' #f00 ';


Ctemp.fillstyle = "Rgba (255,255,255,0.3)";


}

function init (t)
{
if (Imgurl = = "") {alert (' please upload the picture First! ');
Else alert ("The current version is a demo version!") ");
}
function Reset ()
{
if (Imgurl = = "") {alert (' please upload the picture First! ');
Else alert ("The current version is a demo version!") ");
}
function Clip ()
{
if (Imgurl = = "") {alert (' please upload the picture First! ');
Else alert ("The current version is a demo version!") ");
}

function Hover (o)
{
O.style.border = "1px solid";
O.style.bordercolor = "Threedhighlight threeddarkshadow threeddarkshadow threedhighlight";
}
function Hoverout (o)
{
O.style.border = "0px solid transparent";
}

function Help ()
{
document.getElementById (' help '). style.display= ' blocks ';
}
function about ()
{
document.getElementById (' about '). style.display= ' block ';
}
function wrong (str)
{
alert (str);
}
</script>
<!--[If ie]>
<script type= "text/web Effects" src= "Js/excanvas.js" ></script>
<! [endif]-->

<body id= "Body" >
<form name= "Build" enctype= "Multipart/form-data" ><input type= "hidden" name= "Imgdata" ><input type= " Hidden "name=" region "><input type=" hidden "name=" "Back" ><input type=submit "Name=submit style=" position: Absolute;filter:alpha (opacity=0);-moz-opacity:0;opacity:0; "); ></form>

<div id= "Window" >

&lt;div id= "titlebar" onmousedown= "Windowdrag (event)" oncontextmenu= "return false" &gt;&lt;canvas id= "gradient" height= "&gt;&lt;/canvas&gt;&lt;h1" style= "MARGIN-TOP:2PX;" &gt; Picture Cutting Tools &lt;/h1&gt;&lt;h2 style= "MARGIN-TOP:1PX;" &gt;&lt;a href= "Javascript:help ();" hidefocus= "true" &gt;&lt;font color=yellow&gt; operation Instructions &lt;/font&gt;&lt;/a&gt;&amp; Nbsp;&amp;nbsp;&lt;a href= "Javascript:about ();" hidefocus= "true" &gt;&lt;font color=yellow&gt; about Us &lt;/font&gt; &lt;/a&gt;&lt;/h2&gt;


&lt;/div&gt;


&lt;ul id= "menubar" oncontextmenu= "return false" &gt;


&lt;li onmouseover= "hover (This)" onmouseout= "hoverout (This)" onclick= "document.getElementById (' help '). Style.display= ' None ';d ocument.getelementbyid (' about '). style.display= ' None ';d ocument.getelementbyid (' Set '). Style.display= ' None ';d ocument.getelementbyid (' upimg '). style.display= ' block '; &gt;&amp;nbsp; upload pictures (&lt;u&gt;u&lt;/u&gt;) &lt;/li&gt;


&lt;li onmouseover= "hover (This)" onmouseout= "hoverout (This)" onclick= "init (1);" &gt; Rectangular Trim (&lt;u&gt;r&lt;/u&gt;) &lt;/li&gt;


&lt;li onmouseover= "hover (This)" onmouseout= "hoverout (This)" Onclick= "Init (2)" &gt; Circular cropping (&lt;u&gt;o&lt;/u&gt;) &lt;/ Li&gt;


&lt;li onmouseover= "hover (This)" onmouseout= "hoverout (This)" Onclick= "init (3)" &gt; Rounded rectangle cropping (&lt;u&gt;c&lt;/u&gt;) &lt;/li&gt;


&lt;li onmouseover= "hover (This)" onmouseout= "hoverout (This)" Onclick= "Init (4)" &gt; Arc cropping (&lt;u&gt;a&lt;/u&gt;) &lt;/ Li&gt;


&lt;li onmouseover= "hover (This)" onmouseout= "hoverout (This)" Onclick= "Init (5)" &gt; Polygon cropping &lt;/li&gt;


&lt;li style= "top:0px;margin-left:-3px;padding-left:0px;margin-top:-2px;padding-top:0px;padding-bottom:0px;" &gt;&lt;input type= "Radio" name= "any" id= "line" Hidefocus disabled the Straight edge checked&gt; &lt;input "type=" Radio "any" name= " Curve "Hidefocus disabled&gt; curved Edge &lt;/li&gt;


&lt;li onmouseover= "hover (This)" onmouseout= "hoverout (This)" Onclick= "Init (6)" &gt; Arbitrary graphics Cropping (&lt;u&gt;m&lt;/u&gt;) &lt;/li&gt;


&lt;li style= "MARGIN-TOP:0PX;MARGIN-RIGHT:7PX;*MARGIN-RIGHT:5PX;FLOAT:RIGHT;PADDING-TOP:1PX;*PADDING-TOP:2PX; padding-bottom:1px;*padding-bottom:0px;border:1px solid threeddarkshadow;color:red "onclick=" clip () "&gt; Cropping &lt;/li &gt;


&lt;li style= "MARGIN-TOP:0PX;MARGIN-RIGHT:7PX;*MARGIN-RIGHT:5PX;FLOAT:RIGHT;PADDING-TOP:1PX;*PADDING-TOP:2PX; padding-bottom:1px;*padding-bottom:0px;border:1px solid threeddarkshadow;color:red "onclick=" Reset () "&gt; Reset &lt;/ Li&gt;


&lt;li style= "MARGIN-TOP:0PX;MARGIN-RIGHT:7PX;*MARGIN-RIGHT:5PX;FLOAT:RIGHT;PADDING-TOP:1PX;*PADDING-TOP:2PX; padding-bottom:1px;*padding-bottom:0px;border:1px solid threeddarkshadow;color:red "onclick=" document.getElementById (' Set '). style.display= ' block ' &gt; Settings &lt;/li&gt;


&lt;/ul&gt;





&lt;div id= "Workspace" oncontextmenu= "return false" &gt;


&lt;img id= "Myimg" &gt;


&lt;canvas id= "Canvas" oncontextmenu= "return false" &gt;&lt;/canvas&gt;


&lt;canvas id= "Canvastemp" oncontextmenu= "return false" &gt;&lt;/canvas&gt;


&lt;div id= "Shapes" &gt;


&lt;table class=resizeme id=rect style= "position:absolute;z-index:100;border:0px dotted #ff0000; width:100;height : 100;display:none; "cellspacing=" 0 "cellpadding=" 0 "&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;


&lt;/div&gt;


&lt;/div&gt;

<div id= "StatusBar" oncontextmenu= "return false" ><div id= "Statusbar2" >
<div id= "status" ><div>&nbsp;</div></div>
<div id= "XY" ><div>&nbsp;</div></div>
<div id= "Txy" ><div>&nbsp;</div></div>
</div></div>
<div id= "Resize" onmousedown= "WindowResize (event, this)" oncontextmenu= "return false" ></div>

&lt;form id= "upimg" name= "upimg" action= "upload.php" method= "post" enctype= "Multipart/form-data" target= "_frame" Style= "Position:absolute;background-color: #036; left:50%;top:50%;margin-left:-163px;*margin-left:-175px; Margin-top:-80px;width:325px;*width:350px;padding-top:3px;padding-left:3px;padding-bottom:3px;padding-right : 3px;z-index:12;display:none "&gt;


&lt;div style= "Background-color: #036;p adding-top:1px;padding-left:2px;color:captiontext;font-size:12px;height : 20px "&gt;&lt;b&gt;&amp;nbsp; upload picture &lt;/b&gt;&lt;/div&gt;


&lt;div style= "background-color:threedface;padding-top:6px;padding-bottom:6px;padding-left:10px;" &gt;&lt;input size= "type=" file "Name=" IFile "onchange=" openimg (); "style=" height:22px "&gt;&amp;nbsp;&lt;input" Type= "button" value= "Cancel" style= "height:22px" onclick= "document.getElementById (' upimg '). style.display= ' None ' &gt; &lt;input type=submit name=submit style= "Position:absolute;filter:alpha (opacity=0);-moz-opacity:0;opacity:0;" &gt;&lt;/div&gt;


&lt;/form&gt;





&lt;form id= "Set" Name= "Set" style= "Position:absolute;background-color: #036; left:50%;top:50%;margin-left:-125px; Margin-top:-80px;width:250px;padding-top:3px;padding-left:3px;padding-bottom:3px;padding-right:3px;z-index:12; Display:none "&gt;


&lt;div style= "Background-color: #036;p adding-top:1px;padding-left:2px;color:captiontext;font-size:12px;height : 20px "&gt;&lt;b&gt;&amp;nbsp; settings &lt;/b&gt;&lt;/div&gt;


&lt;div&gt;&lt;div style= "background-color:threedface;padding-top:6px;padding-bottom:6px;padding-left:24px" &gt; Crop orientation: &lt;input type= "Radio" Name=inout id=isin hidefocus checked&gt; clipping internal &amp;nbsp;&lt;input type= "Radio" Name=inout ID =isout hidefocus&gt; Crop external &lt;p style= "margin-top:3px;margin-bottom:3px" &gt; Background color: &lt;input type= "Radio" Name=toubai Id=istou value=0 hidefocus checked&gt; Transparent background &amp;nbsp;&lt;input type= "Radio" Name=toubai Id=isbai-value=1 hidefocus&gt; White background &lt;/div&gt;&lt;div style= "BACKGROUND-COLOR:THREEDFACE;PADDING-BOTTOM:8PX;" &gt;&lt;center&gt;&lt;input type= "button" value= "OK" style= "height:22px" onclick= "setting ()" &gt;&amp;nbsp;&amp; Nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;input type= "button" value= "Cancel" style= "height:22px" onclick= " document.getElementById (' Set '). style.display= ' None ' &gt;&lt;/center&gt;&lt;/div&gt;&lt;/div&gt;


&lt;/form&gt;





&lt;div id= "Help" style= "Position:absolute;background-color: #036; Left:50%;top:50%;margin-left:-210px;margin-top: -170px;width:420px;padding-top:3px;padding-left:3px;padding-bottom:3px;padding-right:3px;z-index:12;display: Block "&gt;


&lt;div style= "Background-color: #036;p adding-top:1px;padding-left:2px;color:captiontext;font-size:12px;height : 20px "&gt;&lt;b&gt;&amp;nbsp; operation instructions &lt;/b&gt;&lt;/div&gt;


&nbsp;&nbsp;&lt;div&gt;&lt;div style= "BACKGROUND-COLOR:THREEDFACE;PADDING-TOP:6PX;PADDING-BOTTOM:6PX; padding-left:10px;padding-right:10px "&gt;&lt;center&gt;&lt;font color=red&gt;" mouse operation instructions "&lt;/font&gt;&lt;/center &gt;&lt;p style= "margin-top:6px;margin-bottom:6px" &gt;[1] mouse drag the Crop box to move the location of the cropped area, this operation is suitable for rectangular cutting, round cutting, rounded corners of the rectangular cutting, arc cropping. &lt;p style= "margin-top:4px;margin-bottom:4px" &gt;[2] mouse to drag the border of the crop box to adjust the size of the cropping area, this operation is suitable for rectangular cutting, round cutting, rounded corners of the rectangular cutting, arc cropping. &lt;p style= "margin-top:8px;margin-bottom:8px" &gt;&lt;center&gt;&lt;font color=red&gt; "keyboard Instructions" &lt;/font&gt;&lt;/ Center&gt;&lt;p style= "margin-top:6px;margin-bottom:6px" &gt;[3] Press the ←↑↓→ key to precisely move the location of the cropped area, which is suitable for rectangular cropping, round cropping, rounded corner clipping, and arc cropping. &lt;p style= "margin-top:4px;margin-bottom:4px" &gt;[4] Press the JKLM key to precisely adjust the size of the cropping area, which is suitable for rectangular cropping, round cropping, rounded corner clipping, and arc cropping. &lt;p style= "margin-top:4px;margin-bottom:4px" &gt;[5] press A to reduce the rounded angle of the rounded rectangle, press D to increase the rounded angle of the rounded rectangle, which applies to rounded rectangle cropping. &lt;p style= "margin-top:4px;margin-bottom:4px" &gt;[6] Press the AWSD key to adjust the radian of the arc, which is applicable to arc cropping. &lt;p style= "margin-top:8px;margin-bottom:8px" &gt;&lt;center&gt;&lt;font color=red&gt; "Shift operation Instructions" &lt;/font&gt;&lt;/center&gt;&lt;p style= "margin-top:6px;margin-bottom:6px" &gt;[7] Drag the mouse while pressing the SHIFT key to the width and height of 1:1 to adjust the size of the crop area, this operation is suitable for rectangular cropping, circular cropping, rounded corners of the rectangular cropping. &lt;/div&gt;&lt;div style= "BACKGROUND-COLOR:THREEDFACE;PADDING-BOTTOM:8PX;" &gt;&lt;center&gt;&lt;input type= "button" value= "closes" style= "height:22px" onclick= "document.getElementById" (' Help '). Style.display= ' None ' &gt;&lt;/center&gt;&lt;/div&gt;&lt;/div&gt;


&lt;/div&gt;





&lt;div id= "About" style= "Position:absolute;background-color: #036; left:50%;top:50%;margin-left:-190px;margin-top : -120px;width:380px;padding-top:3px;padding-left:3px;padding-bottom:3px;padding-right:3px;z-index:12;display: None "&gt;


&lt;div style= "Background-color: #036;p adding-top:1px;padding-left:2px;color:captiontext;font-size:12px;height : 20px "&gt;&lt;b&gt;&amp;nbsp; About us &lt;/b&gt;&lt;/div&gt;


&lt;div&gt;&lt;div style= "background-color:threedface;padding-top:8px;padding-bottom:6px;padding-left:10px" &gt; &lt;center&gt;&lt;font color=red&gt; "The purpose of this site" &lt;/font&gt;&lt;/center&gt;&lt;p style= "Margin-top:6px;margin-bottom : 6px "&gt; This station aims at providing the most professional and comprehensive picture cutting service for the majority of netizens. &lt;p style=" margin-top:8px;margin-bottom:8px "&gt;&lt;center&gt;&lt;font Color=red&gt; "Site description" &lt;/font&gt;&lt;/center&gt;&lt;p style= "margin-top:6px;margin-bottom:6px" &gt; This site provides the following services: Picture cropping , photo cutting, rectangular cutting, round cutting, arc cutting, polygon cutting, arbitrary graphics cutting, dynamic picture cropping. &lt;p style= "margin-top:8px;margin-bottom:8px" &gt;&lt;center&gt;&lt; Font color=red&gt; "Contact Us" &lt;/font&gt;&lt;/center&gt;&lt;p style= "margin-top:6px;margin-bottom:6px" &gt; If you have any questions about this site please contact us: service@caijian.cc.&lt;/div&gt;&lt;div style= "BACKGROUND-COLOR:THREEDFACE;PADDING-BOTTOM:8PX;" &gt;&lt;center&gt;&lt;input type= "button" value= "Close" style= "height:22px" onclick= "document.getElementById" (' About ') . style.display= ' None ' "&gt;&lt;/center&gt;&lt;/div&gt;&lt;/div&gt;


&lt;/div&gt;





&lt;div style= "Display:none;" &gt;


&lt;iframe id= "_frame" name= "_frame" &gt;&lt;/iframe&gt;


&lt;/div&gt;





&lt;/div&gt;


&lt;/body&gt;


&lt;/html&gt;

upload.php file


&lt;?php


if (Stripos ($_server["Http_host"], ' caijian.cc ') = = false) exit (0);


if (($_files["ifile" ["type"] = = "Image/gif")


|| ($_files["IFile"] ["type"] = = "Image/jpeg")


|| ($_files["IFile"] ["type"] = = "Image/pjpeg")


|| ($_files["IFile"] ["type"] = = "Image/bmp")


|| ($_files["IFile"] ["type"] = = "Image/png"))


&amp;&amp; ($_files["ifile"] ["size"] &lt; 3000000)


{


if ($_files["ifile"] ["error"] &gt; 0)


{


echo "&lt;script language= ' JavaScript ' &gt;";


echo "Parent.wrong (' Upload picture error, please upload!") ');";


echo "&lt;/script&gt;";


}


Else


{


$filename = "upload/". Date ("Ymdhis", Time ()). Rand (100,999). substr ($_files["ifile"] ["Name"],strrpos ($_files["IFile") "] [" name "], '. '));


Move_uploaded_file ($_files["ifile"] ["Tmp_name"], $filename);





$magick _wand = Newmagickwand ();


Magickreadimage ($magick _wand, $filename);


$w = Magickgetimagewidth ($magick _wand);


$h = Magickgetimageheight ($magick _wand);


$f = Magickgetnumberimages ($magick _wand);





echo "&lt;script language= ' JavaScript ' &gt;";


echo "Parent.upimg". $filename. "',". $_files["IFile"] ["size"]. ", $w, $h, $f);";


echo "&lt;/script&gt;";


}


}


Else


{


echo "&lt;script language= ' JavaScript ' &gt;";


echo "Parent.wrong (' upload photo size must not be larger than 3m! ');";


echo "&lt;/script&gt;";


}


?&gt;

SOURCE Download Address
Http://down.111cn.net/php/2011/0311/22879.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.