Add parameter to PHP

Posted by proyb2 on Stack Overflow See other posts from Stack Overflow or by proyb2
Published on 2010-05-14T00:53:05Z Indexed on 2010/05/14 1:04 UTC
Read the original article Hit count: 298

Filed under:
|

When I sent an image to the code below, uploadImage.php, through a POST method, how do I add a String parameter?

<?php
$hasError = false;
foreach( $_FILES as $i=>$file )
{
    if ( $file['error'] )
    {
        $hasError = true;
    }
}
if ( ! $hasError )
{
    $myFilePath = '_uploads/'.'_'.$file["name"];
    $dta = file_get_contents($file['tmp_name']);
    file_put_contents($myFilePath, $dta);
}
else
{
    echo('Stick custom error message here');
}
?>

© Stack Overflow or respective owner

Related posts about php

Related posts about php5