Hi
I was wondering if it was possible to get the field type of incoming POST data from a form - the reason I'm doing this is because i'm making a file upload function that needs to be triggered if it comes across a $_POST variable coming form a "file" field
I tried using the code below but it doesn't work and the foreach just ignores the data from the "file" field and skips straight to the next one -
so this code
<html>
<head>
</head>
<body>
<?
if(isset($_POST['SEND'])){
foreach($HTTP_POST_VARS as $k => $v){
//echo "\$HTTP_POST_VARS[$k] => $v.\n";
${$k} = $v;
echo "value = ${$k}, type = ".$HTTP_POST_VARS[$k]['type']."<br>";
}
}
?>
<form name="" action="test_foreach.php" method="post" enctype="multipart/form-data">
<input name="img1" type="text" />
<input name="img2" type="text" />
<input name="email" type="text" />
<input name="file" type="file" />
<input name="thing" type="text" />
<input name="SEND" type="submit" value="ok" /></form>
</body>
</html>
outputs this html
value = 1, type = 1
value = 2, type = 2
value = 3, type = 3
value = 5, type = 5
value = ok, type = o
is is possible to do what I'm trying to do (ie ignore all $_POST data that isn't from a "file" field type) ?
thanks