vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Embedding Images in PHP Files (https://vborg.vbsupport.ru/showthread.php?t=52298)

MUG 04-28-2003 08:24 PM

Embedding Images in PHP Files
 
Are there any major performance problems when setting up a script like this for small images? I need to embed an image into a PHP script. It seems to do fine on my test machine (200 MHz Pentium 1)

<?php
// File Name: 5stars.gif
// File Size: 222
// File Type: image/gif

ob_start();
$type='image/gif';
?>
R0lGODlhNwAMALMOAP/4p//5sf/5t//6v//3n//5tv/6wf/5uf/6vv/4qv/4pv/3m//3mQAAAAAA
AAAAACH5BAEAAA4ALAAAAAA3AAwAAASL0MlJq70469p0zx8WXi NnlFNziivZWioqNYjs0DYu1vvY
/I1BIQEsBodGoJCYPDKTy+LtIAgAFgzGp0G1YrWz7jW7FX/L1TF4piBk12w3mdJov332eSoPn91h
fxyBdIMphTdken5aioiMfQ2JkJI+YJGVHZeEmZOcmIg+IT90oq EppjOoNzYbra6uEQA7
<?php
$contents = base64_decode(ob_get_contents());
ob_end_clean();

header("Content-type: $type");
echo $contents;
?>

filburt1 04-28-2003 09:31 PM

There's effectively no point for doing it in that script above...


All times are GMT. The time now is 12:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00907 seconds
  • Memory Usage 1,700KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete