473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

no echo after include?

<?php
echo "bbb";
include("common/funcs.php");
echo "a";
?>

When accessing the above test code from a browser it prings 'bbba.'
When accessing the page from a MFC app, it just prints 'bbb.'
Everying print or echo statement after the include gets ignored. Why
would this be?

Apr 6 '07 #1
3 2264
usenet wrote:
de*****@gmail.com wrote:
><?php
echo "bbb";
include("common/funcs.php");
echo "a";
?>

Everying print or echo statement after the include gets ignored. Why
would this be?

Something in the included file is probably causing processing to terminate. Try
checking your error log for clues.
That's the most likely explanation. Another possible explanation, though
less likely, is that funcs.php turns on output buffering.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 7 '07 #2
Toby A Inkster kirjoitti:
usenet wrote:
>de*****@gmail.com wrote:
>><?php
echo "bbb";
include("common/funcs.php");
echo "a";
?>

Everying print or echo statement after the include gets ignored. Why
would this be?
Something in the included file is probably causing processing to terminate. Try
checking your error log for clues.

That's the most likely explanation. Another possible explanation, though
less likely, is that funcs.php turns on output buffering.
Close, but no cigar. The included file might turn on output buffering,
but if nothing catches the buffer and cleans it, then everything is
output normally when the program exits.

<?php
echo "bbb";
include("common/funcs.php");
echo "a";
ob_end_clean(); // the original script doesn't have this
?>

Of course there is register_shutdown_function(), so yeah, it's
_possible_ to get the ob_end_clean executed at the end without it being
in the script, not very likely though. :)

--
Ra*********@gmail.com
"Olemme apinoiden planeetalla."
Apr 7 '07 #3
On Sun, 08 Apr 2007 00:27:30 +0300, Rami Elomaa
<ra*********@gmail.comwrote:
>Toby A Inkster kirjoitti:
>usenet wrote:
>>de*****@gmail.com wrote:

<?php
echo "bbb";
include("common/funcs.php");
echo "a";
?>

Everying print or echo statement after the include gets ignored. Why
would this be?
Something in the included file is probably causing processing to terminate. Try
checking your error log for clues.

That's the most likely explanation. Another possible explanation, though
less likely, is that funcs.php turns on output buffering.

Close, but no cigar. The included file might turn on output buffering,
but if nothing catches the buffer and cleans it, then everything is
output normally when the program exits.

<?php
echo "bbb";
include("common/funcs.php");
echo "a";
ob_end_clean(); // the original script doesn't have this
?>

Of course there is register_shutdown_function(), so yeah, it's
_possible_ to get the ob_end_clean executed at the end without it being
in the script, not very likely though. :)
How about just executing a flush() after the last echo to verify?
Apr 7 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: lawrence | last post by:
In the following loop, at the end, the method debugNotes() is printing out some notes for me to read, so I can figure out what is going on in my script. Where I try to print out the value of the...
2
by: Adam Carolla | last post by:
I have now spent well over 12 hours on this one problem. I am pulling data out of a database, the data in the database is categorized by a value (season). I need to title the first value, then...
4
by: | last post by:
The title is maby a bit strage, I had problem coming up with a title that explain my problem. I have a variable $myvar="TEST 123" I would like to use this variable as a default value in a...
5
by: spaghetti | last post by:
Hi I'm still new to this but I think I'm making progress. Below is a functioning script that inserts 4 fields into a database. After advice from a previous post the form is being processed on the...
5
SHOverine
by: SHOverine | last post by:
Hello All. I have a problem with a form that I am trying to create. What happens is: I have a person enter a UserName and select some values using radio buttons. They submit the form, and the next...
25
by: Jon Slaughter | last post by:
I have some code that loads up some php/html files and does a few things to them and ultimately returns an html file with some php code in it. I then pass that file onto the user by using echo. Of...
4
by: rawky1976 | last post by:
Hi, I have a hyperlink which goes to the page below and passes the PK_ID from a query into 'userid'. From this we query the DB and then echo a table with a form; only the textboxes are already...
1
by: sheel331 | last post by:
Hello, I am new to coding in PHP, and had a question about a simple thing: I am trying to echo out the elements of an array for a sidenav in one of my HTML pages, and I can't seem to figure out...
32
by: Request-1 | last post by:
hi folks, html coder here, new and terrified * of php!! aaaaaa! i'm trying to bury a JS script to rotate a photo, in a page i converted from html to php. the conversion went well, it was to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.