!c99Shell v. 1.0 pre-release build #16!

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

/var/www/html/mis2222/ums/js/   drwxr-xr-x
Free 52.3 GB of 127.8 GB (40.92%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     form_validation.js (28.08 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!--

function formatCurrency(num) 
{
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num)) num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10) cents = "0" + cents;
	//for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	//	num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));
	
	return (((sign)?'':'-') + num + '.' + cents);
}
/* 
	LTrim - Trims whitespace from left of a string
*/
function LTrim(str)
{
	var whitespace = new String(" \t\n\r");

	var s = new String(str);

	if (whitespace.indexOf(s.charAt(0)) != -1) 
	{
		var j=0, i = s.length;
		while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
		{
			j++;
		}
		s = s.substring(j, i);
	}

	return s;
}

/*
	RTrim - Trims whitespace from right of a string
*/
function RTrim(str)
{
	var whitespace = new String(" \t\n\r");

	var s = new String(str);

	if (whitespace.indexOf(s.charAt(s.length-1)) != -1) 
	{
		var i = s.length - 1;       // Get length of string
		while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
		i--;
		s = s.substring(0, i+1);
	}

	return s;
}

/*
	Trim - Trims whitespace from left and right of a string
*/  
function Trim(str)
{
	return RTrim(LTrim(str));
}

/*
	AlertFocusFalse -
		1. Alerts ErrorStr argument
		2. Sets focus to FormName.ElementName
		3. Returns false
*/
function AlertFocusFalse(ErrorStr, FormElement)
{
	try {
		alert(ErrorStr);
		eval(FormElement.focus());
		eval(FormElement.select());
		return false;
	} catch(passedVar) { return false;}
}

/*
	ValidZipCode - true for valid zip codes, false for invalid ones
*/
function ValidZipCode(ZipCode)
{
	//Your zip code must contain 5 or 9 digits.  9 digit zip codes should contain no spaces and a hyphen before the last 4 digits.
	
	var stringValue = new String(ZipCode);
	var stringLength = stringValue.length;
	
	if ((stringLength!=5)&&(stringLength!=9)&&(stringLength!=10))
	{
		return false;
	}

	if(stringLength==5)
	{
		
		for (var i = 0; i < stringLength; i++)
		{
			value = stringValue.charAt(i)
			if (!((value >= 0) && (value <=9)))
			{
				return false;
			}
		}
	}
	
	if(stringLength==9)
	{
		for (var i = 0; i < stringLength; i++)
		{
			value = stringValue.charAt(i)
			if (!((value >= 0) && (value <=9)))
			{
				return false;
			}
		}
	}

	if(stringLength==10)
	{
		var zip=stringValue.substring(0,5)
		var symbol=stringValue.substring(5,6)
		var plus4=stringValue.substring(6,10)
	
		if(symbol!="-")
		{
			return false;
			
		}
			
			
		for (var i = 0; i < zip.length; i++)
		{
			value = zip.charAt(i)
			if (!((value >= 0) && (value <=9)))
			{
				return false;
			}
		}
		for (var i = 0; i < plus4.length; i++)
		{
			value = plus4.charAt(i)
			if (!((value >= 0) && (value <=9)))
			{
				return false;
			}
		}
		
	}
	return true;
}

/*
	ValidEmail - true for valid email, false for invalid
*/
function ValidEmail(EmailAddr) {
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
	
	var SpecChar="!#$%^&*()'+{}[]\|:;?/><,~`" + "\"";
	var frmValue = new String(EmailAddr);
	var len = frmValue.length;
	
	if( len < 1 ) { return false; }
	for (var i=0;i<len;i++)
	{
				temp=frmValue.substring(i,i+1)
				if (SpecChar.indexOf(temp)!=-1)
		 		{
					return false;
				}
	}	
	
	if(!reg1.test(frmValue) && reg2.test(frmValue)) 
	{ 
		return true;
	}
	
	return false;
}

/*
	IsNumeric - true for all numeric, false if not
*/
function IsNumeric(PossibleNumber)
{
	var PNum = new String(PossibleNumber);
	var regex = /[^0-9]/;
	return !regex.test(PNum);
}

