<?php
// ファイルãŒã‚ã‚‹ã‹ãƒã‚§ãƒƒã‚¯
$PATH = $_GET['path'];
if(file_exists($PATH)){
$file_exists = true;
}else{
$file_exists = false;
}
echo 'file_exists='.$file_exists;
Tag Archive for check
PHP ファイルãŒå˜åœ¨ã™ã‚‹ã‹ãƒã‚§ãƒƒã‚¯ã™ã‚‹
add Slashes Check Magic quotes function
public function addSlashesCheckMagic($data)
{
if (!get_magic_quotes_gpc())
{
$data = addslashes($data);
}
return $data;
}
script.aculo.us check state by 24ways
Effect.OpenUp = function(element) {
element = $(element);
new Effect.BlindDown(element, arguments[1] || {});
}
Effect.CloseDown = function(element) {
element = $(element);
new Effect.BlindUp(element, arguments[1] || {});
}
Effect.Combo = function(element) {
element = $(element);
if(element.style.display == ‘none’) {
new Effect.OpenUp(element, arguments[1] || {});
}else {
new Effect.CloseDown(element, arguments[1] || {});
}
}
validación de formularios
<script language="JavaScript" type="text/javascript">
//<!--
function checkform(form){
if(form.campo1.value == ""){
alert("Mensaje de alerta 1");
form.campo1.focus();
return false;
}
if(form.campo2.value == ""){
alert("Mensaje de alerta 2");
form.campo2.focus();
return false;
}
return true;
}
//-->
</script>
Check if a value is numeric or not
function checkNumeric(value){
var anum=/(^d+$)|(^d+.d+$)/
if (anum.test(value))
return true;
return false;
}
Check or Uncheck all checkboxes on a form
function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
if(!document.forms[FormName])
return;
var objCheckBoxes = document.forms[FormName].elements[FieldName];
if(!objCheckBoxes)
return;
var countCheckBoxes = objCheckBoxes.length;
if(!countCheckBoxes)
objCheckBoxes.checked = CheckValue;
else
// set the check value for all check boxes
for(var i = 0; i < countCheckBoxes; i++)
objCheckBoxes[i].checked = CheckValue;
}
Php – Validar Fechas
function validarFecha( $fecha, $invertir = 1 ){
if( $invertir == 1 ) $fecha = implode( "-", array_reverse( preg_split( "/D/", $fecha ) ) );
$fecha = explode("-",$fecha);
if( sizeof( $fecha ) != 3 ) return false;
if( checkdate( $fecha[1],$fecha[0],$fecha[2] ) ) return true;
else return false;
}
Does an object have a specific property?
if ("foo" in myObject) {}
Check if integer _value_
/**
* Check if a number is a counting number by checking if it
* is an integer primitive type, or if the string represents
* an integer as a string
*/
function is_int_val($data) {
if (is_int($data) === true) return true;
elseif (is_string($data) === true && is_numeric($data) === true) {
return (strpos($data, '.') === false);
}
return false;
}