Hi guys,
I need to integrate some PHP code into my templates. I need to define some variables in the beginning of the template and then apply these variables throughout the template. The problem is that when you close the [PHP] or open new one, I'm not sure - the value of the variable is lost.
Does anyone have any tips on how to avoid this?
Thanks in advance!
[PHP] Question
can you use:
[PHP]include ();[/PHP] ?
and then place the code in a new php file...?
[PHP]include ();[/PHP] ?
and then place the code in a new php file...?
http://www.studmed.dk Portal for doctors and medical students in Denmark
Hi Frold, thanks for your quick reply.
Unfortunately this won't work. Here is what I have.
In the beginning of the template I generate a random number from 1 to 3
Then in 2 different places I have to use the generated random number to display an image from 1.gif to 3.gif and in the second place include an HTML file from 1.html to 3.html
Thank you!
Unfortunately this won't work. Here is what I have.
In the beginning of the template I generate a random number from 1 to 3
Code: Select all
$option = rand(1,3)
Thank you!
Random + Image = ...
Save your 1..3.gif in an folder "1to3" and ready... (I hope)
![Question :?:](./images/smilies/icon_question.gif)
Whats with RT {RANDOM:picture/1to3} using in your templates?d-lexy wrote: Then in 2 different places I have to use the generated random number to display an image from 1.gif to 3.gif and in the second place include an HTML file from 1.html to 3.html
Save your 1..3.gif in an folder "1to3" and ready... (I hope)
Erfahrung ist das, was man besitzt, kurz nach dem es gebraucht wurde.
Warning: I have no foggiest idea of English/German, but I do
-ha{p}{p}y day/night/dia/noche-
Warning: I have no foggiest idea of English/German, but I do
-ha{p}{p}y day/night/dia/noche-
This won't work unfortunatelly, because I also have to include a random HTML file that corresponds to the random loaded image. So lets say random image is 2.gif then the include file has to be 2.htmlNeelix wrote:Random + Image = ...![]()
Whats with RT {RANDOM:picture/1to3} using in your templates?d-lexy wrote: Then in 2 different places I have to use the generated random number to display an image from 1.gif to 3.gif and in the second place include an HTML file from 1.html to 3.html
Save your 1..3.gif in an folder "1to3" and ready... (I hope)
Using sessions like cwenet recommended seems to make the most sence.
Thank you all for your input!