# Php code question

**URL:** <https://forum.kirupa.com/t/php-code-question/63716>\
**Category:** programming\
**Created:** [September 9, 2004, 12:41pm UTC](https://forum.kirupa.com/t/php-code-question/63716 "2004-09-09T12:41:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ofi](https://avatars.discourse-cdn.com/v4/letter/o/df788c/32.png) [@ofi](https://forum.kirupa.com/u/ofi)\
**Post date:** [September 9, 2004, 12:41pm UTC](https://forum.kirupa.com/t/php-code-question/63716/1 "2004-09-09T12:41:12Z")

</div>

Hi  
I am using photo php code, its working fine, there is one thing i like to edit in the code, but cant find how, i like to disable the images name that appear under the images, see link

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 2:52pm UTC](https://forum.kirupa.com/t/php-code-question/63716/2 "2004-09-09T14:52:42Z")

</div>

I modified your post to make the code readable, next time use

```php
 instead of 

```

😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 4:32pm UTC](https://forum.kirupa.com/t/php-code-question/63716/3 "2004-09-09T16:32:05Z")

</div>

Not read through the code thoroughly yet, but I’m assuming this should do it…

```php
<? 
$curfile = basename(

```

%4$s

```auto
SERVER['PHP_SELF'] ); 
?> 
<html> 
<style> 
<!-- 
body { 
    font-family: Verdana; 
    font-size: 11px; 
    color: #000000; 
} 
table { 
    font-family: Verdana; 
    font-size: 12px; 
    color: #000000; 
} 
a { 
    text-decoration: none; 
    color: darkred; 
} 
--> 
</style> 
<? 
if( !$popup ) 
{ 
?> 
<script language=JavaScript> 
<!-- 
function mynd(album,mynd) 
{ 
    window.open('<?=$curfile?>?sAlbum='+album+'&sPic='+mynd,'myndasafn','status=0,menu=0,toolbar=0 ,scrollbarsl=no,width=10,height=20'); 
    return false; 
} 
--> 
</script> 
<? 
} 
# Vinsamlegast stilltu þetta allt eftir þínum þörfum... 

# Notast við albúm eða ekki; 1 = já. 0 = nei. 
# 0 = Þú setur myndir í myndamöppuna. 
# 1 = Þú setur albúmin í myndamöppuna (albúm = möppur með myndum í) 
$album = 0; 

# Hvort þú viljir að myndin birtist í popup eða ekki; 1 = já. 0 = nei. 
$popup = 1; 

# Mappan sem við geymum allar myndirnar/albúmin í. 
$mappa = 'myndir'; 

# Hve margar myndir í röðinni. 
$cols = 3; 

# Hve margar raðir þangað til það kemur ný blaðsíða. 
$rows = 3; 

# Ekki stilla neitt fyrir neðan þetta. 

if(

```

%4$s

```auto
GET['sAlbum'] ) 
    $heild = $mappa . '/' .

```

%4$s

```auto
GET['sAlbum']; 
else 
    $heild = $mappa; 

if(

```

%4$s

```auto
GET['sPic'] ) 
{ 
    if( $popup ) 
    { 
?> 
<script> 
var isNav4, isIE4; 
if (parseInt(navigator.appVersion.charAt(0)) >= 4) { 
isNav4 = (navigator.appName == "Netscape") ? 1 : 0; 
isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0; 
} 
function fitWindowSize() { 
if (isNav4) { 
window.innerWidth = document.layers[0].document.images[0].width; 
window.innerHeight = document.layers[0].document.images[0].height; 
} 
if (isIE4) { 
window.resizeTo(500, 500); 
width = 500 - (document.body.clientWidth - document.images[0].width); 
height = 500 - (document.body.clientHeight - document.images[0].height); 
window.resizeTo(width, height); 
   } 
   } 
</script> 
<body onload="fitWindowSize()" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"> 
<? 
    } 
    else 
        echo '<div align="center"><a href="' . $curfile . '?sAlbum=' .

```

%4$s

```auto
GET['sAlbum'] . '&sPage=' .

```

%4$s

```auto
GET['sPage'] . '">Aftur í albúm</a></div><br><br>'; 
       
?> 
<div align="center"><img src="<? if( $popup ) echo

```

%4$s

```auto
GET['sAlbum'] . '/' .

```

%4$s

```auto
GET['sPic']; else echo $heild . '/' .

```

%4$s

```auto
GET['sPic']; ?>" border="0" style="border: 1px solid #000000" <? if( $popup ) { ?>onClick="window.close();window.opener.focus()" style="cursor: hand" title="Loka glugga"<? } ?>></div> 
<? 
} 
elseif( !

```

%4$s

```auto
GET['sAlbum'] && $album ) 
{ 
?> 
    <b>Veldu albúm:</b><br><br> 
<? 
    $handle = opendir( $mappa ); 
    while( false !== ( $skra = readdir( $handle ) ) ) 
    { 
        if( $skra != '.' && $skra != '..' && is_dir( $mappa . '/' . $skra ) ) 
        { 
?> 
            <a href="<?=$curfile?>?sAlbum=<?=$skra?>"><?=str_replace( '_', ' ', $skra )?></a><br> 
<? 
        } 
    } 
} 
else 
{ 
    $perpage = $cols * $rows; 
       
    if( !

```

%4$s

```auto
GET['sPage'] ) 
        $sPage = 1; 
    else 
        $sPage =

```

%4$s

```auto
GET['sPage']; 
           
    $begin = ( $sPage * $perpage ) - $perpage; 
    $end = ( $sPage * $perpage ) - 1; 
       
    $handle = opendir( $heild ); 
    while( false !== ( $pic = readdir( $handle ) ) ) 
    { 
        if( $pic != '.' && $pic != '..' && !is_dir( $heild . '/' . $pic ) ) 
            $arrPics[] = $pic; 
    } 
       
    $num = count( $arrPics ); 

    $pages = ceil( $num / $perpage ); 
    if( $pages != 1 ) 
    { 
?> 
        <div align="center"><font size="3"> 
<? 
        for( $i = 1; $i <= $pages; $i++ ) 
        { 
           
            if( $sPage == $i ) 
                echo $i; 
            else 
            { 
?> 
                <a href="<?=$curfile?>?sAlbum=<?=

```

%4$s

```auto
GET['sAlbum']?>&sPage=<?=$i?>" style="text-decoration: none"><u><?=$i?></u></a> 
<? 
            } 
               
            if( $i != $pages ) 
                echo ' '; 
        } 
?> 
        </font></div> 
<? 
    } 
?> 
    <table border="0" cellspacing="3" align="center"> 
    <tr> 
    <td colspan="<?=$cols?>">&nbsp;</td> 
    </tr> 
    <tr> 
<? 
    $i = 0; 
    for( $j = $begin; $j <= $end; $j++ ) 
    { 
?> 
        <td align="center" valign="top"> 
<? 
        if( $arrPics[$j] ) 
        { 
?> 
            <a href="<? if( !$popup ) echo $curfile . '?sAlbum=' .

```

%4$s

```auto
GET['sAlbum'] . '&sPage=' . $sPage . '&sPic=' . $arrPics[$j]; else echo '#' ?>"<? if( $popup ) { ?> onClick="return mynd('<?=$heild?>','<?=$arrPics[$j]?>')"<? } ?>><img src="<?=$heild?>/<?=$arrPics[$j]?>" height="100" border="0" style="border: 1px solid #000000"></a> 
<? 
        } 
?> 
        </td> 
<? 
               
        $i++; 
           
        if( $i == $cols ) 
        { 
?> 
            </tr><tr> 
<? 
            $i = 0; 
        } 
    } 
?> 
    </tr> 
    </table> 
<? 
} 

if( !

```

%4$s

```auto
GET['sPic'] ) 
{ 
?> 
<br><br> 
<? 
} 
?> 
</body> 
</html> 

```

I just removed the

```php
<br><?=$arrPics[$j]?>

```

from the line which looked like it displayed the picture on the page

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 4:52pm UTC](https://forum.kirupa.com/t/php-code-question/63716/4 "2004-09-09T16:52:00Z")

</div>

> [@Digitalosophy](#):
>
> I modified your post to make the code readable, next time use
> 
> ```php
> instead of 
> 
> ```
> 
> 😉

I will, thx for helping, i am learning on this

KaiserSouze, thx it worked fine!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 6:20pm UTC](https://forum.kirupa.com/t/php-code-question/63716/5 "2004-09-09T18:20:56Z")

</div>

How do i add nex and previous in the popup window

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 8:56am UTC](https://forum.kirupa.com/t/php-code-question/63716/6 "2004-09-10T08:56:18Z")

</div>

u mean pagination ? Google Can help u on that one…
