Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 14th, 2003, 11:22 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
include php in html

how can i include counter.php in ex. blabla.html ?

php Code:
Original - php Code
  1. <?PHP
  2. /**************************************************  **********************/
  3. /* PHP CountMe v1.0                                                     */
  4. /* ===========================                                          */
  5. /*                                                                      */
  6. /*   Written by Steve Dawson - http://www.stevedawson.com               */
  7. /*   Freelance Web Developer - PHP, Perl and Javascript programming     */
  8. /*                                                                      */
  9. /* This program is free software. You can redistribute it and/or modify */
  10. /**************************************************  **********************/
  11. ## --  START OF CONFIG SECTION  --  ##
  12. $counterstyle = "images";   # Enter images or text
  13. $imagetype = "1";           # 1 to 10 = The type of image to display (SEE README FILE)
  14. ## --  END OF CONFIG SECTION  --  ##
  15.  
  16. $hitslog = "hits.txt";      # Path to the hits file, leave alone if in the same directory
  17. $imagefolder = "digits";    # The full path to the images directory.
  18. ## Get the hitslog file ready
  19. $hits = file($hitslog);
  20. $hits = $hits[0] + 1;
  21.  
  22. ## Opening the hits file and write the number of hits:
  23. $fp = fopen($hitslog, "w");
  24. fwrite($fp, $hits);
  25.  
  26. ## Text counter, print the number of hits
  27. if ($counterstyle == "text") { print $hits; }
  28.  
  29. ## If Image Counter, get the required type and print them out.
  30. if ($counterstyle == "images") {
  31.  $digit = strval($hits);
  32.  for ($i = 0; $i < strlen($hits); $i++) {
  33. print "<img src="$imagefolder/$imagetype/$digit[$i].gif" alt="There have been $hits visitors to this website">";
  34.                 }
  35.         }
  36. ## That's All Folks, more free simple scripts online at www.stevedawson.com
  37. ?>
  38.  

Reply With Quote
  #2  
Old August 14th, 2003, 11:27 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
RE: include php in html

you can't unless you can get the server admin to parse htm/html files as php(which can be a performance hit). You need to rename the .html file to .php

Reply With Quote
  #3  
Old August 14th, 2003, 11:57 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: include php in html

<img src="url/to/script.php">

Reply With Quote
  #4  
Old August 15th, 2003, 11:02 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
RE: include php in html

we used to use that method to slip a random image script in as a custom avatar on Invision Board but I thought I read somewhere it no longer works.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > include php in html


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT