472,952 Members | 2,067 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

execute PHP -> return output to string

Hi

I've got a problem and I hope someone can help me:

I want a PHP script to call another PHP script, execute it and return its
OUTPUT (not its content) into a STRING in the first script.

--
_/_/ ICQ: 114034537 IRC : Robin479m (DALnet/EFnet)
_/ _/ Y! : Robin479m Mail: Ch***************@gmx.de
_/_/ AIM: Robin479m MSN : Ro*******@hotmail.com
Jul 17 '05 #1
4 10609
"Christopher-Robin" a écrit le 05/11/2003 :
Hi

I've got a problem and I hope someone can help me:

I want a PHP script to call another PHP script, execute it and return its
OUTPUT (not its content) into a STRING in the first script.


Don't really understand can't you use function() ?
Jul 17 '05 #2
See http://us3.php.net/manual/en/function.include.php

"Christopher-Robin" <Ch***************@gmx.de> wrote in message
news:bo*************@ID-157729.news.uni-berlin.de...
Hi

I've got a problem and I hope someone can help me:

I want a PHP script to call another PHP script, execute it and return its
OUTPUT (not its content) into a STRING in the first script.

--
_/_/ ICQ: 114034537 IRC : Robin479m (DALnet/EFnet)
_/ _/ Y! : Robin479m Mail: Ch***************@gmx.de
_/_/ AIM: Robin479m MSN : Ro*******@hotmail.com

Jul 17 '05 #3
Eric Ellsworth wrote:
See http://us3.php.net/manual/en/function.include.php


to clarify...
ob_start(); // start trapping output
include "foo.php"; // produce output
$output = ob_getcontents(); // get contents of trapped output
ob_end_clean(); // discard trapped output and stop trapping

cool thing is you can nest these too :)
you can do other things using a call-back. pretty funky stuff really :)

See "output buffering", check the spelling of those functions. I'm too
lazy to look it up...

Jul 17 '05 #4
> ...

ob_start(); // start trapping output
include "foo.php"; // produce output
$output = ob_getcontents(); // get contents of trapped output
ob_end_clean(); // discard trapped output and stop trapping

...


Exactly this is what I did so far before I realized, that the output buffer
is limited in size to 'output_buffering' in the php configuration, which is
set to 4096 bytes by default, but 4K is just not enough for me. I need it do
be unlimited. This could be done with 'output_buffering = On', which limits
the buffer to the RAM size for the script offered in 'memory_limit' (8M by
default).
PS: It must be done this way to make sure everything in the buffer before is
reinsert afterwards.

$old=ob_get_contents(); ob_clean(); ob_start(); // you may leave ob_start();
include ...;
$out=ob_get_contents(); ob_clean();
echo $old;
Jul 17 '05 #5

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

Similar topics

4
by: Jill Graham | last post by:
Hi, I'm using an access database and found following problem : I have a table X with 2 records : record 1 & record 2. I execute following procedure with 2 steps : 1. The procedure deletes...
6
by: PiGei | last post by:
hi all, I'm trying to use server.execute statement to include in an asp page another asp page with a parameter. That's because I've a parametric query in the second asp page and I have to pass...
3
by: Chris | last post by:
I have yet to understand or get a response on the issue I'm having. I'm taking an asp web application and migrating it from Windows 2K to 2003. I have the new website location (2003) settings...
2
by: Norman Fritag | last post by:
Hi there The below code executes some queries. As newbie I was wondering weather you are better of using connection execute or command execute to execute queries? I am asking as...
1
by: Jack Bauer | last post by:
How can I execute a query which prompt the user for input? Something like SELECT FROM Table WHERE Name= In Oracle PL/SQL, you use & before variable names to have the SQL*Plus ask for input....
8
by: johnlichtenstein | last post by:
I am using cx_Oracle and MySQLdb to pull a lot of data from some tables and I find that the cursor.execute method uses a lot of memory that never gets garbage collected. Using fetchmany instead of...
6
by: gyung | last post by:
Hi, this is my first post but I've been constantly referred to this site when I needed help. Anyway, this time I can't seem to find anything, so here goes. This is part of my case statement, and I...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
3
by: RAG2007 | last post by:
I'm using the QueryDef and Execute method to update a record in my MySQL backend. Problem: When the Passthrough update query is defined using QueryDef, it becomes a select query, and I cannot use...
0
by: David | last post by:
- Are there any peculiarities with using curs.executemany(...) vs. multiple How many times are you calling execute vs a single executemany? The python call overhead will add up for thousands of...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.