Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7001813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:51:01+00:00 2026-05-27T20:51:01+00:00

Kind of a basic question, but I have a page similar to this example:

  • 0

Kind of a basic question, but I have a page similar to this example:

<?php 
/*
Template Name: Temp
*/
?>

<?php
function myFunction($urls) {
    $q = mysql_query("SELECT * FROM table");
    while ($row = mysql_fetch_array($q)) {
       echo $row['field'];
    }
}

$url1 = $_POST['urls'];
$urls = explode("\r\n",$url1);
?>
<?php get_header(); ?>
    <?php if (get_option('professional_integration_single_top') <> '' && get_option('professional_integrate_singletop_enable') == 'on') echo(get_option('professional_integration_single_top')); ?> 

    <div id="content-top" class="top-alt"></div>
    <div id="content" class="clearfix content-alt">
        <div id="content-area">
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
            <?php get_template_part('includes/breadcrumbs'); ?>

            <?php if (get_option('professional_integration_single_top') <> '' && get_option('professional_integrate_singletop_enable') == 'on') echo(get_option('professional_integration_single_top')); ?>

            <div class="entry clearfix post">
            <?php
                        myFunction($urls);           
                ?>
                <h1 class="title"><?php the_title(); ?></h1>

                <?php if (get_option('professional_page_thumbnails') == 'on') { ?>

                    <?php $thumb = '';
                    $width = 184;
                    $height = 184;
                    $classtext = '';
                    $titletext = get_the_title();

                    $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext);
                    $thumb = $thumbnail["thumb"]; ?>

                    <?php if($thumb <> '') { ?>
                        <div class="thumb alignleft">
                            <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
                            <span class="overlay"></span>
                        </div> <!-- end .thumb -->
                    <?php }; ?>

                <?php }; ?>

                <?php the_content(); ?>
                <?php wp_link_pages(array('before' => '<p><strong>'.esc_html__('Pages','Professional').':</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
                <?php edit_post_link(esc_html__('Edit this page','Professional')); ?>

            </div> <!-- end .entry -->

            <?php if (get_option('professional_integration_single_bottom') <> '' && get_option('professional_integrate_singlebottom_enable') == 'on') echo(get_option('professional_integration_single_bottom')); ?>

            <?php if (get_option('professional_show_pagescomments') == 'on') comments_template('', true); ?>
        <?php endwhile; endif; ?>
        </div> <!-- end #content-area -->

        <?php get_sidebar(); ?>

    </div> <!-- end #content -->
    <div id="content-bottom" class="bottom-alt"></div>

<?php get_footer(); ?>

EDIT:

I have updated the code to reflect the exact code I’m using.

Why are the myFunction echo outputs within the someFunction function are appearing at the bottom of the document instead of right after $somestring?

How can I change this code so the myFunction echo outputs will appear in the correct place?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:51:02+00:00Added an answer on May 27, 2026 at 8:51 pm

    I believe it has something to do with your WordPress theme. I tested it on my WordPress blog and it works well. The function echos the value on the place I executed it. Please check your header.php. I think d3v3us is right and is something to do with output buffering.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is similar to this question , but kind of the opposite. I have
I understand this is a basic question... but I have been stuck on it
This question is so basic, it's kind of embarrassing, but here goes... This is
Kind of a basic question but I'm having troubles thinking of a solution so
Kind of a weird question, but. I need to have a list of strings
Kind of like this question I have many text snippets that I use many,
G'day All, I am working in R. Sorry about this really basic question, but
This is a very basic question. I feel kind of silly asking about it
First, I know this is kind of common question, but I could not find
This is probably a stupid question but will ask anyway sine I have no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.