On Mon, 2003-06-30 at 13:57, Stephen wrote: > Thank you for this method. I just have a few questions. > > 1. How could javascript reload the image? I'm not 100% familiar with > JavaScript really...
Set a timeout to x seconds (where x is the time you want to wait between checks--say one or two seconds). When the timeout occurs cause the image to reload by changing its src attribute (even to the same URL, of course). > 2. How could I use PHP to find the width of the image? I was reading up on > image manipulation last night but only got as far as creating an image. You don't need PHP to check the width of the image. PHP *generates* the image of a given width based on whether new data is available or not. On the frontend, you can set the onload event of the image to fire a function of your choosing when the image is reloaded, where you check its dimensions and act accordingly. Once you've done that, you reset your timer, and the cycle starts over. Cheers, Marco -- php|architect -- The Magazine for PHP Professionals Get your free copy today at http://www.phparch.com! > > With bubblegum in my shoe, > Stephen Craton > Senior Executive Web Developer > Mophus.com, Inc. > > > ----- Original Message ----- > From: "Marco Tabini" <[EMAIL PROTECTED]> > To: "Stephen" <[EMAIL PROTECTED]> > Cc: "Jay Blanchard" <[EMAIL PROTECTED]>; "PHP List" > <[EMAIL PROTECTED]> > Sent: Monday, June 30, 2003 12:52 PM > Subject: Re: [PHP] Refreshing > > > Try using Javascript to reload an image instead of an HTML file. Images > don't click, and you can check whether new data is available by the size > of the returned image (e.g.: 1 pixel, no new data, 2pixels, new data). > You will need a small PHP script on the backend that generates the image > based on whether the data is available or not. > > Cheers, > > > Marco > > -- > php|architect -- The Magazine for PHP Professionals > Get your free copy today at http://www.phparch.com! > > On Mon, 2003-06-30 at 13:50, Stephen wrote: > > 1. This way would probably end up sending out 500 little clicks every > > minute...so... Could any client side script do this like JavaScript? I > doubt > > it could but just a question. > > > > With bubblegum in my shoe, > > Stephen Craton > > Senior Executive Web Developer > > Mophus.com, Inc. > > > > > > ----- Original Message ----- > > From: "Jay Blanchard" <[EMAIL PROTECTED]> > > To: "Stephen" <[EMAIL PROTECTED]>; "PHP List" > > <[EMAIL PROTECTED]> > > Sent: Monday, June 30, 2003 12:41 PM > > Subject: RE: [PHP] Refreshing > > > > > > [snip] > > I have a chat script. I want it to refresh the chat display area > > whenever there is a new message posted, but not every 10 seconds or so. > > How could I get the script to refresh only when there is a new entry > > into the database table? > > > > Also, this may not be PHP but...does anyone know how to stop the > > annoying click on Internet Explorer when something refreshes? > > [/snip] > > > > 1. Nope, not with PHP. Well, you could but it would require a script > > running in a loop in the background, checking for new data, then calling > > a header redirect of some sort. That is kludgy and would require the > > looping doohickey for each conversation within the chat. > > > > 2. You can disable sounds in a themes thingie, depends on which windoze > > version you own. > > > > HTH! > > > > Jay > > > -- > > Marco Tabini > President > > Marco Tabini & Associates, Inc. > 28 Bombay Avenue > Toronto, ON M3H 1B7 > Canada > > Phone: (416) 630-6202 > Fax: (416) 630-5057 > Web: http://www.tabini.ca > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php