bux.tombulka27
New Member
- Messages
- 3
- Reaction score
- 0
- Points
- 0
Hello everyone.
I am trying to run following php script:
It works perfectly on my localhost server, but when i tried to run it on x10hosting account it shows "Could not get image" which means that file_get_contents don`t work well. What am I doing wrong?
Thanks for help!
I am trying to run following php script:
PHP:
$date = date('H i d m Y');
$date = str_replace(" ", "_", $date);
$image = file_get_contents('http://82.177.67.40:65530/test/stok.jpg') or die('Could not get image');
$create = fopen("storage/$dateYear/$dateMonth/$dateDay/stok_$date.jpg", 'w+') or die('Could not create file');
echo '<br />saved stok_'.$date.'.jpg';
fputs($create, $image) or die('Could not save to file');
fclose($create);
unset($image);
Thanks for help!