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
kAsPeR
Forum Newbie
Posts: 2 Joined: Fri Sep 26, 2003 10:48 pm
Location: wouldn't u like to know...
Post
by kAsPeR » Fri Sep 26, 2003 10:48 pm
hm...well, i can't get this code to work...even after overriding safe_mode(i'm on tripod uk)
ne one have ne suggestions?
...btw, blah.php is this program that's running the code...
Code: Select all
<?php
ini_set("safe_mode", "0");
ob_start();
// Show source of file
show_source ( 'blah.php' );
$contents = ob_get_contents();
ob_end_clean();
$contents = explode('<br>', @contents);
echo '<html><body>';
foreach ($contents as $line){
echo '<font color="cccccc"><ul>'.$line.'</ul></font><br>';
}
echo '</body></html>';
?>
?>
JAM
DevNet Resident
Posts: 2101 Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:
Post
by JAM » Sat Sep 27, 2003 7:00 am
Code: Select all
$contents = explode('<br>', @contents);
and @ ?
Cruzado_Mainfrm
Forum Contributor
Posts: 346 Joined: Sun Jun 15, 2003 11:22 pm
Location: Miami, FL
Post
by Cruzado_Mainfrm » Sat Sep 27, 2003 7:02 am
make sure you change the @content to $content cuz that doesn't seem to be a function anyways
kAsPeR
Forum Newbie
Posts: 2 Joined: Fri Sep 26, 2003 10:48 pm
Location: wouldn't u like to know...
Post
by kAsPeR » Sat Sep 27, 2003 12:10 pm
k...well, this is my new code...does the same thing tho....
Code: Select all
<?php
ini_set("safe_mode", "0");
ob_start();
// Show source of file
show_source ( 'blah.php' );
$contents = ob_get_contents();
ob_end_clean();
$explode_contents = explode('<br>', $contents);
echo '<html><body>';
foreach ($explode_contents as $line){
echo '<font color="cccccc"><ul>'.$line.'</ul></font><br>';
}
echo '</body></html>';
?>
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sat Sep 27, 2003 12:37 pm
you can't change the safemode settings via
ini_set() http://php.net/manual/en/features.safe-mode.php wrote:safe_mode "0" PHP_INI_SYSTEM
safe_mode_gid "0" PHP_INI_SYSTEM
safe_mode_include_dir NULL PHP_INI_SYSTEM
safe_mode_exec_dir "" PHP_INI_SYSTEM
safe_mode_allowed_env_vars PHP_ PHP_INI_SYSTEM
safe_mode_protected_env_vars LD_LIBRARY_PATH PHP_INI_SYSTEM
open_basedir NULL PHP_INI_SYSTEM
disable_functions "" PHP_INI_SYSTEM
disable_classes "" PHP_INI_SYSTEM
and
wouldn't make much sense otherwise (from the provider's point of view)
But if your script can get the file's content somehow
mixed highlight_string ( string str [, bool return]) might be useful
btw:
and that's true for show_source et al. as well.
<br /> is used instead of
<br>