0
    $code="524";
    $filepath="/assets/$code/";
    $file="";
    if(@fopen($path,"r")){

        // code
// replace function here (ill do this)

    }

echo '<a href="link.php?go=$file">your colour is: </a>';
  • /资产/542
  • /assets/542_blush/
  • /assets/542_blush/542_blush.jpg

目前,代码总是 3 位数,它总是有一个只有下划线和颜色的子文件夹,然后在那个文件中。

4

1 回答 1

3

PHP有一个file_exists()功能;

if ( file_exists( '/assets/' . $code . '_blush/' . $code . '_blush.jpg' ) ) {
    // ...
}
于 2011-10-12T11:27:13.037 回答