我想返回其中的链接<img>。我不知道这是什么问题。
categoria.php
<HTML>....
<img src="categoriaMAIN.php?type=celular">
</HTML>
Run Code Online (Sandbox Code Playgroud)
categoriaMAIN.php
<?php
$varcate= $_GET['type'];
if ($varcate == "celular")
echo "http://ecx.images-amazon.com/images/I/41l1yyZuyXL._AA160_.jpg";
?>
Run Code Online (Sandbox Code Playgroud)
categoriaMAIN.php
<?php
switch ($_GET['type'])
{
case 'celular':
header('Location: http://ecx.images-amazon.com/images/I/41l1yyZuyXL._AA160_.jpg');
break;
case '...':
header('Location: http://somesite.com/some/img/path/image.jpg');
break;
//...
}
Run Code Online (Sandbox Code Playgroud)
其他所有人似乎都提供了readfile / grab并转发了content方法。我以为我会让HTTP协议为我们完成这项工作。