/*
	ValidPhoneNumber - true for valid phone number, false for invalid
*/
function ValidPhoneNumber(PhoneNumber)
{
	var PNum = new String(PhoneNumber);
	
	//	555-555-5555
	//	(555)555-5555
	//	(555) 555-5555
	//	555-5555
	var regex = /^[0-9]{3,3}\-[0-9]{3,3}\-[0-9]{4,4}$|^\([0-9]{3,3}\) [0-9]{3,3}\-[0-9]{4,4}$|^\([0-9]{3,3}\)[0-9]{3,3}\-[0-9]{4,4}$|^[0-9]{3,3}\-[0-9]{4,4}$/;
	
	return regex.test(PNum);
}

/*
	ValidSSN - true for valid SSN, false for invalid
*/
function ValidSSN(SSN)
{
	var SSNum = new String(SSN);
	
	var regex = /^[0-9]{3,3}\-[0-9]{2,2}\-[0-9]{4,4}$/;
	
	return regex.test(SSNum);
}

/*
	ValidDate - true for valid date, false for invalid
*/
function IsValidDate(PossibleDate)
{
	var PDate = new String(PossibleDate);
	
	var regex = /(^\d{1,2})\/(\d{1,2})\/(\d{4,4})|(^\d{1,2})\/(\d{1,2})\/(\d{2,2})/;
	
	if( regex.test(PDate) )
	{
		var month = new String(RegExp.$1);
		var day = new String(RegExp.$2);
		var year = new String(RegExp.$3);
		if( month.length == 0 )
		{
			month = new String(RegExp.$4);
			day = new String(RegExp.$5);
			year = new String(RegExp.$6);
		}
		
		var today = new Date();
		var thisYear = new String(today.getFullYear());
		
		if( year.length == 2 )
		{					
			if( year > 50 )
			{
				year = String(Number(thisYear.substring(0,2))-1) + year;
			}
			else
			{
				year = thisYear.substring(0,2) + year;
			}
		}
		
		if( month < 1 || month > 12 ) { return false; }

		if( day < 1 || day > 31 ) { return false; }

		if ((month==4 || month==6 || month==9 || month==11) && day>30) { return false; }

		if (month == 2) // check for february 29th
		{ 
			var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
			if (day>29 || (day==29 && !isleap)) 
			{
				return false;
			}
		}		
		
		if( (Number(year) < Number(thisYear) - 250) ||
			(Number(year) > Number(thisYear) + 250) )
			{ return false; }
			
		return true;
	}
	return false;
}


/*
	FncJIsEmpty - 
		if inputStr is empty, the focus is set to FormName.ElementName and
		an alert message is given
*/
function FncJIsEmpty(inputStr, FormName, ElementName, Label)
{
	if (Trim(inputStr) == "")
	{ 
		alert(Label + " is required to complete this form!");
		eval("self.parent.document." + FormName+ "." + ElementName + ".focus();")
		eval("self.parent.document." + FormName+ "." + ElementName + ".select();")
		return true;
	}
	          
	return false;
}

function FncJIsDate(dateStr, ofield, minYear, maxYear, minDays, maxDays){
// Checks for the following valid date formats:
// MM/DD/YY   MM/DD/YYYY   MM-DD-YY   MM-DD-YYYY 
// longmonth  January 5, 1999  
// shortmonth Jan 5, 1999
var myDate = new String(dateStr)
var longmonth = /^(january|february|march|april|may|june|july|august|september|october|november|december)(\s*)(\d{1,2})(\,\s*)(\d{2}|\d{4})$/;
var shortmonth = /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(\s*)(\d{1,2})(\,\s*)(\d{2}|\d{4})$/;
var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;
var docStr
myDate.value = myDate.toLowerCase();
//long month
var matchArray1 = myDate.value.match(longmonth); 
if (matchArray1 != null) {	
	month = monthto(matchArray1[1]);
	day = matchArray1[3];
	year = yearfourdigit(matchArray1[5]);
	if ((ismonthok(month)) && (isdayok(day, month))){		
		// date is valid
		if (!checkrange(minYear, maxYear, minDays, maxDays, month, day, year)){
			return false;
		}
		ofield.value = month + "/" + day + "/" + year;
		return true; 		
	}else {
		return false;
	}
}
//short month
var matchArray2 = myDate.value.match(shortmonth); 
if (matchArray2 != null) {	
	month = monthto(matchArray2[1]);
	day = matchArray2[3];
	year = yearfourdigit(matchArray2[5]);
	if  (isdayok(day, month)){		
		// date is valid
		if (!checkrange(minYear, maxYear, minDays, maxDays, month, day, year)){
			return false;
		}
		ofield.value = month + "/" + day + "/" + year;
		return true;		
	}else {
		return false;
	}
}
//standard date
var matchArray3 = myDate.value.match(datePat); 
if (matchArray3 == null) {
	return false;
}
month = matchArray3[1]; // parse date into variables
day = matchArray3[3];
year = yearfourdigit(matchArray3[4]);
	if ((ismonthok(month)) && (isdayok(day, month))){		
		// date is valid
		if (!checkrange(minYear, maxYear, minDays, maxDays, month, day, year)){
			return false;
		}		
		ofield.value = month + "/" + day + "/" + year;
		return true;
		
	}else{
		return false;
	}
return true;
}

/*
	ZipCheck - Validates ZipCode
*/
function ZipCheck(formName, field)
{
	var stringValue = eval("document." + formName + "." + field + ".value")
	var stringLength = stringValue.length
	
	if ((stringLength!=5)&&(stringLength!=9)&&(stringLength!=10))
	{
		if(stringLength==0)
		{
			alert("Zip code is a required field")
			if (top != self){		
				eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".focus();")
				eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".select();")
			}
			else{		
				eval("self.parent.document." + formName + "." + field + ".focus();")
				eval("self.parent.document." + formName + "." + field + ".select();")
			}	
			return true;
		}
		else
		{
			alert("Your zip code must contain 5 or 9 digits.  9 digit zip codes should contain no spaces and a hyphen before the last 4 digits.")
			if (top != self){		
				eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".focus();")
				eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".select();")
			}
			else{		
				eval("self.parent.document." + formName + "." + field + ".focus();")
				eval("self.parent.document." + formName + "." + field + ".select();")
			}	
			return true;
		}
	}

	if(stringLength==5)
	{
		for (var i = 0; i < stringLength; i++)
		{
			value = stringValue.charAt(i)
			if (!((value >= 0) && (value <=9)))
			{
				alert("Your zip code must contain 5 or 9 digits.  9 digit zip codes should contain no spaces and a hyphen before the last 4 digits.")
				eval("document." + formName + "." + field + ".focus();")
				eval("document." + formName + "." + field + ".select();")
				return true;
			}
		}
	}
	
	if(stringLength==9)
	{
		for (var i = 0; i < stringLength; i++)
		{
			value = stringValue.charAt(i)
			if (!((value >= 0) && (value <=9)))
			{
				alert("Your zip code must contain 5 or 9 digits.  9 digit zip codes should contain no spaces and a hyphen before the last 4 digits.")
				eval("document." + formName + "." + field + ".focus();")
				eval("document." + formName + "." + field + ".select();")
				return true;
			}
		}
	}

	if(stringLength==10)
	{
		var zip=stringValue.substring(0,5)
		var symbol=stringValue.substring(5,6)
		var plus4=stringValue.substring(6,10)
	
		if(symbol!="-")
		{
			alert("Your zip code must contain 5 or 9 digits.  9 digit zip codes should contain no spaces and a hyphen before the last 4 digits.")
			if (top != self){		
				eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".focus();")
				eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".select();")
			}
			else{		
				eval("self.parent.document." + formName + "." + field + ".focus();")
				eval("self.parent.document." + formName + "." + field + ".select();")
			}	
			return true;
			
		}
			
			
		for (var i = 0; i < zip.length; i++)
		{
			value = zip.charAt(i)
			if (!((value >= 0) && (value <=9)))
			{
			
				alert("Your zip code must contain 5 or 9 digits.  9 digit zip codes should contain no spaces and a hyphen before the last 4 digits.")
				if (top != self){		
					eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".focus();")
					eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".select();")
				}
				else{		
					eval("self.parent.document." + formName + "." + field + ".focus();")
					eval("self.parent.document." + formName + "." + field + ".select();")
				}	
				return true;
			}
		}
		for (var i = 0; i < plus4.length; i++)
		{
			value = plus4.charAt(i)
			if (!((value >= 0) && (value <=9)))
			{
			
				alert("Your zip code must contain 5 or 9 digits.  9 digit zip codes should contain no spaces and a hyphen before the last 4 digits.")
				if (top != self){		
					eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".focus();")
					eval("self.parent." + plFrameName + ".document." + formName + "." + field + ".select();")
				}
				else{		
					eval("self.parent.document." + formName + "." + field + ".focus();")
					eval("self.parent.document." + formName + "." + field + ".select();")
				}	
				return true;
			}
		}
		
	}
	return false;
}

/*
	FncJIsEmail - validates email
*/
function FncJIsEmail(str, FormName, ElementName, label) {
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
	
	var SpecChar="!#$%^&*()'+{}[]\|:;?/><,~`" + "\""
	var frmValue = eval("document." + FormName + "." + ElementName + ".value")
	var len = frmValue.length
	for (var i=0;i<len;i++)
	{
				temp=frmValue.substring(i,i+1)
				if (SpecChar.indexOf(temp)!=-1)
		 		{
					alert(frmValue +" is an invalid email address.");
					if (top != self){		
						eval("self.parent." + plFrameName + ".document." + FormName + "." + ElementName + ".focus();")
						eval("self.parent." + plFrameName + ".document." + FormName + "." + ElementName + ".select();")
					}
					else{		
						eval("self.parent.document." + FormName + "." + ElementName + ".focus();")
						eval("self.parent.document." + FormName + "." + ElementName + ".select();")
					}	
					return false;
				}
	}	
	
	if (!reg1.test(str) && reg2.test(str)) { 
	   return true;
	}
    alert("\"" + str + "\" is an invalid " + label + "."); 
    if (top != self){		
		eval("self.parent." + plFrameName + ".document." + FormName + "." + ElementName + ".focus();")
		eval("self.parent." + plFrameName + ".document." + FormName + "." + ElementName + ".select();")
	}
	else{		
		eval("self.parent.document." + FormName + "." + ElementName + ".focus();")
		eval("self.parent.document." + FormName + "." + ElementName + ".select();")
	}	
	return false;
}

function isDigit(nKeyCode)
{
	// Test for digit keycode (0-9).
   if((nKeyCode > 47) && (nKeyCode <  58))
   {
      return true;
   }
   
   return false;
}

function ValidDate(dateStr, formname, elementname, minYear, maxYear, minDays, maxDays){
// Checks for the following valid date formats:
// MM/DD/YY   MM/DD/YYYY   MM-DD-YY   MM-DD-YYYY 
// longmonth  January 5, 1999  
// shortmonth Jan 5, 1999
var myDate = new String(dateStr)
var longmonth = /^(january|february|march|april|may|june|july|august|september|october|november|december)(\s*)(\d{1,2})(\,\s*)(\d{2}|\d{4})$/;
var shortmonth = /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(\s*)(\d{1,2})(\,\s*)(\d{2}|\d{4})$/;
var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;
var docStr
if (top != self){
	docStr = "self.parent." + plFrameName + ".document."
}else {
	docStr = "self.parent.document."
}
myDate.value = myDate.toLowerCase();
//long month
var matchArray1 = myDate.value.match(longmonth); 
if (matchArray1 != null) {	
	month = monthto(matchArray1[1]);
	day = matchArray1[3];
	year = yearfourdigit(matchArray1[5]);
	if ((ismonthok(month)) && (isdayok(day, month))){		
		// date is valid
		if (!checkrange(minYear, maxYear, minDays, maxDays, month, day, year)){
			eval(docStr + formname + "." + elementname + ".focus();");
			eval(docStr + formname + "." + elementname + ".select();");
			return false;
		}
		eval(docStr + formname + "." + elementname + ".value = '" + month + "/" + day + "/" + year + "';");
		return true; 		
	}else {
		eval(docStr + formname + "." + elementname + ".focus();");
		eval(docStr + formname + "." + elementname + ".select();");
		return false;
	}
}
//short month
var matchArray2 = myDate.value.match(shortmonth); 
if (matchArray2 != null) {	
	month = monthto(matchArray2[1]);
	day = matchArray2[3];
	year = yearfourdigit(matchArray2[5]);
	if  (isdayok(day, month)){		
		// date is valid
		if (!checkrange(minYear, maxYear, minDays, maxDays, month, day, year)){
			eval(docStr + formname + "." + elementname + ".focus();");
			eval(docStr + formname + "." + elementname + ".select();");
			return false;
		}
		eval(docStr + formname + "." + elementname + ".value = '" + month + "/" + day + "/" + year + "';");
		return true;		
	}else {
		eval(docStr + formname + "." + elementname + ".focus();");
		eval(docStr + formname + "." + elementname + ".select();");
		return false;
	}
}
//standard date
var matchArray3 = myDate.value.match(datePat); 
if (matchArray3 == null) {
	alert("Date is not in a valid format.");
	eval(docStr + formname + "." + elementname + ".focus();");
	eval(docStr + formname + "." + elementname + ".select();");
	return false;
}
month = matchArray3[1]; // parse date into variables
day = matchArray3[3];
year = yearfourdigit(matchArray3[4]);
	if ((ismonthok(month)) && (isdayok(day, month))){		
		// date is valid
		if (!checkrange(minYear, maxYear, minDays, maxDays, month, day, year)){
			eval(docStr + formname + "." + elementname + ".focus();");
			eval(docStr + formname + "." + elementname + ".select();");
			return false;
		}		
		eval(docStr + formname + "." + elementname + ".value = '" + month + "/" + day + "/" + year + "';");
		return true;
		
	}else{
		eval(docStr + formname + "." + elementname + ".focus();");
		eval(docStr + formname + "." + elementname + ".select();");
		return false;
	}
return true;
}

