473,383 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

i cant get an answer

I have come across the strangest thing..I hope someone in here can help
me understand whats up.

i have a php image http://sigs.hopto.org/sigs/mysig/sig51.php
which looks like this

<?
$colort="000000000";
$sizet="20";
$fontt="arial.ttf";
$rightt="200";
$downt="50";
$rotatet="0";
$addliner='1 random 1
2 random 2
3 random 3
4 random 4';
$colorr="000000000";
$sizer="20";
$fontr="BNKGOTHL.TTF";
$rightr="20";
$downr="50";
$rotater="0";
$back1="frame_orange.png";
include("../thepic.php");
?>

and the pic.php is

<?
Header( "Content-type: image/png");
$time = strftime("%I:%M", time());

$liner = split("\n", $addliner );
$p = rand(0,(count($liner)-1));
$addliner = $liner[$p];

$image = imagecreatefrompng('backs/'.$back1);

$colorrr = substr($colorr,0,3);
$colorrg = substr($colorr,3,3);
$colorrb = substr($colorr,-3,3);
$colorr = ImageColorAllocate($image,$colorrr,$colorrg,$color rb);

$colortr = substr($colort,0,3);
$colortg = substr($colort,3,3);
$colortb = substr($colort,-3,3);
$colort = ImageColorAllocate($image,$colortr,$colortg,$color tb);

ImageTTFText ($image,$sizer, $rotater, $rightr, $downr,$colorr,
'fonts/'.$fontr,$addliner);
ImageTTFText ($image,$sizet, $rotatet, $rightt, $downt,
$colort,'fonts/'.$fontt,$time);
Imagepng($image);
ImageDestroy($image);
?>

someone please tell me why this image can be viewed fine on ie and work
perfect showing a random line each time you view it

but in Opera or Mozilla the time updates fine (so we know it's
refreshing) but the random line doesnt change much, if at all...)

go to the link above ...it doesnt make sense....

Jul 17 '05 #1
12 2024
"jtc970" <me@hme.com> wrote in message
news:MP************************@netnews.comcast.ne t...
I have come across the strangest thing..I hope someone in here can help
me understand whats up.

i have a php image http://sigs.hopto.org/sigs/mysig/sig51.php
which looks like this

(snip)


so, let me get this straight, it is chaning correct?

hmm, it should not be a browser problem, btw, it was on 1 or 4 for me for
quit a long time. (IE 6.026)


--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #2
In article <B_*****************@newssvr29.news.prodigy.com> ,
me@scantek.hotmail.com says...
"jtc970" <me@hme.com> wrote in message
news:MP************************@netnews.comcast.ne t...
I have come across the strangest thing..I hope someone in here can help
me understand whats up.

i have a php image http://sigs.hopto.org/sigs/mysig/sig51.php
which looks like this

(snip)


so, let me get this straight, it is chaning correct?

hmm, it should not be a browser problem, btw, it was on 1 or 4 for me for
quit a long time. (IE 6.026)


--
Mike Bradley
http://www.gzentools.com -- free online php tools

the time changes in all browsers but the random line only changes in IE
not Mozilla or Opera.
Jul 17 '05 #3
jn

"jtc970" <me@hme.com> wrote in message
news:MP************************@netnews.comcast.ne t...
In article <B_*****************@newssvr29.news.prodigy.com> ,
me@scantek.hotmail.com says...
"jtc970" <me@hme.com> wrote in message
news:MP************************@netnews.comcast.ne t...
I have come across the strangest thing..I hope someone in here can help me understand whats up.

i have a php image http://sigs.hopto.org/sigs/mysig/sig51.php
which looks like this

(snip)


so, let me get this straight, it is chaning correct?

hmm, it should not be a browser problem, btw, it was on 1 or 4 for me for quit a long time. (IE 6.026)


--
Mike Bradley
http://www.gzentools.com -- free online php tools

the time changes in all browsers but the random line only changes in IE
not Mozilla or Opera.


Maybe send a header that tells it not to cache the image?
Jul 17 '05 #4
On Sun, 01 Feb 2004 11:40:22 +0000, jn wrote:
Maybe send a header that tells it not to cache the image?


That doesn't make sense if the time is changing. the time changing means
the image is changing means the cached image is being replaced.

It is a weird problem, no doubt.

--
-------------------------
| Jeffrey Silverman |
| jeffrey-AT-jhu-DOT-edu|
-------------------------

Jul 17 '05 #5
On Sun, 01 Feb 2004 06:11:52 +0000, jtc970 wrote:
I have come across the strangest thing..I hope someone in here can help me
understand whats up.

i have a php image http://sigs.hopto.org/sigs/mysig/sig51.php which looks
like this

<?
$colort="000000000";
$sizet="20";
$fontt="arial.ttf";
$rightt="200";
$downt="50";
$rotatet="0";
$addliner='1 random 1
2 random 2
3 random 3
4 random 4';
$colorr="000000000";
$sizer="20";
$fontr="BNKGOTHL.TTF";
$rightr="20";
$downr="50";
$rotater="0";
$back1="frame_orange.png";
include("../thepic.php");
?>

