sc_image_upload.php

来自「Here is the DHTML tree example with full」· PHP 代码 · 共 63 行

PHP
63
字号
<?php

	include('sc_config.inc.php');

	$id = @$_POST['id'];
	$folder = @$_POST['folder'];
	$image_action = @$_POST['image_action'];

	$picture = @$_FILES['image']['tmp_name'];
	if (!$picture) $picture = @$HTTP_POST_FILES['image']['tmp_name'];


	require_once('class/class.dynaimage.php');

	$pict = new dynaimage($id, $folder, 0, $parent_folder);

	// update an existing picture
	if ($image_action) {

		switch ($image_action) {
			case 'delete':
				$pict->delete($pict->file());
				break;
			case 'update':
				$pict->upload($picture);
				break;
			default:
				break;
		}

	} else { // upload new picture
		$pict->upload($picture);
	}

?><html>
<head>

<script language="JavaScript">

// update cell
//function end_upload() {

var parent_win = window.parent;
var cell_obj = parent_win.document.getElementById('<?php echo @$_POST['sc_cell']; ?>');
var sc_obj = parent_win.SmartCells.get_cell(cell_obj);
//alert(parent_win + ' => ' + cell_obj + ' => ' + sc_obj);

	sc_obj.show_value();

//alert('<?php echo @$_POST['sc_cell']; ?>');
//alert(sc_obj);
//alert(window.parent.location + ' => ' + window.location);

//}

</script>

</head>
<body style="background:#FFFFFF">


</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?