Home
Links
 
 
Home Page What is the Web 2.0 Web as a platform Netscape vs. Google DoubleClick vs. Overture and AdSense Akamai vs. BitTorrent Protection of web-services against a spam Server inclusions SSI (a part 1) Realiti Show of Creation of the Website Generation of the casual password What see search engines at call on a site? Visit cajt WebPosition Gold Construction of a site Contextual advertising. Modular structure of page Reception of heading of the removed page The script and processing of events in JavaScript Processing of the events connected to windows, in language javascript Concepts, terms and bases Java-skriptovanija
 

Reception of heading of the removed page

The given script shows as easily and simply to receive heading of the removed page



<? php


$file = fopen ("http://www.php.net/", "r");


if (! $file) {


echo " <p> unable to open remote file.n ";


exit;


}


while (! feof ($file)) {


$line = fgets ($file, 1024);


/* this only works if the title and its tags are on one line */


if (eregi (" <title> (. *) </title> ", $line, $out)) {


$title = $out [1];


break;


}


}


fclose ($file);


?>



The script shows the visitor how much time he has visited page

<script language = "javascript">

<!--


function getcookieval (offset) {

var endstr = document.cookie.indexof (";", offset);

if (endstr ==-1)

endstr = document.cookie.length;

return unescape (document.cookie.substring (offset, endstr));

}


function getcookie (name) {

var arg = name + "=";

var alen = arg.length;

var clen = document.cookie.length;

var i = 0;

while (i <clen) {

var j = i + alen;

if (document.cookie.substring (i, j) == arg)

return getcookieval (j);

i = document.cookie.indexof (" ", i) + 1;

if (i == 0)

break;

}

return null;

}


function setcookie (name, value) {

var argv = setcookie.arguments;

var argc = setcookie.arguments.length;

var expires = (argc> 2)? argv [2]: null;

var path = (argc> 3)? argv [3]: null;

var domain = (argc> 4)? argv [4]: null;

var secure = (argc> 5)? argv [5]: false;

document.cookie = name + "=" + escape (value) +

((expires == null)? " ": ("; expires = " + expires.togmtstring ())) +

((path == null)? " ": ("; path = " + path)) +

((domain == null)? " ": ("; domain = " + domain)) +

((secure == true)? "; secure ": " ");

}


function deletecookie (name) {

var exp = new date ();

fixcookiedate (exp);

exp.settime (exp.gettime () - 1);

var cval = getcookie (name);

if (cval! = null)

document.cookie = name + "=" + cval + "; expires = " + exp.togmtstring ();

}


var expdate = new date ();

var num_visits;

expdate.settime (expdate.gettime () + (5*24*60*60*1000));

if (! (num_visits = getcookie ("num_visits")))

num_visits = 0;

num_visits ++;

setcookie ("num_visits", num_visits, expdate);

//->

</script>


<script language = "javascript">

<!--


document.write (" you have visited this page <font color = " * ff0000 "> <b> " +num_visits + " </b> </font> time (a). ");

//->


</script>





© Web Development Company Conkurent, LLC 2008-2009. All rights reserved.