Web Development
 
Your Ad Here
Clear present browser history 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>

<SCRIPT LANGUAGE="JavaScript">
function myhistory(url) {
if (document.images)
location.replace(url);
else
location.href = url;
}
</SCRIPT>
</head>

<body>

<a href="javascript:myhistory('test1.php')">Next Place</a>

</body>
</html>


[ add comment ] ( 5 views )   |  permalink  |   ( 2.8 / 176 )
Convert size of file to the largest unit 
function convert_size($size)
{
$filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB");
return round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i];
}


[ add comment ] ( 3 views )   |  permalink  |   ( 3 / 173 )
Send Email with PHP 
$subject = '';
$message = '';
$header = 'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'From: John Doe <no-reply@dpwebservices.com>' . "\r\n" .
'Reply-To: no-reply@dpwebservices.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail('someone@dpwebservices.com', $subject, $message, $header);


[ add comment ] ( 4 views )   |  permalink  |   ( 2.9 / 160 )
Ajax example 
function ajax_get(ctnid) { 
if (ua.indexOf('msie') != -1) {
ajax_get_request = new ActiveXObject("Msxml2.XMLHTTP");
} else {
ajax_get_request = new XMLHttpRequest();
}
ajax_get_request.onreadystatechange = function ajax_get_xml() {
if (ajax_get_request.readyState == 4) {
if (ajax_get_request.status == 200) {
var number_of_items = ajax_get_request.responseXML.getElementsByTagName("item").length;
var item_id = ajax_get_request.responseXML.getElementsByTagName("id");
if (number_of_ajax > 0) {
for (var i=0; i < number_of_items; i++) {
// do something
}
} else {
// do something
}
} else {
alert("There was an error while retrieving the URL: " + ajax_get_request.statusText);
}
}
return true;
}
ajax_get_request.open("POST", "/path/to/your/php/script", true);
ajax_get_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
//ctnid is a variable that is being passed
ajax_get_request.send("ctnid="+ctnid);
}


Your php script would need to return a valid XML document. In the example, something like:


<items>
<item>
<id>1</id>
</item>
<item>
<id>2</id>
</item>
</items>


[ add comment ] ( 6 views )   |  permalink  |   ( 3.2 / 208 )
Welcome! 
This blog will contain sample code for PHP, javascript and flash.

[ add comment ] ( 2 views )   |  permalink  |   ( 3.2 / 180 )

<<First <Back | 1 | 2 | 3 | 4 | Next> Last>>


Home | Portfolio | Hosting | Web Development | Contact Us
© 2007 dpwebservices.net. All right reserved.