PHPee.com PHP development forum
showhits.php shouldn't output on screen when called from PHP

 
Post new topic   Reply to topic    phpee.com Forum Index -> Phlogger3 feature requests
View previous topic :: View next topic  
Author Message
V@no



Joined: 15 Nov 2003
Posts: 157

PostPosted: Tue Dec 23, 2003 12:07 am    Post subject: showhits.php shouldn't output on screen when called from PHP Reply with quote
IMHO I think that when showhits.php being called from PHP it should return needed value in a variable instead of print it on screen.
Here are few reasons:

1. Some scripts using templates witch means that the page being printed only after compilining by the script. So if u do include showhits.php it will output the result on screen before the entire page showed on screen.
2. In some cases current showhits.php might produse a "Header already sent..." error.
3. Sometimes u might want do something else with the date from showhits.php (store in the database, or maybe include the result in a file)
_________________
Back to top
View user's profile Send private message Visit poster's website
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 1015
Location: London, UK

PostPosted: Tue Dec 23, 2003 1:53 am    Post subject: Reply with quote
I can see what you mean by this.
Would be far nicer to be able to request which data showhits.php outputs to the browser, if any at all Smile

David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
V@no



Joined: 15 Nov 2003
Posts: 157

PostPosted: Tue Dec 23, 2003 5:33 am    Post subject: Reply with quote
yeah, that would be a good feature too...(feels some discrimination towards PHP, by showing only text and not as images Smile)

Currently my feature request (get the result in a variable and not on screen) could be done only by something like this:
Code:
  $id = "name";
  $st = "php";
  $type = "hits";
  ob_start();
  include (PPHL_SCRIPT_PATH."showhits.php");
  $pphresult = ob_get_contents();
  ob_end_clean();
?>

$pphresult variable would have the number of hits...
_________________
Back to top
View user's profile Send private message Visit poster's website
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 1015
Location: London, UK

PostPosted: Tue Dec 23, 2003 11:33 am    Post subject: Reply with quote
Oh, there's no discrimination between image and PHP.
You can still output as an image with showhits.php:



David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    phpee.com Forum Index -> Phlogger3 feature requests All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB
Theme design based on Team 101 Designs, modified by Philip Iezzi