File upload with validation issue
Moderator: General Moderators
is this what you are talking about?feyd wrote:that's not it.
values of form passed to processor
<input type=hidden name="txtfrmpg" value='<?=$frmpg?>'>
this is where all the variables are posted in the processor
Code: Select all
$frmpg = $HTTP_POST_VARS['txtfrmpg']; //form vars- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
no. Run var_dump($_FILES) what does it say?
ok. where should i be putting the var_dump($_FILES) statement?feyd wrote:no. Run var_dump($_FILES) what does it say?
tried it herefeyd wrote:Somewhere around where you use it first, like $file.
Code: Select all
//-- GET SIZE OF UPLOADED IMAGE
var_dump($_FILES)
$file = $_FILES['txtlistingimage']; //file from formCode: Select all
//-- GET SIZE OF UPLOADED IMAGE
$file = $_FILES['txtlistingimage']; //file from form
var_dump($_FILES)lol - right - my bustfeyd wrote:you forgot a semicolon after it.
Added
Code: Select all
//-- GET SIZE OF UPLOADED IMAGE
var_dump($_FILES);
$file = $_FILES['txtlistingimage']; //file from form
$max_size = 500000; // roughly 500K- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
it shouldn't change anything, it should output data, if anything.
Run the following in a new file and tell us the results please.
Run the following in a new file and tell us the results please.
Code: Select all
<?php
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
$rg = (in_array(strtolower(ini_get('register_globals')), array(0, false, '', null, 'off')) ? 'Off' : 'On');
$de = (in_array(strtolower(ini_get('display_errors')), array(0, false, '', null, 'off')) ? 'Off' : 'On');
$eol = (isset($_SERVER['HTTP_HOST']) ? "<br />\n" : "\n");
$ec = array(
'E_STRICT' => 2048,
'E_ALL' => 2047,
'E_USER_NOTICE' => 1024,
'E_USER_WARNING' => 512,
'E_USER_ERROR' => 256,
'E_COMPILE_WARNING' => 128,
'E_COMPILE_ERROR' => 64,
'E_CORE_WARNING' => 32,
'E_CORE_ERROR' => 16,
'E_NOTICE' => 8,
'E_PARSE' => 4,
'E_WARNING' => 2,
'E_ERROR' => 1,
);
$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
if (($t & $v) == $v)
{
$e[] = $n;
$t ^= $v;
}
}
$er = $er . ' (' . implode(' | ', $e) . ')';
echo 'PHP Version: ' . $ve . $eol;
echo 'PHP OS: ' . $os . $eol;
echo 'Error Reporting: ' . $er . $eol;
echo 'Register Globals: ' . $rg . $eol;
echo 'Display Errors: ' . $de . $eol;
?>