TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 09:49:05 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 112
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 41
  • Total: 41

[Block] Random Image Rotator [PHP]

Started by akulion, May 03, 2006, 02:09:08 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

JPDeni

Probably. If you're using the code from the first post in this topic, you'd have to alter the rotate.php file, which I haven't looked at, so I couldn't tell you what to change. If you're using some other code, please post it.

Eddy Matthews

Quote from: JPDeni on May 10, 2009, 11:19:04 PM
Probably. If you're using the code from the first post in this topic, you'd have to alter the rotate.php file, which I haven't looked at, so I couldn't tell you what to change. If you're using some other code, please post it.

I'm using the code from the first post, but my knowledge of php coding is none-existant, so any help would be appreciated.

Regards
Eddy

JPDeni

Actually, I can't see how you could use that script and print out the name of the file. There's really no place to do it.

IchBin

It would seem the file sends all the info to the output buffer. Which I'll admit that I don't know anything about. lol However, I don't see any reason why we can't try something. :D At the end of the file you'll see this code.
if ($img!=null) {
$imageInfo = pathinfo($img);
$contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
header ($contentType);
readfile($img);


Right after the readfile() line, lets add an echo and see if we can get it to output the filename.

echo $imageinfo['basename'];

Haven't tested it myself, but I do know how pathinfo works, so I'm hoping that will output the filename. Let me know if it works for you.

JPDeni

The problem is that there's no echo in the script at all. If it just would echo the img src tag, then echoing the name of the file, too would be a piece of cake. (I really hate external php files anyway. Really hate them a whole lot. But that's my problem. :) )