Last active
August 29, 2015 14:04
-
-
Save mucahit/c28c64e273597ad3a97e to your computer and use it in GitHub Desktop.
dipnot : postla alınan değerlere filtreleme uygulanmamıştır
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class method{ | |
public $return; | |
public $values = []; | |
//POST method function | |
public function post($names){ | |
$type = gettype($names); | |
if($type == 'array') | |
{ | |
//value type array | |
$count = count($names); | |
foreach($names as $name){ | |
$name = $name; | |
$this->values[] = $name; | |
$this->return = true; | |
} | |
for ($i=0; $i < $count; $i++) { | |
if(empty($this->values[$i])) | |
{ | |
$this->return = false; | |
} | |
} | |
}else{ | |
//value type don't array | |
$this->values = $names; | |
if(empty($this->values)) | |
{ | |
$this->return = false; | |
}else{ | |
$this->return = true; | |
} | |
} | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$m = new method; | |
$m->post([$_POST['userid'],$_POST['password']]); | |
if($m->return == true){ | |
extract($m->values,EXTR_PREFIX_INVALID,'var'); | |
echo 'Username : '.$var_0.' / Password : '.$var_1; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment