How to Refresh a PHP page and add a clickable link

Reply

Join Date: Aug 2008
Posts: 1
Reputation: nate660 is an unknown quantity at this point 
Solved Threads: 0
nate660 nate660 is offline Offline
Newbie Poster

How to Refresh a PHP page and add a clickable link

 
0
  #1
Aug 5th, 2008
  1. <?php
  2. //URL to file.
  3. $data1 = 'http://66.232.193.178/sampserver/scriptfiles/Onlinetext.txt';
  4. $data2 = file($data1);
  5. foreach($data2 as $key => $value) {
  6. $data2[$key] = substr($data2[$key],stripos($data2[$key],"=")+1);
  7. $data2[$key] = str_replace(array("\r","\n"),"",$data2[$key]);
  8. }
  9.  
  10. //Your base image.
  11. $gd = imagecreatefromjpeg("online.jpg");
  12.  
  13. //some colors..
  14. $white = imagecolorallocate($gd, 255, 255, 255);
  15. $black = imagecolorallocate($gd, 1, 1, 1);
  16. $green = imagecolorallocate($gd, 0, 0, 255);
  17. $red = imagecolorallocate($gd, 255, 0, 0);
  18. //Data to show.
  19. imagestring($gd, 30, 195, 10, "ECLIPSE ROLEPLAY", $black);
  20. imagestring($gd, 30, 195, 30, "www.rmdt-clan.com", $black);
  21. imagestring($gd, 5, 5, 30, 'Players Online:' . $data2[0], $black);
  22. imagestring($gd, 5, 375, 30, 'Most Online:' . $data2[1], $black);
  23. imagestring($gd, 5, 130, 50, 'Total Players Connected:' . $data2[2], $black);
  24. imagestring($gd, 5, 130, 65, 'Server Online Time(Seconds):' . $data2[3], $black);
  25. imagestring($gd, 5, 130, 85, 'Server Online Time(Minutes):' . $data2[4], $black);
  26. imagestring($gd, 5, 130, 105, 'Server Online Time(Hours):' . $data2[5], $black);
  27. imagestring($gd, 5, 130, 125, 'Server Online Time(Days):' . $data2[6], $black);
  28. imagestring($gd, 5, 5, 145, 'Players Kicked:' . $data2[7], $black);
  29. imagestring($gd, 5, 350, 145, 'Players Banned:' . $data2[8], $black);
  30. imagestring($gd, 5, 5, 165, 'Script Version:' . $data2[9], $black);
  31. imagestring($gd, 5, 240, 165, "ServerIP: 66.232.193.178:7779", $black);
  32. header('Content-Type: image/jpeg');
  33. imagejpeg($gd);
  34. ?>

How can i make that PHP script Refresh Itself and Also how can i make the www.rmdt-clan.com url clickable

Thanks to all of you web developers for making this happen
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 64
Reputation: nil_gh_80 is an unknown quantity at this point 
Solved Threads: 0
nil_gh_80's Avatar
nil_gh_80 nil_gh_80 is offline Offline
Junior Poster in Training

Re: How to Refresh a PHP page and add a clickable link

 
0
  #2
Aug 6th, 2008
Originally Posted by nate660 View Post
  1. <?php
  2. //URL to file.
  3. $data1 = 'http://66.232.193.178/sampserver/scriptfiles/Onlinetext.txt';
  4. $data2 = file($data1);
  5. foreach($data2 as $key => $value) {
  6. $data2[$key] = substr($data2[$key],stripos($data2[$key],"=")+1);
  7. $data2[$key] = str_replace(array("\r","\n"),"",$data2[$key]);
  8. }
  9.  
  10. //Your base image.
  11. $gd = imagecreatefromjpeg("online.jpg");
  12.  
  13. //some colors..
  14. $white = imagecolorallocate($gd, 255, 255, 255);
  15. $black = imagecolorallocate($gd, 1, 1, 1);
  16. $green = imagecolorallocate($gd, 0, 0, 255);
  17. $red = imagecolorallocate($gd, 255, 0, 0);
  18. //Data to show.
  19. imagestring($gd, 30, 195, 10, "ECLIPSE ROLEPLAY", $black);
  20. imagestring($gd, 30, 195, 30, "www.rmdt-clan.com", $black);
  21. imagestring($gd, 5, 5, 30, 'Players Online:' . $data2[0], $black);
  22. imagestring($gd, 5, 375, 30, 'Most Online:' . $data2[1], $black);
  23. imagestring($gd, 5, 130, 50, 'Total Players Connected:' . $data2[2], $black);
  24. imagestring($gd, 5, 130, 65, 'Server Online Time(Seconds):' . $data2[3], $black);
  25. imagestring($gd, 5, 130, 85, 'Server Online Time(Minutes):' . $data2[4], $black);
  26. imagestring($gd, 5, 130, 105, 'Server Online Time(Hours):' . $data2[5], $black);
  27. imagestring($gd, 5, 130, 125, 'Server Online Time(Days):' . $data2[6], $black);
  28. imagestring($gd, 5, 5, 145, 'Players Kicked:' . $data2[7], $black);
  29. imagestring($gd, 5, 350, 145, 'Players Banned:' . $data2[8], $black);
  30. imagestring($gd, 5, 5, 165, 'Script Version:' . $data2[9], $black);
  31. imagestring($gd, 5, 240, 165, "ServerIP: 66.232.193.178:7779", $black);
  32. header('Content-Type: image/jpeg');
  33. imagejpeg($gd);
  34. ?>

How can i make that PHP script Refresh Itself and Also how can i make the www.rmdt-clan.com url clickable

Thanks to all of you web developers for making this happen


I think you should use meta tag for refreshing,,,,,which is the simplest way.....

Redirecting to a New Page
While the reload option is useful, it is usually not what people want from the meta refresh tag. To redirect to a new page, the syntax is nearly the same:
<meta http-equiv=”refresh” content=”2;url=http://webdesign.about.com”>
The only difference is in the content attribute.
content=”2;url=http://webdesign.about.com”
The number is the time, in seconds, until the page should be redirected. Then, separated by a semi-colon ( is the URL that should be loaded.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 64
Reputation: nil_gh_80 is an unknown quantity at this point 
Solved Threads: 0
nil_gh_80's Avatar
nil_gh_80 nil_gh_80 is offline Offline
Junior Poster in Training

Re: How to Refresh a PHP page and add a clickable link

 
0
  #3
Aug 6th, 2008
How can we refresh a page every 20 seconds wothout using javascript?

We can refresh the page with the help of meta refresh tag.
The meta tag belongs within the <head> of your HTML document. When used to refresh the current page, the syntax looks like this:
<meta http-equiv=”refresh” content=”20″>
This is the amount of time, in seconds, until the browser should reload the current page.
Redirecting to a New Page
While the reload option is useful, it is usually not what people want from the meta refresh tag. To redirect to a new page, the syntax is nearly the same:
<meta http-equiv=”refresh” content=”2;url=http://webdesign.about.com”>
The only difference is in the content attribute.
content=”2;url=http://webdesign.about.com”
The number is the time, in seconds, until the page should be redirected. Then, separated by a semi-colon ( is the URL that should be loaded.
Last edited by nil_gh_80; Aug 6th, 2008 at 2:51 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC