Code:
<?
$url='file.html';
$file=fopen($url,"r");
while(!feof($file)){
$buffer.=fgets($file,4096);
}
preg_match_all("/(http|https)?:\/\/?([a-zA-Z0-9\-\.]*\.[a-zA-Z]{2,5})(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9.-_]*\/)?([a-zA-Z0-9.-_?&=%+$]+)?/", $buffer , $arrAddress );
$key=0;
foreach($arrAddress as $arr){
echo $arr[$key].'<br>';
$key++;
}
fclose($file);
?>
<?
$url='file.html';
$file=fopen($url,"r");
while(!feof($file)){
$buffer.=fgets($file,4096);
}
preg_match_all("/(http|https)?:\/\/?([a-zA-Z0-9\-\.]*\.[a-zA-Z]{2,5})(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9.-_]*\/)?([a-zA-Z0-9.-_?&=%+$]+)?/", $buffer , $arrAddress );
$key=0;
foreach($arrAddress as $arr){
echo $arr[$key].'<br>';
$key++;
}
fclose($file);
?>
html fajl je:
Code:
<html>
<head>
<title>Apache localhost homepage</title>
</head>
<body bgcolor="#FFFFFF" text="#5599ff" link="#888888" vlink="#888888">
<center>
<br>
<br>
<br>
<br>
<h1><strong>Apache server</strong></h1>
<a href="http://www.site1.com/cgi-bin/this/search.cgi">Projects</a><br>
<a href="https://www.site2.com/cgi-bin/fres/dot.cgi?manage=1">Account</a><br>
<a href="http://localhost/phpmyadmin/">MyAdmin</a><br>
<a href="https://www.dem2.com/cgi-bin/ln/lox.cgi?viewprofile=miok">Profile</a><br>
<a href="http://localhost/phpmyadmin/tb...a2cc070f9f809b&table=links">Settings</a>
<br><a href="http://localhost/hind.com/">SIte.com</a><br>
<a href="http://www.tugos-edu.net/notes...7122c75ad4b2787a0e6f8d3ae21587">FAX</a><br>
<a href="http://localhost/ex">ex</a><br><a href="http://localhost/sl">sl</a><br>
<a href="http://localhost/dev">dev</a><br></center>
</body>
<html>
<html>
<head>
<title>Apache localhost homepage</title>
</head>
<body bgcolor="#FFFFFF" text="#5599ff" link="#888888" vlink="#888888">
<center>
<br>
<br>
<br>
<br>
<h1><strong>Apache server</strong></h1>
<a href="http://www.site1.com/cgi-bin/this/search.cgi">Projects</a><br>
<a href="https://www.site2.com/cgi-bin/fres/dot.cgi?manage=1">Account</a><br>
<a href="http://localhost/phpmyadmin/">MyAdmin</a><br>
<a href="https://www.dem2.com/cgi-bin/ln/lox.cgi?viewprofile=miok">Profile</a><br>
<a href="http://localhost/phpmyadmin/tb...a2cc070f9f809b&table=links">Settings</a>
<br><a href="http://localhost/hind.com/">SIte.com</a><br>
<a href="http://www.tugos-edu.net/notes...7122c75ad4b2787a0e6f8d3ae21587">FAX</a><br>
<a href="http://localhost/ex">ex</a><br><a href="http://localhost/sl">sl</a><br>
<a href="http://localhost/dev">dev</a><br></center>
</body>
<html>
sve sto daje je:
Code:
http://www.site1.com/cgi
https
www.dem2.com
http://www.site1.com/cgi
https
www.dem2.com
imam instaliran xampp na windows xp-u
[Ovu poruku je menjao Sasa Kostic dana 13.09.2007. u 15:38 GMT+1]