<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kb.rvmgroup.it/index.php?action=history&amp;feed=atom&amp;title=Visualizzare_un_sorgente_PHP_via_web</id>
	<title>Visualizzare un sorgente PHP via web - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://kb.rvmgroup.it/index.php?action=history&amp;feed=atom&amp;title=Visualizzare_un_sorgente_PHP_via_web"/>
	<link rel="alternate" type="text/html" href="https://kb.rvmgroup.it/index.php?title=Visualizzare_un_sorgente_PHP_via_web&amp;action=history"/>
	<updated>2026-05-05T15:32:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://kb.rvmgroup.it/index.php?title=Visualizzare_un_sorgente_PHP_via_web&amp;diff=5013&amp;oldid=prev</id>
		<title>Gabriele.vivinetto at 13:19, 27 December 2006</title>
		<link rel="alternate" type="text/html" href="https://kb.rvmgroup.it/index.php?title=Visualizzare_un_sorgente_PHP_via_web&amp;diff=5013&amp;oldid=prev"/>
		<updated>2006-12-27T13:19:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;E&amp;#039; possibile visualizzare il sorgente di un file php con la syntax highlighting, in due modi:&lt;br /&gt;
&lt;br /&gt;
# Copiare il file .php in .phps e visualizzarlo nel browser. Se il webserver è Apache (2), verrà mostrato il source, a colori.&lt;br /&gt;
&lt;br /&gt;
# Usare questo script: http://www.zend.com/codex.php?id=203&amp;amp;single=1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?&lt;br /&gt;
&lt;br /&gt;
/******************************************&lt;br /&gt;
#  File:  view_source.php&lt;br /&gt;
#  Description: Script to view code with highligths.&lt;br /&gt;
#                Link to this file with &lt;br /&gt;
#                &amp;quot;view_source.php?source=/mypath/myfile.php&amp;quot;&lt;br /&gt;
#                &lt;br /&gt;
#                Makes a copy of the php file and names it phps.&lt;br /&gt;
#                And then redirects the browser to the new phps file.&lt;br /&gt;
#                phps files are automaticly code highlighted and displayed&lt;br /&gt;
#                if you are using Apache.&lt;br /&gt;
#&lt;br /&gt;
#  Author: Krister Konst&lt;br /&gt;
#          krister@krikon.com&lt;br /&gt;
******************************************/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function source($source) &lt;br /&gt;
{  &lt;br /&gt;
  clearstatcache();                              // cache of the filething dele. &lt;br /&gt;
  if(!file_exists($source))                      // Checking for the file $source. &lt;br /&gt;
  { &lt;br /&gt;
    return false; &lt;br /&gt;
  } &lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// this returns an array of string of wich the last element is the filename.&lt;br /&gt;
$path_array= split(&amp;quot;/&amp;quot; , $source);&lt;br /&gt;
&lt;br /&gt;
$num = sizeof($path_array);&lt;br /&gt;
$str = str_replace (&amp;quot;php&amp;quot;, &amp;quot;phps&amp;quot;, $path_array[$num-1]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
global $target_file&lt;br /&gt;
&lt;br /&gt;
// to make this work you must make the source directory first. &lt;br /&gt;
$target_file = &amp;quot;./source/&amp;quot; . $str;&lt;br /&gt;
&lt;br /&gt;
 copy($source,$target_file);&lt;br /&gt;
&lt;br /&gt;
      &lt;br /&gt;
  return true; &lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
source($source);&lt;br /&gt;
&lt;br /&gt;
header (&amp;quot;Location: $target_file&amp;quot;);                 /* Redirect browser &lt;br /&gt;
                                           to the newly created phps file/&lt;br /&gt;
exit;                 /* Make sure that code below does &lt;br /&gt;
                         not get executed when we redirect. */&lt;br /&gt;
      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gabriele.vivinetto</name></author>
	</entry>
</feed>