Skip to content

Instantly share code, notes, and snippets.

@mucahit
Last active August 29, 2015 14:04
Show Gist options
  • Save mucahit/c28c64e273597ad3a97e to your computer and use it in GitHub Desktop.
Save mucahit/c28c64e273597ad3a97e to your computer and use it in GitHub Desktop.
dipnot : postla alınan değerlere filtreleme uygulanmamıştır
<?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;
}
}
}
}
?>
<?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