and the pic.php is

<?
Header( "Content-type: image/png");
$time = strftime("%I:%M", time());

$liner = split("\n", $addliner );
$p = rand(0,(count($liner)-1));
$addliner = $liner[$p];

$image = imagecreatefrompng('backs/'.$back1);

$colorrr = substr($colorr,0,3);
$colorrg = substr($colorr,3,3);
$colorrb = substr($colorr,-3,3);
$colorr = ImageColorAllocate($image,$colorrr,$colorrg,$color rb);

$colortr = substr($colort,0,3);
$colortg = substr($colort,3,3);
$colortb = substr($colort,-3,3);
$colort = ImageColorAllocate($image,$colortr,$colortg,$color tb);

ImageTTFText ($image,$sizer, $rotater, $rightr, $downr,$colorr,
'fonts/'.$fontr,$addliner);
ImageTTFText ($image,$sizet, $rotatet, $rightt, $downt,
$colort,'fonts/'.$fontt,$time);
Imagepng($image);
ImageDestroy($image);
?>

someone please tell me why this image can be viewed fine on ie and work
perfect showing a random line each time you view it

but in Opera or Mozilla the time updates fine (so we know it's refreshing)
but the random line doesnt change much, if at all...)

go to the link above ...it doesnt make sense....


I don't really know why the image changes only in IE, but I do have a
couple of coding-clean-up-and-simplifcation suggestions for you.

1) Why not put the "1 random 1" etc. text directly into an array instead
of splitting the string?

2) Be sure to initialize the random number generator!!! (Ooops... I just
checked on that and you don't need to do that unless you are using PHP
version eearlier than 4.2)

Well, that's about it. Putting the items directly in the array is the big
thing here.

Also, there is a PHP function called "shuffle()" which will randomize the
order of the array. You can then pop the first item off like so:

shuffle($liner);
$addliner = array_pop($liner);

Its just a bit cleaner, code-wise. But not necessarily better or faster
than the way you did it.

later...

--
-------------------------
| Jeffrey Silverman |
| jeffrey-AT-jhu-DOT-edu|
-------------------------

Jul 17 '05 #6
the lines originally get entered from a multiline textbox from a form so
I cant just enter them straight in.
I tried to shuffle() but the same thing happens
I hope someone comes and says
you idiot.....this is your prob..
Jul 17 '05 #7
In article <MP************************@netnews.comcast.net> , me@hme.com
says...
the lines originally get entered from a multiline textbox from a form so
I cant just enter them straight in.
I tried to shuffle() but the same thing happens
I hope someone comes and says
you idiot.....this is your prob..

I added (which i shouldnt have to, having the latest php)

function make_seed() {
list($usec, $sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());

and it works better but still not good
except in IE all is fine...
now that its working,somewhat, I still want to know WTF?!
Jul 17 '05 #8
On Sun, 01 Feb 2004 16:12:28 +0000, jtc970 wrote:
In article <MP************************@netnews.comcast.net> , me@hme.com
says...
the lines originally get entered from a multiline textbox from a form so
I cant just enter them straight in.
I tried to shuffle() but the same thing happens I hope someone comes
and says
you idiot.....this is your prob..

I added (which i shouldnt have to, having the latest php)

function make_seed() {
list($usec, $sec) = explode(' ', microtime()); return (float) $sec +
((float) $usec * 100000);
}
srand(make_seed());

and it works better but still not good except in IE all is fine...
now that its working,somewhat, I still want to know WTF?!


Its funny, but an hour ago or so when I first tried it (I use Mozilla on
Linux) it was not changing except the time.

Now, it changes fine, and apparently randomly, as you wanted it to.

Not sure what the prob;lem was.

later...
--
-------------------------
| Jeffrey Silverman |
| jeffrey-AT-jhu-DOT-edu|
-------------------------

Jul 17 '05 #9
In article <pa****************************@jhu.edu>, je*****@jhu.edu
says...
On Sun, 01 Feb 2004 16:12:28 +0000, jtc970 wrote:
In article <MP************************@netnews.comcast.net> , me@hme.com
says...
the lines originally get entered from a multiline textbox from a form so
I cant just enter them straight in.
I tried to shuffle() but the same thing happens I hope someone comes
and says
you idiot.....this is your prob..

I added (which i shouldnt have to, having the latest php)

function make_seed() {
list($usec, $sec) = explode(' ', microtime()); return (float) $sec +
((float) $usec * 100000);
}
srand(make_seed());

and it works better but still not good except in IE all is fine...
now that its working,somewhat, I still want to know WTF?!


Its funny, but an hour ago or so when I first tried it (I use Mozilla on
Linux) it was not changing except the time.

Now, it changes fine, and apparently randomly, as you wanted it to.

Not sure what the prob;lem was.

later...

anyone who can figure this out?
Jul 17 '05 #10
jtc970 wrote:
In article <pa****************************@jhu.edu>, je*****@jhu.edu
says...
On Sun, 01 Feb 2004 16:12:28 +0000, jtc970 wrote:

In article <MP************************@netnews.comcast.net> , me@hme.com
says...

the lines originally get entered from a multiline textbox from a form so
I cant just enter them straight in.
I tried to shuffle() but the same thing happens I hope someone comes
and says
you idiot.....this is your prob..
I added (which i shouldnt have to, having the latest php)

function make_seed() {
list($usec, $sec) = explode(' ', microtime()); return (float) $sec +
((float) $usec * 100000);
}
srand(make_seed());

and it works better but still not good except in IE all is fine...
now that its working,somewhat, I still want to know WTF?!


Its funny, but an hour ago or so when I first tried it (I use Mozilla on
Linux) it was not changing except the time.

Now, it changes fine, and apparently randomly, as you wanted it to.

Not sure what the prob;lem was.

later...


anyone who can figure this out?

I'm getting "The image "http://sigs.hopto.org/sigs/mysig/sig51.php"
cannot be displayed, because it contains errors." with Mozilla 1.6.

IE 6.0 just doesn't display it.

I'm wondering if you aren't altering the version you have at that URL.
If that's the case, I'd like to point out that it's hard to test a
moving target. =)

