Re: is there a way to change the config variable error_prepend_string from php code?
| From: | Zeev Suraski | Date: | Fri, 11 Aug 2000 21:41:30 +0000 |
| Subject: | Re: is there a way to change the config variable error_prepend_string from php code? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-11418@lists.php.net to get a copy of this message | ||
As with most other INI directives, it's possible to alter the value of
error_prepend_string from within a PHP script, in runtime, using the INI
functions:
ini_set("directive", $value)
You can restore it the its original state by using
ini_restore("directive"), or obtain its current value using
ini_get("directive").
In you case, you'd want to do something along the lines of
ini_set("error_prepend_string", $something);
Zeev
On Fri, 11 Aug 2000, Lisa Mroczka wrote:
> I have the following html that uses javascript to dynamically generate
> a document in a frame. Any errors in the php code result in
> html output which is not valid in this javascript context. What I
> would like to do from this php code is change error_prepend_string
> to "document.writeln(" and error_append_string to ");document.close();"
> or something like this.
>
> Here is some code to give this problem some context:
> <HTML>
> <FRAMESET ROWS="10%,*" BORDER=0 FRAMESPACING=0 FRAMEBORDER=0>
> <FRAME SRC="javascript:''" NAME=TOP>
> <FRAME SRC="javascript:
> <?php //add php code here that will add javascript document.write() calls
> //to create the report detail lines here
> //note: THIS CODE, INCLUDING ANY CALLED PHP FUNCTIONS,
> // CANNOT OUTPUT A DOUBLEQUOTE AS IT WILL TERMINATE
> // THIS JAVASCRIPT URL!
> //set a php global variable called myWrite that will contain the string
> //representation of the javascript document object write method that needs
> //to be used from this code.
> $myWrite = "document.writeln";
> //error_reporting(15); this can't be done here since it outputs html and not js code
> echo "document.open('text/html');\n";
> generateDetail();
> //echo "document.write('<HTML><BODY>hi from
> bottom</BODY></HTML>');";
> echo "document.close();";
> ?>
> " NAME=BOTTOM>
> <NOFRAMES>
> Sorry, this document can be viewed only with a
> frames-capable browser.
> </NOFRAMES>
> </FRAMESET>
> </HTML>
>
> Does anyone have any ideas here?? I am using PHP Version 4.0.1pl2.
>
> Thanks, Bob Mroczka.
>
>
--
Zeev Suraski <zeev@zend.com>
http://www.zend.com/