Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in C:xampphtdocsfetch.php

<?php

$url = 'http://www.abc.in/abc/img/';
$base = 'http://www.abc.in/';

// Pull in the external HTML contents
$contents = file_get_contents( $url );

// Use Regular Expressions to match all <img src="???" />
preg_match_all( '/<img[^>]*src=["|'](.*)["|']/Ui', $contents, $out, PREG_PATTERN_ORDER);

foreach ( $out[1] as $k=>$v ){ // Step through all SRC's

    // Prepend the URL with the $base URL (if needed)
    if ( strpos( $v, 'http://' ) !== true ) $v = $base . $v;

    // Output a link to the URL
    echo '<a href="' . $v . '">' . $v . '</a><br/>';
}



error msg

Warning: file_get_contents(http://www.abc.in/abc/img/): Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in C:xampphtdocsfetch.php on line 9

  1. my remote server is godaddy
  2. allow_url_fopen On
  3. full control access given to directory

display list of files in a directory in a remote server