Page 1 of 1

Xampp for Win & Xammp for Linux

PostPosted: 19. April 2008 14:57
by eduran
Hi. Following php script is working at Xampp for windows but it isn't working at Xampp for linux. Also this script hasn't worked at linux based os. Freebsd, pardus etc. And php is crashed.

Thanks for your help.

Code: Select all
<?php

   function enclose($start, $end1, $end2)
   {
      return "$start((?:[^$end1]|$end1(?!$end2))*)$end1$end2";
   }
      
      $fcont = file_get_contents("http://www.gazi.edu.tr");      
      $pstring1 = "'[^']*'";
      $pstring2 = '"[^"]*"';
      $pnstring = "[^'\">]";
      $pintag   = "(?:$pstring1|$pstring2|$pnstring)*";
      $pattrs   = "(?:\\s$pintag){0,1}";
      
      $pcomtag = enclose('<!--', '-', '->');
           $pscrtag = enclose("<script$pattrs>", "<", "\\/script>");
                $pstytag = enclose("<style$pattrs>", "<", "\\/style>");
 
      $pexclude = "(?:$pcomtag|$pscrtag|$pstytag)";
      $fcont2 = preg_replace("/$pexclude/iX", '', $fcont);
      
      echo $fcont2;
   
?>   

PostPosted: 20. April 2008 11:47
by Dave_L
Which version of XAMPP and PHP?

Is the PHP setting allow_url_fopen on?