[Javascript] Javascript to change include filename
tedd
tedd at sperling.com
Thu Jan 22 15:50:31 CST 2009
At 8:46 AM -0600 1/22/09, Del Wegener wrote:
>----- Original Message ----- From: "tedd" <tedd at sperling.com>
>>Del:
>>
>>For you to use server-side includes like that, then the suffix for
>>your file should be ".shtml". Change it to ".php" and try this:
>>
>> <div id="blendme">
>> <?php $n=rand(1,15); include('pic' . $n . '.txt'); ?>
>> </div>
>>
>>If you need any further help, just ask.
>>
>>Cheers,
>>
>>tedd
--- and
>
>Tedd:
>That looks like a perfect solution. I won't have time until the
>weekend to try it, but I do have a question.
>I use other includes (like header.txt and footer.txt) and therefore
>should use the suffix .shmtl.
>
>If I look in my PHP books will I find a way of "including" those
>other files when the suffix is .php?
>
>I can probably avoid those other includes, but would rather not.
>
>Aside: If the above is typical of PHP, I really need to get busy to learn it.
>
>Thanks again
>Del
Del:
I brought this discussion back to this list so that others may benefit.
All your questions will be answered IF you fully follow my write-up here:
http://sperling.com/examples/include-demo/
Welcome to the wonderful world of includes -- your world is about to change.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
More information about the Javascript
mailing list