Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #18082

Re: Show picture in window

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: Show picture in window
Date 2019-10-19 20:39 +0200
Message-ID <h113jbFmtatU1@mid.individual.net> (permalink)
References <qoe4nd$jla$1@news2.open-news-network.org>

Show all headers | View raw


Heiko Wetteborn:

> (sorry for german language)
> Hallo Leute,
> 
> ist de.comp.lang.php tot?

It doesn't matter, if de.comp.lang.php is "dead" or not. This is still
an English speaking newsgroup.

[...]
> Hier nun das Script (PHP 5.4):

PHP 5.4 is *way* outdated! You should use at least PHP 7.1 and even this
version will be end of life this year. So better start at least with PHP
7.2.

Also see: <https://www.php.net/supported-versions.php>

> <?PHP
> include("function.php");

What is in function.php?

> $bildnr=$_GET['bildnr'];
> $dir= documentroot() . "/fotoalbum/*.jpg";

What does documentroot() return?

> foreach (glob($dir) as $filename)
> {
>     $eintraege[] = $filename;
> }
> $picname = $eintraege[$bildnr - 1];
> if (file_exists($picname))
> {
>     Header ("Content-type: image/jpeg");

header() and not Header() - also see:

https://www.php.net/manual/en/function.header.php

You should also get familiar with a PHP debugger like xdebug and an
editor which suports debugging.

-- 
Arno Welzel
https://arnowelzel.de

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Show picture in window Heiko Wetteborn <heiko2912@gmail.com> - 2019-10-19 06:50 +0200
  Re: Show picture in window "J.O. Aho" <user@example.net> - 2019-10-19 10:00 +0200
  Re: Show picture in window Jan Hansen <jhjjhjhhansen@gmail.com> - 2019-10-19 10:50 +0200
  Re: Show picture in window Arno Welzel <usenet@arnowelzel.de> - 2019-10-19 20:39 +0200
    Re: Show picture in window kristjanise129@gmail.com - 2020-03-13 09:46 -0700
      Re: Show picture in window Arno Welzel <usenet@arnowelzel.de> - 2020-03-14 13:11 +0100
  Re: Show picture in window R i c h m a n <he12091983@gmail.com> - 2022-10-25 03:09 -0700

csiph-web