- Dan
Jul 17 '05 #11
jtc970 wrote:
I have come across the strangest thing..I hope someone in here can help
me understand whats up.

i have a php image http://sigs.hopto.org/sigs/mysig/sig51.php
which looks like this
/snip
$fontr="BNKGOTHL.TTF";


http://sigs.hopto.org/sigs/mysig/fonts/BNKGOTHL.TTF = 404

The font you have designated for "$fontr" is not in the fonts directory.
If you change $fontr to "arial.ttf", or copy BNKGOTHL.TTF into the
fonts directory it'll work, I betcha.

- Dan
http://blog.dantripp.com/
Jul 17 '05 #12
In article <l%*******************@newssvr25.news.prodigy.com> ,
th*******@MyEMailAddress.com says...
jtc970 wrote:
I have come across the strangest thing..I hope someone in here can help
me understand whats up.

i have a php image http://sigs.hopto.org/sigs/mysig/sig51.php
which looks like this

/snip
$fontr="BNKGOTHL.TTF";


http://sigs.hopto.org/sigs/mysig/fonts/BNKGOTHL.TTF = 404

The font you have designated for "$fontr" is not in the fonts directory.
If you change $fontr to "arial.ttf", or copy BNKGOTHL.TTF into the
fonts directory it'll work, I betcha.

- Dan
http://blog.dantripp.com/

yes, i moved the font...sorry
but the original problem was that the rand line only worked in
IE...while the time worked in all browsers...
I had to srand a seed to get the random to work in mozilla or Opera
I have the latest php which says i dont have to do that. plus why would
it work in IE if I did ....
I'll change it back to the original posted code so u all can see it
working in IE and not anything else.
Jul 17 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Fozya | last post by:
Hi, I have problems compiling some code that perfectly runs in VS.Net in the G++. Here is what I got: MyClass a; MyClass b; //assign values to a and b .......
14
by: ambar.shome | last post by:
Hi, As you know there are few operators in C++ which cant be overloaded. They are: .., .*, ::, ?: , new , delete , sizeof , typeid , static_casr , dynamic_cast , const_cast ,...
0
by: Tony Lewis | last post by:
I'm running IIS on a Windows 2k server and have just installed the .NET framework 1.1 so I can deploy ASP.NET applications on my server through .NET Studios. All my normal ASP applications run fine...
12
by: Crirus | last post by:
Hi! I havea control that display messages... I added a timer to it Every time a noew mesaage should be displayed I do the following: Private sub ShowMsg(message as string) Me.lblStatus.Text...
6
by: mike11d11 | last post by:
I cant seem to filter down my dataset table by criteria in expression. Can someone tell me why I still have the same amount of rows after I use this filter select option. Private Sub...
4
by: Beemer Biker | last post by:
I am adding at bindtime an htmlbutton and an html dropdownlist. The idea is to select the item in the list, hit the button and my callback code uses the ID.selectedindex to act on the item that...
0
by: skybabyblues | last post by:
ok i cant install my zune software on my computer and i know someone already posted something about it but it didn't answer my question. ive tried installing it from the internet and also with a disc...
0
by: VELA | last post by:
I INSTALLED ORACLE 9i in lenovo3000 c100 in window xp home there is a problem of connection database and the error is "ORA 12560 TNS:protocol adaptor error" if anyone have tha answer for the...
0
Sakalicek
by: Sakalicek | last post by:
Hello all, I have serious problem and have no idea how to solve it, of course :) I have Web Service which has master page. This side is the client side. On master page there are some submit...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.