[ create a new paste ] login | about

Link: http://codepad.org/ZeTuj707    [ raw code | output | fork ]

PHP, pasted on Dec 16:
<?php
if( isset($_GET) && !empty($_GET['W']) ){
    $url = md5($_GET['w']);
    if(!is_file('/hit_counters/'.$url.'.txt')){
        $fh= fopen('/hit_counters/'.$url.'.txt', 'w');
        fwrite('1',$fh);
        fclose($fh);
    }else{
        $hits = file_get_contents('/hit_counters/'.$url.'.txt');
        $hits++;
        file_put_contents('/hit_counters/'.$url.'.txt', $hits);
    }
}
?>

<!DOCTYPE html>
<meta charset="UTF-8">

<title></title>

<link rel="stylesheet" href="styles.css" type="text/css" />

</head>

<body>

<form>

<span>http://www.</span><input type="txt" name="w" value="colindunn.com" />
<input type="submit" value="Submit" />

</form>

<div>
<iframe src="http://<?php echo $url; ?>"></iframe>
</div>

<p>
<?php
if($hits > 25) {
    echo 'More than 25';
}

else {
	echo $hits;
	echo('/25');
	}
?>
</p>

</body>

</html>


Output:

<!DOCTYPE html>
<meta charset="UTF-8">

<title></title>

<link rel="stylesheet" href="styles.css" type="text/css" />

</head>

<body>

<form>

<span>http://www.</span><input type="txt" name="w" value="colindunn.com" />
<input type="submit" value="Submit" />

</form>

<div>
<iframe src="http://"></iframe>
</div>

<p>
/25</p>

</body>

</html>


Create a new paste based on this one


Comments: