Forum Moderators: coopster

Message Too Old, No Replies

stripslashes from include

any help would be great!

         

dubbed

11:39 am on May 9, 2004 (gmt 0)

10+ Year Member



no doubt there is someone here who could help me out here.

i'm calling up includes into my main page. as follows:
---------------------------------
function section2(){
include 'article/article2.php';
}

function section3(){
include 'article/article3.php';
}

function section4(){
include 'article/article4.php';
}
---------------------------------

what can i add to each, to stripslashes from each article*.php?

thank you in advance.

vincevincevince

12:02 pm on May 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



use this around each:


ob_start();
include ($your_file);
$buffer=ob_get_clean();
echo stripslashes($buffer);
ob_end_flush();

basically, whatever output is made by the include is stored in the buffer
the buffer is then stored in $buffer, which you echo with stripslashes().

finally, flush the buffer, just to be sure

dubbed

12:10 pm on May 9, 2004 (gmt 0)

10+ Year Member



vince, thats great!

thank very much.