Código PHP:
<html>
<head>
<script>
function dragNdrop(e) {
var obj = e.target;
obj.style.position = "relative";
izq = obj.style.left;
arr = obj.style.top;
corx = e.clientX;
cory = e.clientY;
document.onmousemove = movimiento;
}
function movimiento(e) {
var obj = document.getElementById("imagen");
obj.style.left = izq+e.clientX-corx;
obj.style.top = arr+e.clientY-cory;
e.preventDefault();
}
function dragNdropQuit() {
document.removeEventListener("mousedown",dragNdrop,false);
document.removeEventListener("mouseup",dragNdropQuit,false);
}
document.onmousedown = dragNdrop;
document.onmouseup = dragNdropQuit;
</script>
</head>
<body>
<img src="smiley.gif" id="imagen" />
</body>
</html>