php question

Status
Not open for further replies.

cetutnx1

New Member
Messages
510
Reaction score
0
Points
0
I was wondering if i can do a function that be some thing like this
PHP:
funtion die_error () {
include("something.inc.php");
include("something2.inc.php");
include("something3.inc.php");
die();
exit;
}
or if there is anything like a ini_set that do the same thing...
I haven't tryed anything but i read a lot in php.net mans but i haven't found anything that do something like this.
Thanks in Advance Gonzalo.
 

Torch

New Member
Messages
634
Reaction score
0
Points
0
Uh, what do you mean by "does something like this"?

Because that function only includes 3 certain scripts and end the execution of the rest of the original script it's been called from. So, basically the usefulness of that function depends of what those 3 scripts do.
 

cetutnx1

New Member
Messages
510
Reaction score
0
Points
0
Well... that includes are part of my template...
I believe that there was something like that in php.ini "on die include..."
is because i'm making a large script with a lot's of die(); and it's to much code to write...
 

omnirom

New Member
Messages
182
Reaction score
0
Points
0
Can't you just do something like:

Code:
<?php

$filename = something.ini.php
$newfile = @fopen($filename, "r") or exit("can't open $filename/whatever you want to say")

and type this multiple times for each function you want to stop?

Type nothing in the error mssg field if you dont want anything to show up.
 

alvaroag

New Member
Messages
288
Reaction score
0
Points
0
do you want a function which is called when the processing ends? if that is, use register_shutdown_function ( callback function ). but it's very limited... check the php manual for more reference
 
Status
Not open for further replies.
Top