Get the Current page Title, Description and Url using JavaScript

<div id="Box">
<script type="text/javascript">
<!--
var a = (document.title);
var b = (document.location.href);
var c = document.getElementsByTagName('meta');
var description;

for (var x=0,y=c.length; x<y; x++) {
  if (c&#91;x&#93;.name.toLowerCase() == "description") {
    description = c&#91;x&#93;;
  }
}

document.write('<a href="'+b+'">'+a+'<\/a><br />'+description.content+'<br />');
document.write('<span id="green">'+b+'<\/span>');
//-->
</script>
</div>

Source:
http://daydreamingonline.com/demos/javascript/title_and_url/

Mootools – not finished

http://mootools.net/
MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.

Remote full backup using cron job

If you want to make a Full Backup using cron job and transfer it via ftp to a remote server, you can use this script
Download it from here :
fullbackup.php
extract the file and open fullbackup.php and configure the following lines

// ********* THE FOLLOWING ITEMS NEED TO BE CONFIGURED *********

// Info required for cPanel access
$cpuser = "*********"; // Username used to login to CPanel
$cppass = "*********"; // Password used to login to CPanel
$domain = "*********"; // Domain name where CPanel is run
$skin = "x3"; // Set to cPanel skin you use (script won't work if it doesn't match). Most people run the default x theme

// Info required for FTP host
$ftpuser = "***************"; // Username for FTP account
$ftppass = "***************"; // Password for FTP account
$ftphost = "***************"; // Full hostname or IP address for FTP host
$ftpmode = "ftp"; // FTP mode ("ftp" for active, "passiveftp" for passive)
$ftpport = "21";
$ftpdir = "/";

save it and upload to your home directory and login to your Cpanel and add this line to the cron job

/usr/local/bin/php /home/xxx-your directory-xxx/fullbackup.php

have fun

PHP/MYSQL DATE Search – BETA

<?php
//2008-10-14 00:00:00
$beginDate = date("Y-m-d H:i:s", strtotime( $_POST&#91;'beginDate'&#93;));
$endDate = date("Y-m-d H:i:s", strtotime( $_POST&#91;'endDate'&#93;));

$query="SELECT Email FROM Customer WHERE UDFDate2 BETWEEN '$beginDate' AND '$endDate' ";
?>

How to Show hide toggle display a DIV using javascript?

If you want to show/hide a div, you are on the right place here is an example


<input type=button value="Please click here" onClick="javascript:toggle()">
<script>
function toggle(){
	var div1 = document.getElementById('welcomeform')
	if (div1.style.display == 'none') {
		div1.style.display = 'block'
	} else {
		div1.style.display = 'none'
	}
}
</script>
<div id="welcomeform" style="display:none;">Welcome :-)</div>

Preventing A Form To Submit If A Field Is Empty

With this code, it alerts the user when the form is empty, but still submits it when the user clicks [OK]

<script type="text/javascript" language="JavaScript">
function nameempty()
{
        if ( document.formname.name.value == '' )
        {
                alert('No name was entered!')
                return false;
        }
}
</script>

<form action="submit.php" method="post" name="formname" onsubmit="return nameempty();">
<input type="text" name="name" class="textfield">
<input type="submit" value="Submit" name="submit">
</form>
Page 2 of 3123

Pin It on Pinterest