//check month range
function ismonthok(month){
if (month < 1 || month > 12) {
	alert("Month must be between 1 and 12.");
	return false;
}
return true;
}
//check day range
function isdayok(day, month){
if (day < 1 || day > 31) {
	alert("Day must be between 1 and 31.");
	return false;
}

if ((month==4 || month==6 || month==9 || month==11) && day==31) {
	alert("Month "+month+" doesn't have 31 days!");
	return false;
}
if (month == 2) { // check for february 29th
	var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
	if (day>29 || (day==29 && !isleap)) {
		alert("February " + year + " doesn't have " + day + " days!");
		return false;
	}
}
return true;
}
//convert month name to number
function monthto(m){	
	switch (m) {
	case "jan": 
	case "january": 		
		return 1;		
	case "feb": 
	case "february": 
		return 2;		
	case "mar": 
	case "march": 
		return 3;		
	case "apr": 
	case "april": 
		return 4;		
	case "may": 
		return 5;		
	case "jun": 
	case "june": 
		return 6;		
	case "jul": 
	case "july": 
		return 7;		
	case "aug": 
	case "august": 
		return 8;		
	case "sep": 
	case "september": 
		return 9;		
	case "oct": 
	case "october": 
		return 10;		
	case "nov":  
	case "november": 
		return 11;		
	case "dec": 
	case "december": 
		return 12;			
	}
}

//check passed range
function checkrange(minYear, maxYear, minDays, maxDays, mm, dd, yyyy){
	var today = new Date()
	if (!minYear) {
		// function called with specific day range parameters
		var formdate = new String(mm + "/" + dd + "/" + yyyy)
		var testDate = new Date(formdate)
		if (testDate.getTime() < (today.getTime() + (minDays * 24 * 60 * 60 * 1000))) {
			alert("The most likely range for this entry begins " + minDays + " days from today.")
		}
		if (testDate.getTime() > today.getTime() + (maxDays * 24 * 60 * 60 * 1000)) {
			alert("The most likely range for this entry ends " + maxDays + " days from today.")
		}
	} else if (minYear && maxYear) {
		// function called with specific year range parameters
		if (yyyy < minYear || yyyy > maxYear) {
			// entered year is outside of range passed from calling function
			alert("The most likely range for this entry is between the years " + minYear + " and " + maxYear + ".  Please check that you have entered the correct date.")
			return false;
		}
	} else {
		// default year range (now set to (this year - 100) and (this year + 25)
		var thisYear = today.getYear()
		if (thisYear < 100) {
			thisYear += 1900;
		}
		if (yyyy < minYear || yyyy > maxYear) {
			alert("It is unusual for a date entry to be before " + minYear + " or after " + maxYear + ". Please verify this entry.");
			return false;
		}
	}
	return true;
}

//convert yy to yyyy
function yearfourdigit(yyyy){	
	if (yyyy < 100) {
		// entered value is two digits, which we allow for 1930-2029
		if (yyyy >= 30) {
			yyyy = "19" + yyyy;
			
		} else {
			yyyy = "20" + yyyy;			
		}
	}
	return yyyy;
}

// Make sure a state is valid.
function ValidState(sstate) {
	sstates = "wa|or|ca|ak|nv|id|ut|az|hi|mt|wy" +
				"co|nm|nd|sd|ne|ks|ok|tx|mn|ia|mo" +
				"ar|la|wi|il|ms|mi|in|ky|tn|al|fl" +
				"ga|sc|nc|oh|wv|va|pa|ny|vt|me|nh" +
				"ma|ri|ct|nj|de|md|dc";
	
	if (sstates.indexOf(sstate.toLowerCase() + "|") > -1) {
		return true;
		}
	
	return false;
	}
	
// Validate a field.
function ValidateField(ofield, avalidate, required, scustomerr) {
	
	/*	ofield	  : Object to validate.

		avalidate : One of the following:
		=================================		
		"currency"	Makes sure item is a dollar amount and formats the
					field as XXX.XX
		
		"date"		Validates date and formats date with 4 digit year.
					Accepts XX-XX-XX[XX] XX/XX/XX[XX] Jan XX, XXXX January XX, XXXX
		
		["date",<minyear>,<maxyear>,<mindays>,<maxdays>]
		
					Validates date, only allowing years between <minyear> and
					<maxyear> and dates that are not fewer than <mindays> away
					and not more than <maxdays> away.
					
					<mindays> and <maxdays> are optional.  Also formats date with
					4 digit year.
		
		"email"		Accepts *@*.*

		"empty"		Returns an error if field is empty.
		
		"numeric"	Checks for a number.
		
		"phone"		Validates phone number.
		
		["range",<from>,<to>]
		
					Verifies that field value is between <from> and <to>.
					Numeric and alpha ranges acceptable.
					
		"ssn"		Social Security Number.
		
		"selected"	COMBO BOXES ONLY.  Makes sure that an option is selected and
					that the option value is not "".
		
		"url"		Accepts http://*.*.*[/*]
		
		
		required : True/False -- Is this a required field, or can it be left blank?
		
		scustomerr : If specified, this message is return turned instead of the
					 standard error message for the passed field type.			
																				*/
														
	var serror = ""		// Error message to display.
			
	if (typeof(avalidate) == "object") {
		serror = ValidateItems(ofield, avalidate)
		}
	else {
		serror = ValidateItem(ofield, avalidate)
		}
		
	if (ofield.value == "" && required) {
		serror = "This is a required field."
		}
		
	if (serror != "") {
		if (typeof(scustomerr) != "undefined") {
			AlertFocusFalse(scustomerr, ofield)		
			}
		else {
			AlertFocusFalse(serror, ofield)		
			}
		return false
		}
	
	return true
	}

function ValidateItem(ofield, svalidate, required) {

	var serror = ""
	
	// What kind of validation are we performing?
	switch (svalidate) {
		case "currency":
			if (!IsNumeric(ofield.value) && ofield.value != "") {
				serror = "Invalid amount."
				}
			else {
				ofield.value = formatCurrency(ofield.value)
				}
			break
		case "date":
			if (!FncJIsDate(ofield.value, ofield) && ofield.value != "") {
				serror = "Invalid date."
				}
			break
		case "empty":
			if (ofield.value == "") {
				serror = "This is a required field."
				}
			break
		case "email":
			if (!ValidEmail(ofield.value) && ofield.value != "") {
				serror = "Invalid email address."
				}
			break
		case "number":
			if (!IsNumeric(ofield.value) && ofield.value != "") {
				serror = "Value must be a number."
				}
			break
		case "phone":
			if (!ValidPhoneNumber(ofield.value) && ofield.value != "") {
				serror = "Invalid phone number."
				}
			break
		case "selected":
			// Make sure an element of a drop-down is selected.
			valid = true
			if (ofield.selectedIndex < 0) {
				valid = false
				}
			else if (ofield.options[ofield.selectedIndex].value == "") {
				valid = false
				}
			if (!valid) {
				serror = "Please select an item from the list."
				}
			break
		case "url":
			// Must match: http://*.*.*
			s = ofield.value.toLowerCase()
			valid = true
			if (s.substr(0, 7) == "http://") {
				dot1 = s.indexOf(".")
				if (dot1 > -1) {
					dot2 = s.indexOf(".", dot1 + 1)
					if (dot2 > -1) {
						dot3 = s.indexof(".", dot2 + 1)
						}
					else {
						valid = false
						}						
					}
				else {
					valid = false
					}
				if (valid) {
					if (dot1 > 6 && dot2 > dot1 && dot3 > dot2) {
						valid = false
						}
					else {
						valid = false
						}
					}
				else {
					valid = false
					}
				}
			else {
				valid = false
				}
			if (!valid) {
				serror = "Valid URL format is: http://www.mysite.com/"
				}
			break
		case "zip":
			if (!ValidZipCode(ofield.value) && ofield.value != "") {
				serror = "Invalid zip code."
				}
			break
		case "state":
			// Make state field value uppercase.
			ofield.value = ofield.value.toUpperCase()
			if (!ValidState(ofield.value) && ofield.value != "") {
				serror = "Invalid state."
				}
			break
		} 
			
	return serror
	}

