variable in include file
am 12.11.2007 08:52:08 von Pasi Mustalaht
PTM: My web page includes a file containing lines like this:
Do.gif |
The result is a page, where the there is name of the file under a thumb,
which can be clicked and produces a view of the original picture. like in
http://ptm2.cc.utu.fi/~ptmusta/kuvat/paloma/
is there any way to set this file name 'Do.gif' as an variable and make
the browser use it in the lines ?
The best thing would be, if I could include a file with only the names
and make the browser build the lines.
Re: variable in include file
am 12.11.2007 11:12:35 von Andy Dingley
On 12 Nov, 07:52, PTM wrote:
> is there any way to set this file name 'Do.gif' as an variable and make
> the browser use it in the lines ?
Not (practically) by includes, but this would be trivial for any
server-side scripting language. It's time for you to move up to the
next level of complexity as a developer!
PHP is a popular choice for beginners, as it works well enough, it's
easy enough to learn, and it's supported for free by many hosts.
Re: variable in include file
am 12.11.2007 12:14:39 von Pasi Mustalaht
Andy Dingley wrote:
> On 12 Nov, 07:52, PTM wrote:
>
>> is there any way to set this file name 'Do.gif' as an variable and make
>> the browser use it in the lines ?
>
> Not (practically) by includes, but this would be trivial for any
> server-side scripting language. It's time for you to move up to the
> next level of complexity as a developer!
>
> PHP is a popular choice for beginners, as it works well enough, it's
> easy enough to learn, and it's supported for free by many hosts.
>
PTM: Thanks.
The code pieces I pasted in my previous mail were generated by a Perl
script I have generated. I have two version of this 'Album' system. The
smaller 'viewer' containing just one script and one shtml page. The
larger contains abt. 10 scripts and abt. the same quantity of web pages.
The larger system contains more than 1500 lines of code and is handling
about 10000 pictures. Some pages are static and some are generated by
the scripts when needed.
I think I have reached a kind of status there.
Still there is a lot to learn.
Personally I haven't given much notice for PHP. I like Perl more and
have used JavaScript a little. Now I have found, that these are not
enough. I got to take more tools in my hands.
Still I'm looking for ways to generate pages, which can handle data read
from config files.
Re: variable in include file
am 12.11.2007 14:07:36 von Andy Dingley
On 12 Nov, 11:14, PTM wrote:
> Personally I haven't given much notice for PHP. I like Perl more and
> have used JavaScript a little.
If you like Perl already, give Python a try. It works for web back-
ends (although not so easy to find hosting for) and it's a much better
language than either Perl or Python.
Re: variable in include file
am 12.11.2007 22:16:25 von Pasi Mustalaht
>>Personally I haven't given much notice for PHP. I like Perl more and
>>have used JavaScript a little.
>
> If you like Perl already, give Python a try. It works for web back-
> ends (although not so easy to find hosting for) and it's a much better
> language than either Perl or Python.
>
PTM: I'll give it a try even though I don't understand what a new
language might give to me :)
I think I have tried or used about any programming language there has
been, beginning with Basic in VIC-20.
BTW. I visited http://docs.python.org.
Most of the material in the Python pages seems to be written by people,
who are accustomed to be paid in $/word.
Re: variable in include file
am 12.11.2007 22:57:09 von Andy Dingley
On Mon, 12 Nov 2007 23:16:25 +0200, PTM wrote:
>Most of the material in the Python pages seems to be written by people,
>who are accustomed to be paid in $/word.
I liked the Beazley book. If you already know "programming", it teaches
the language alone pretty well. It also works as a reference afterwards.
I'm not a fan of on-line tutorials. I just prefer books.
Re: variable in include file
am 16.11.2007 21:55:36 von Pasi Mustalaht
Andy Dingley wrote:
> On 12 Nov, 11:14, PTM wrote:
> If you like Perl already, give Python a try.
PTM: I didn't go to Python this time. I found a solution to my problem.
Thanks to you. You made me think the problem from another direction. I
threw the original code out and wrote a new Perl code which generates
all the needed pages without building include files. I got rid of the
configuration- and temporary data files.
In a matter of fact I now have a distributable packet with only one Perl
script, one shtml -file and the documentation. The next step is to make
the script generate the web page in the installation.
Thanks