vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Store echo within a variable? (https://vborg.vbsupport.ru/showthread.php?t=112497)

Sean S 04-08-2006 09:53 PM

Store echo within a variable?
 
Hi :)

could anyone tell me how I would store a echo statement within a variable? I tried the following but it didn't work :(

PHP Code:

        $sql $DB_site->query("SELECT * FROM links, sponsor ORDER BY id DESC");
        while(
$row mysql_fetch_assoc($sql)) {
            
$sponsors = echo "
            <table align=center border=0 cellspacing=0 cellpadding=5><tr><td class="
alt1">
            "
.($row['link'])."  ,  ".($row['sponsor'])."<br />
            </td>
            </tr>
            </table>
            "
;
            
$i++;


do I have to use something else instead of echo and if I do, would the while loop still work? thanks in advance :)

Paul M 04-08-2006 10:10 PM

Why are you trying to store the echo ?

Sean S 04-08-2006 10:21 PM

Pretty much I want to store it in the variable, so that I can call it within a template or the custom page that I'm creating. Because if I just use the echo alone, the information appears at the very top of the page and above the header and everything else, hope I'm making any sense.

Reeve of shinra 04-08-2006 11:23 PM

This is what you need...

Quote:

https://vborg.vbsupport.ru/showthread.php?t=112497

PHP Code:

eval('$navbar = "' fetch_template('navbar') . '";'); 



Paul M 04-09-2006 12:24 AM

Quote:

Originally Posted by Sean S
Pretty much I want to store it in the variable, so that I can call it within a template or the custom page that I'm creating. Because if I just use the echo alone, the information appears at the very top of the page and above the header and everything else, hope I'm making any sense.

You don't need the echo. Just store what you want to output in a variable, and add that variable to the template you want to use to display it.

Sean S 04-09-2006 12:25 AM

thanks guys, I'll try that right now :)

Reeve of shinra 04-09-2006 12:33 AM

er yeah, what paul said. For some reason I thought you were trying to call a template in a template. =p


All times are GMT. The time now is 12:59 AM.

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.01083 seconds
  • Memory Usage 1,730KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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