Php ImageShackAPI几乎正常工作

Php ImageShackAPI几乎正常工作,php,redirect,asp-classic,imageshack,Php,Redirect,Asp Classic,Imageshack,本教程展示了一种上传到imageshack并获取图像url的好方法,尽管它是用于ASP的,我在PHP中需要它 有什么办法可以做到这一点吗 感谢堆。我刚刚将asp重写为php,不知道它是否工作,但没有测试它,但是如果asp确实工作,那么php也应该工作 index.php <html> <head> <title>AJAX image upload</title> </head> <body> &l

本教程展示了一种上传到imageshack并获取图像url的好方法,尽管它是用于ASP的,我在PHP中需要它

有什么办法可以做到这一点吗


感谢堆。

我刚刚将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>

AJAX图像上传
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>

parent.document.getElementById('yfrog')。innerHTML='';
parent.document.getElementById('link')。innerHTML='';
parent.document.getElementById('image').innerHTML='.imageshack.us/img/“>”;
error.php

<script type="text/javascript">
  alert("There was an error uploading the file.");
</script>

警报(“上载文件时出错。”);

我刚刚将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>

AJAX图像上传
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>

parent.document.getElementById('yfrog')。innerHTML='';
parent.document.getElementById('link')。innerHTML='';
parent.document.getElementById('image').innerHTML='.imageshack.us/img/“>”;
error.php

<script type="text/javascript">
  alert("There was an error uploading the file.");
</script>

警报(“上载文件时出错。”);

谷歌搜索
imageshack API PHP
时显示的工具是否都不适合您?其中一些看起来很有希望。它们看起来确实很有希望,但没有一个能完全满足我的需要(与asp不同)Google
imageshack API PHP
显示的工具是否都不适合你?有些看起来很有希望。它们看起来确实很有希望,但没有一个能完全满足我的需要(不像asp的)。对不起,它似乎不起作用。我得到一个断开的图像图标,没有链接,图像图标指向imageshack()的一个空白点。我只是通过回显success.php中的变量使其工作。谢谢!对不起,它好像不起作用。我得到一个断开的图像图标,没有链接,图像图标指向imageshack()的一个空白点。我只是通过回显success.php中的变量使其工作。谢谢!