Ljudi pomagajte, nikako ne mogu da skontam kako da prepravim ovu skriptu, da umesto input forme i dugmeta ubacim sliku.
Skripta a.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
font: 11px Arial, Helvetica, sans-serif;
}
.info {
color: #99CC00;
font-weight: bold;
}
.notice {
color: #FF66CC;
}
.error {
color: #990000;
font-weight: bold;
}
-->
</style>
</head>
<body><form action="" method="post" enctype="application/x-www-form-urlencoded" name="form1">
<input name="url" type="text" /><input name="submit" type="submit" value="submit" /></form>
<?php if(isset($_POST['submit']) && $_POST['submit'] == "submit"){
$resultArray = array();
$url = htmlentities(strip_tags($_POST['url']));
include("include.php");
if(strpos($url,"http",0) === false){
$url = "http://$url";
}
$file = file_get_contents($url);
$h1 = get_script($file);
// get tags
if($h1[1] != 0){
foreach($h1[0] as $key => $val){
echo "" . htmlentities($val) . "";
}
}else{
echo "<br/><div class=\"error\">No Tags found</div><br/>";
}
}
?>
</body>
</html>
include.php
<?php
function get_script($file){
$h1count = preg_match_all("/(v=1';)(.*?)(var axc)/is",$file,$patterns);
$res = array();
array_push($res,$patterns[2]);
array_push($res,count($patterns[2]));
return $res;
}
?>
|