Well, I was bored tonight and decided to cook this up: http://jpez.sobertillnoon.com/chucknorris.png



As you can see, it generates an image with a random Chuck Norris fact from 4q.cc. I know I'm using it in my signature.
hell yes! Bout time you cooked up something decent jpez Razz

EDIT: You need to parse out html escape sequences ( '"' comes up every now and then)
*laughs* I must say, I'm impressed.
Laughing Nice job, Jon. Finally, something useful comes out of this site. :/
@kllr: Oops, I was using htmlspecialchars instead of htmlentities.

@all: Thanks for the praise. Cool
Cool, but is there any way that you can make it randomize differently for each image on the page. For instance, right now on this page Kllrnohj and You have the same Chuck Norris Phrase. After refreshing a few times (and that staying constant) I assume that the way you have it set up, it's the same for multiple users. I doubt it, but is there any way you could somehow make it show up different for different users?

Still, it looks cool. I'd put it in my sig, but I'm usually not big on following trends...*looks at his current sig*...*shakes head*

Edit: Ahh, I guess that doesn't really make much sense...still, I'm probably just ignorant, but is there a way?
I know exactly what you mean, and I don't know if there is a way. I suspect it's a browser related thing -- once it's loaded chucknorris.png on one page, it sees no reason why it should re-request it. Perhaps if I set the expiration to 0 microseconds in the header or something like that?
jpez wrote:
I know exactly what you mean, and I don't know if there is a way. I suspect it's a browser related thing -- once it's loaded chucknorris.png on one page, it sees no reason why it should re-request it. Perhaps if I set the expiration to 0 microseconds in the header or something like that?
There's no way to fix it, really, other than faking the creation time by your php script. Hmmm, that's not a bad idea... let me find you some more info about it.
I'm pretty sure tat can be set in the headers...
Yeah, I'm relatively sure you're right about that. Go for it.
I think it is the fact that you both link to the same image. Now, if you had about 4 or 5 different images you could link to for the same script, you might get different results.
But if the browser sees that the image it just loaded has expired, it will reload it on the same page, yielding a different result.
Does that mean it will differ not only between different users, but between ever instance of it on the page? I like that idea.
Chipmaster wrote:
Does that mean it will differ not only between different users, but between ever instance of it on the page? I like that idea.
It *should* be different for every instance on the page.
Bingo, chip. (I think.)


^Random fact from Gullible.info^

Ok, setting the expiration date stuff didn't work. Sorry, but I just don't think there's a way it can be done. Sad
jpez wrote:


^Random fact from Gullible.info^

Ok, setting the expiration date stuff didn't work. Sorry, but I just don't think there's a way it can be done. Sad
You've still got the " problem... :S
Some of these sigs are good actually, especially the one with the reference to the Johnny Cash song.
Can't you just have something like this?

chuck.png (htaccess) -> random.php (redirect) -> ./chuckfolder/chuck-randomMD5hash.png (htaccess) -> quotegen.php

Then it will have loaded seperately named images, no? (while all start at chuck.png, the actual filenamed cached would be the chuck-randomMD5hash, hence the browser will reattempt to get chuck.png every time it comes across it, yielding a differently named PNG image)
Sounds logical, Captain. Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement