Я просто переписал asp для php, нет подсказки, если он работает, не протестировал его, но если asp работает, то php также должен.
index.php
<html>
<head>
<title>AJAX image upload</title>
</head>
<body>
<form action="http://imageshack.us/redirect_api.php" target="AXframe" method="post" enctype="multipart/form-data">
<input type="file" name="media"/>
<input type="hidden" name="key" value="YOUR_DEVELOPER_KEY">
<input type="hidden" name="error_url" value="http://example.com/error.php">
<input type="hidden" name="success_url" value="http://example.com/success.php?one=%y&two=%u&three=%s&four=%b&five=%i">
<input type="submit"/>
</form>
<iframe style="visibility:hidden" id="AXframe" name="AXframe"></iframe>
<div id="link"></div>
<div id="yfrog"></div>
<div id="image"></div>
</body>
</html>
Success.php
<?php
$str1 = $_GET["one"];
$str2 = $_GET["two"];
$str3 = $_GET["three"];
$str4 = $_GET["four"];
$str5 = $_GET["five"];
?>
<script type="text/javascript">
parent.document.getElementById('yfrog').innerHTML = '<?php echo($str1); ?>';
parent.document.getElementById('link').innerHTML = '<?php echo($str2); ?>';
parent.document.getElementById('image').innerHTML = '<img src="http://img<?php echo($str3); ?>.imageshack.us/img<?php echo($str3); ?>/<?php echo($str4); ?>/<?php echo($str5); ?>">';
</script>
error.php
<script type="text/javascript">
alert("There was an error uploading the file.");
</script>
ли ни один из инструментов, показанных при погуглить 'Imageshack API PHP' работы для вас? Некоторые из них выглядят довольно многообещающими. –
Они выглядят многообещающе, но никто не делает точно то, что мне нужно (в отличие от asp one) –