Php - Sayfadaki Linkleri Bulmak (scripti, nasıl, nedir?)
Nisan 15, 2008
<?
$page = 0;
$URL = "http://www.beginnersphp.co.uk/";
$page = @fopen($URL, "r");
print("Links at $URL<BR>
");
print("<UL>
");
while(!feof($page)) {
$line = fgets($page, 255);
while(eregi("HREF="[^"]*"", $line, $match)) {
print("<LI>");
print($match[0]);
print("<BR>
");
$replace = ereg_replace("?", "?", $match[0]);
$line = ereg_replace($replace, "", $line);
}
}
print("</UL>
");
fclose($page);
?>
kaynak: ordan burdan
<?php
$searchmeta = get_meta_tags("index.htm");
echo ($searchmeta["description"]);
echo ("<br>");
echo ($searchmeta["keywords"]);
?>
kaynak: ordan burdan
<?php
//this is the image to check , change this
if($img = @GetImageSize("test.gif"))
{
//if image exists display the following information
echo "image exists , here is some info<br>";
//display width in pixels
echo "width = $img[0]<br>";
//display height in pixels
echo "height = $img[1]<br>";
}
else
{
//cant find image message
echo"image does not exist";
}
?>
kaynak: ordan burdan
<?php
$service = getservbyport(80, "tcp");
print("Port 80 is $service<br>
");
?>
kaynak: ordan burdan
Php - Tcp Protokolünü öğrenmek (scripti, nasıl, nedir?)
Nisan 15, 2008
<?php
print("TCP is protocol " . getprotobyname('tcp') . "<br>
");
?>
kaynak: ordan burdan
<?php
foreach(gethostbynamel("www.google.com") as $host)
{
print("$host<br>
");
}
?>
kaynak: ordan burdan
<?php
print(gethostbyname("www.otelreferans.com"));
?>
kaynak: ordan burdan
<?php
print(gethostbyaddr("127.0.0.1"));
?>
kaynak: ordan burdan
<?
function listfiles()
{
echo '<select name="filelist">';
$dir = opendir("./");
while($dirlist = readdir($dir))
{
if ($dirlist[0] != "." && $dirlist[0] != ".." )
{
echo "<option value="$dirlist">$dirlist</option>";
}
}
echo '</select>';
closedir($dir);
}
echo '<form method="post" action="">';
listfiles();
echo '</form>';
?>
kaynak: ordan burdan
<?php
$data = implode("", file("index.php"));
$gzdata = gzencode($data, 9);
$fp = fopen("index.php.gz", "w");
fwrite($fp, $gzdata);
fclose($fp);
?>
kaynak: ordan burdan
