vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Junk Code (https://vborg.vbsupport.ru/showthread.php?t=70683)

blue_chi 10-17-2004 12:58 PM

Junk Code
 
I'm loading the phpinclude templates into an external php, some of the code is being printed out along with the other text. Here are my codes:

PHPINCLUDE

PHP Code:

ob_start();
    include(
'http://www.oman3d.com/header.php');
    
$included ob_get_contents();
ob_end_clean(); 

Here is the external page:

PHP Code:

<?php 

// GO TO FORUM DIR 
chdir('./forum'); 

// STANDARD VBULLETIN STUFF 
define('NO_REGISTER_GLOBALS'1); 
define('THIS_SCRIPT''script_name'); 
require_once(
'./global.php'); 

// GENERIC_SHELL VARS 
$pagetitle "Title of Page"


eval(
'$HTML = "' fetch_template('phpinclude_start') . '";'); 

eval(
'print_output("' fetch_template('GENERIC_SHELL') . '");'); 

?>

Here is what comes out:
http://www.oman3d.com/testing.php

Could anybody please help.

Xenon 10-17-2004 01:52 PM

change
PHP Code:

eval('$HTML = "' fetch_template('phpinclude_start') . '";'); 

into

PHP Code:

eval(fetch_template('phpinclude_start')); 


blue_chi 10-17-2004 02:03 PM

Xenon, when I do that my included header does not appear. :S

http://www.oman3d.com/testing2.php

Xenon 10-17-2004 02:34 PM

may be a template problem.

are you sure you are using $include in your template, as you are defining that var :)

PHP Code:

$included ob_get_contents(); 


blue_chi 10-17-2004 02:42 PM

:o Xenon, I really don't know much about PHP. I really don't know what to do. :o

Xenon 10-17-2004 02:54 PM

well, from what i see you were trying, change

PHP Code:

 $included ob_get_contents(); 

into
PHP Code:

$HTML ob_get_contents(); 


blue_chi 10-17-2004 03:24 PM

Xenon, I am not really sure of what I should change to fix the error.

Xenon 10-17-2004 03:34 PM

to your original code do both changes i have mentioned in the thread here

blue_chi 10-17-2004 04:03 PM

WOW! It worked, it worked! Thanks so much Xenon, I am really so grateful.

Xenon 10-17-2004 04:38 PM

:)

you're welcome :)


All times are GMT. The time now is 09: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.01026 seconds
  • Memory Usage 1,733KB
  • 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
  • (7)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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