PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
jmut
Forum Regular
Posts: 945 Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:
Post
by jmut » Fri Apr 07, 2006 3:52 am
Hi I have one script that is used for somthing.
But I will use it in a cronjob so I want it to produce no output (dev/null of the script is no opion).
Code: Select all
foreach ($someting as $data) {
include("script_that_produce_output_I_dont_need");
}
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Fri Apr 07, 2006 4:13 am
if you use output functions like echo() or somthing then it is going to produce output, no way of avoiding that. Also, use error_reporting(E_NONE) so no errors are outputted.
jmut
Forum Regular
Posts: 945 Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:
Post
by jmut » Fri Apr 07, 2006 5:46 am
well there are echos and var_dumps and stuff
I don't see how there will be no headers generated.
jmut
Forum Regular
Posts: 945 Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:
Post
by jmut » Fri Apr 07, 2006 5:50 am
found a solution.
using curl and don't output any result from it
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Apr 07, 2006 7:31 am
timvw's direction is the general way to go. Using curl can involve a lot of extra overhead that you shouldn't really need.
jmut
Forum Regular
Posts: 945 Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:
Post
by jmut » Fri Apr 07, 2006 10:03 am
feyd wrote: timvw's direction is the general way to go. Using curl can involve a lot of extra overhead that you shouldn't really need.
yes but what about the headers.
"Now cross your fingers and hope that there are no headers being generated..."
I mention there are plenty of echos and stuff
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Apr 07, 2006 10:06 am
If there are lots of echos, typically there is no extra headers being set for a lot of people. You could always make sure to override the headers after including the file too.