0

I use this code to preview my images from directory to web page:

<?php
$username3 = $_SESSION['username3'];
$username1 = $_SESSION['username1'];
    $images2 = glob("web/user/$username3/profile/profile-"."$username1-*.
    {jpg,jpeg,gif,png}",GLOB_BRACE);
    $_SESSION['images2']=$images2;
    if(!empty($images2)){
    foreach($images2 as $image2) {
    echo '<img src="'.$image2.'"/>';}}
    else{
echo '<img src="web/images/user.png">';
    }
 ?>

this code work fine in pc and all android device but when I tested in several iphones, pictures doesn't show and the user.png show instead. I don't know what is wrong with this code or what should I do. path is wrong or something else?

Cœur
  • 37,241
  • 25
  • 195
  • 267
hameds1
  • 49
  • 7
  • Are cookies enabled on your iphone device? Maybe [this question](https://stackoverflow.com/q/12572134/8913537) helps you. – Philipp Maurer Mar 06 '18 at 12:27
  • It looks like `$_SESSION['username1']` is not being maintained. I think @PhilippMaurer is on to something. – MonkeyZeus Mar 06 '18 at 12:28
  • i don't know! i just tested in my friends phone. does cookies disabled as default in iphone devices? and what shold i do for this?! – hameds1 Mar 06 '18 at 12:40

0 Answers0