943,647 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 3772
  • PHP RSS
Aug 5th, 2008
0

How to Refresh a PHP page and add a clickable link

Expand Post »
php Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nate660 is offline Offline
1 posts
since Aug 2008
Aug 6th, 2008
0

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

Click to Expand / Collapse  Quote originally posted by nate660 ...
php Syntax (Toggle Plain Text)
  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.
Reputation Points: 8
Solved Threads: 2
Junior Poster in Training
nil_gh_80 is offline Offline
64 posts
since Aug 2007
Aug 6th, 2008
0

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

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.
Reputation Points: 8
Solved Threads: 2
Junior Poster in Training
nil_gh_80 is offline Offline
64 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: navigation?
Next Thread in PHP Forum Timeline: Submit Form To MySQL Table





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC