<form enctype="multipart/form-data" action="http://sjpg.ru/remoteupload.php" method="post" />
Image:
<input name="Image" type="file" size="85" > <input type="submit" value="Upload" />
<input type="hidden" name="maxwidth" value=" 600 " />
<input type="hidden" name="maxheight" value=" 700 " />
<input type="hidden" name="quality" value=" 70 " />
<input type="hidden" name="destination" value=" sjpg.ru/upload.php " />
<input type="hidden" name="redirecturl" value=" ya.ru " />
</form>
<?php
if(isset($_FILES['Image'])&&isset($_POST['imageId'])){
move_uploaded_file($_FILES['Image']['tmp_name'], "images/".intval($_POST['imageId']).".jpg");
}
else{
session_start();
if(isset($_SESSION['imageId'])) {
echo '<img src="/images/'.$_SESSION['imageId'].'.jpg" />';
}
else {
$_SESSION['imageId']= rand();
?>
<form enctype="multipart/form-data" action="http://sjpg.ru/remoteupload.php" method="post" />
Image:
<input name="Image" type="file" size="85" > <input type="submit" value="Upload" />
<input type="hidden" name="maxwidth" value=" 120 " />
<input type="hidden" name="maxheight" value=" 120 " />
<input type="hidden" name="quality" value=" 85 " />
<input type="hidden" name="destination" value=" yourdomain.domain/test.php " />
<input type="hidden" name="redirecturl" value=" yourdomain.domain/test.php " />
<input type="hidden" name="imageId" value="<?php echo $_SESSION['imageId']; ?>" />
</form>
<?php
}
}
?>
Source: https://habr.com/ru/post/47558/
All Articles