function ValidateItems(ofield, avalidate, required) {
	
	var serror = ""
	
	// What kind of validation are we performing?

	switch (avalidate[0]) {
		case "date":
			// Verify a date is valid and format it nicely if it is.
			if (!FncJIsDate(ofield.value, ofield, avalidate[1], avalidate[2], avalidate[3], avalidate[4])) {
				serror = "Invalide date."
				}
			break
		case "range":
			// Check if passed field value is between a given range.
			// The range can be numeric (i.e., 1 to 20) or alpha
			// (i.e. 'a to f'), but if it is alpha the range must be
			// is not case sensitive.
			
			if (IsNumeric(ofield.value) && IsNumeric(avalidate[1]) && IsNumeric(avalidate[2])) {
				if (ofield.value < avalidate[1] || ofield.value > avalidate[2]) {
					serror = "Value must be between " + avalidate[1] + " and " + avalidate[2] + "."
					}
				}
			else if (!IsNumeric(ofield.value) && !IsNumeric(!avalidate[1]) && !IsNumeric(avalidate[2])) {
				if (ofield.value.toLowerCase() < avalidate[1] || ofield.value.toLowerCase() > avalidate[2]) {
					serror = "Value must be between '" + avalidate[1] + "' and '" + avalidate[2] + "'."
					}
				}
			else {
				if (IsNumeric(avalidate[1])) {
					serror = "Value must be between " + avalidate[1] + " and " + avalidate[2] + "."
					}
				else {
					serror = "Value must be between '" + avalidate[1] + "' and '" + avalidate[2] + "'."
					}
				}
		}
	
	return serror
	
	}

// Check form for all required fields.
function RequiredFields(required)
{
	// Parameters:
	//		required		array of [fieldname, description] arrays.
	//						Example: [['firstname', 'First Name'],
	//									['lastname', 'Last Name']]
	//						fieldname is the name of the field to check,
	//						description is a more descriptive name that
	//							will be shown in the event of errors.
	
	sFailed = "";
	bPassed = true;
	for (i = 0; i < required.length; i++)
	{			
		if (document.getElementById(required[i][0]).value == "")
		{
			// Required field missing.
			bPassed = false;
			if (sFailed == "")
			{
				sFailed = required[i][1];
			}
			else
			{
				sFailed += "\n" + required[i][1];
			}
		}
	}
			
	if (!bPassed)
	{
		// Show missing required fields.
		alert("The following required fields were not completed:\n\n"
				+ sFailed);
	}
		
	return bPassed
}

function Today()
{
	// Returns today's date formatted as MM/DD/YYYY.

	SysDate = new Date();

	var onetsacpe;
	var addyears;
	onetscape = (document.all)?false:true;
	if (onetscape)
	{	
		addyears = 1900;
	}
	else
	{
		addyears = 0;
	}
	
	var curDate = (SysDate.getMonth() + 1) + "/" + SysDate.getDate() + "/" + (SysDate.getYear() + addyears);
	var curMonth = SysDate.getMonth() + 1;
	var curDay = SysDate.getDate();
	var curYear = SysDate.getYear() + addyears;

	return curDate

}

// Takes the value of a text box and adds slashes
// if there are none to the date.
function FormatDate(o)
{
	d = o.value;

	if(d.indexOf("/")==-1)
	{
		if(d.length==8)
		{
			o.value = d.substring(0,2) + "/" + d.substring(2,4) + "/" + d.substring(4);
		}
	}
}
//-->

:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0069 ]--