473,385 Members | 2,180 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,385 software developers and data experts.

Output Buffer

My last question was about Sessions, and I'm still running into the
same issue, but with a different class now (basicly it says that the
class was not loaded), but I think I've narrowed it down to the way I'm
using Sessions. My question now is about Output Buffers. I basicly
made my own buffer and stored the information in a Session variable,
and I think that is causing my problem.
The reason I'm doing it this way, and not just a simple ob_start, etc,
is that I want to be able to control the output. For instance, if I
find that I want to add a menu item, but I'm at the end of my script,
then I have a problem. But the way I was working it was that I would
output everything at the end of the script. Plus, this gives me the
advantage of being able to sort the menu the way I want, so I could
output the one at the bottom of my menu (on a vertical one) first, and
then one at the top if that's the way the script happened to run.
What would be the best way to do this? Like I said, I was using a
Session variable, but I think that is causing a number of my problems.
Should I just go with a global variable? It's possible I need to
rethink how I was working stuff, as currently it redirects to a
game.php which does the output. I did this to help discourage hitting
back (as that would be extremely undesirable). Is there a better way
to handle that as well?

Oct 14 '06 #1
3 1105
pa***********@gmail.com wrote:
My last question was about Sessions, and I'm still running into the
same issue, but with a different class now (basicly it says that the
class was not loaded), but I think I've narrowed it down to the way I'm
using Sessions. My question now is about Output Buffers. I basicly
made my own buffer and stored the information in a Session variable,
and I think that is causing my problem.
The reason I'm doing it this way, and not just a simple ob_start, etc,
is that I want to be able to control the output. For instance, if I
find that I want to add a menu item, but I'm at the end of my script,
then I have a problem. But the way I was working it was that I would
output everything at the end of the script. Plus, this gives me the
advantage of being able to sort the menu the way I want, so I could
output the one at the bottom of my menu (on a vertical one) first, and
then one at the top if that's the way the script happened to run.
What would be the best way to do this? Like I said, I was using a
Session variable, but I think that is causing a number of my problems.
Should I just go with a global variable? It's possible I need to
rethink how I was working stuff, as currently it redirects to a
game.php which does the output. I did this to help discourage hitting
back (as that would be extremely undesirable). Is there a better way
to handle that as well?
Rethink the way you're doing things. What you're doing is making your
code much more complicated and it will be a maintenance nightmare.

Look at how much time you've already spent trying to get it to work.
And think about if you have this every time you need to make a change.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 14 '06 #2
pa***********@gmail.com wrote:
It's possible I need to
rethink how I was working stuff, as currently it redirects to a
game.php which does the output. I did this to help discourage hitting
back (as that would be extremely undesirable). Is there a better way
to handle that as well?
Maybe HTML / HTTP is not the best technology for your intents.

Can't you do your thing as a downloadable application instead?

--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
Oct 14 '06 #3

Pedro Graca wrote:
pa***********@gmail.com wrote:
It's possible I need to
rethink how I was working stuff, as currently it redirects to a
game.php which does the output. I did this to help discourage hitting
back (as that would be extremely undesirable). Is there a better way
to handle that as well?

Maybe HTML / HTTP is not the best technology for your intents.

Can't you do your thing as a downloadable application instead?
Or Flash?

Oct 14 '06 #4

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

Similar topics

2
by: vishal | last post by:
hi vishal here. can anyone tell me that how to buffer output and then send the output to client at a time. what is my problem is that i have a php file which runs query on database and takes...
9
by: Jay Donnell | last post by:
I have a function that is a few thousand lines of code (I didn't write it) and I want to capture the output and save it as a variable. This is very easy to do in php. It would look something like...
12
by: Matt Garman | last post by:
I'd like to create a "custom output facility". In other words, I want an object whose use is similar to std::cout/std::cerr, but offers more flexibility. Instead of simply writing the parameter...
9
by: Fred Ma | last post by:
Hello, I posted previously under the thread: How to break this up into streambuf/ostream I've asked our library to get "C++ IOStreams and Locales..." by A. Langer et al. Meantime, I've...
4
by: rossum | last post by:
I have been looking at exceptions as I need to get better at using them. I came across an interesting effect, demonstrated below. When I ctrl-Z the input to throw an ios_base::failure, the...
6
by: radnoraj | last post by:
Hi, I am sucessfull in redirecting console output to a file. but in this case nothing is displayed on the console, cout output is written to file without display. how do write the output to...
3
by: Blankdraw | last post by:
I'm getting NO errors and 2 warnings with this code. I thought I was ready to write the output-formatting segment, but may be way off the mark now. The warnings say that "OPEN() and READ() are...
8
by: walter.preuninger | last post by:
I am writing a program, using the gmp library. I need to take the output (mpz_out_str) and put it back into a string. Is there an easy way to take stream output, and 'place it' into a string? I...
2
by: Thormod Johansen | last post by:
Hi, I am doing some embedded programming in Paradigm C++, and I would like to be able to output debugging information using the << operator and ostreams. I have a serial link for which I have...
1
by: prads | last post by:
Hello, the foll pgm displays some wierd looking characters at the output when cout<<buffer<< is done. Pls tell me why it happens and also correct the error. Thanks, Prads int main () { ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.