0

Hello,

I have this weird issue with my simple upload form for different files.

<form enctype="multipart/form-data" action="mesaje_furnizori.php" method="GET"> 
      <table>
      <tr><td align="right">Va rugam selectati &raquo; </td><td><?php echo $selectare; ?></td></tr>
      <tr><td align="right"><td><input type="file" name="file" id="file"/></td></tr>      
      <tr><td align="right" colspan="2">Fisiere suportate (.*gif,*.jpg,.*jpeg,.*png,.*bmp,.*doc,.*docx,.*xls,.*xlsx) Marimea maxima de: <strong>5MB</strong></td></tr>
      <tr><td colspan="2"><textarea name="mesajTrimis" cols="70" rows="15"></textarea></td></tr>
      </table>
      <input type="hidden" name="trimis" value="ok" />      
      <input type="submit" value="Trimite"/>
      </form>

The file is passed into my TMP.

Array
(
    [file] => Array
        (
            [name] => mesaje.png
            [type] => image/png
            [tmp_name] => /tmp/phpvdjnGr
            [error] => 0
            [size] => 4009
        )

)

The weird part is when I print_r($_REQUEST); The file is not showing up ($_REQUEST) ... can't figure out why ... Please help with this one

Array
(
    [furnizor_selectat] => 12555
    [mesajTrimis] => test
    [trimis] => ok
    [PHPSESSID] => 5pkk0q1ou8dkk46etqmsldprh4
    [__utma] => 48988665.324662620.1320745888.1321512004.1321522554.23
    [__utmb] => 48988665.5.10.1321522554
    [__utmc] => 48988665
    [__utmz] => 48988665.1320745888.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
)

Notice: Undefined index: file in /web/sites/blabla.com/mesaje_furnizori.php on line 156

Edited by Szabi Zsoldos: n/a

2
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by Stefano Mtangoo
0

Hey Steve, I know :)

Tha problem is that with GET is working but with POST and REQUEST is not.

mesaje_furnizori.php?furnizor=53443&file=mesaje.png&mesajTrimis=adsdasd&trimis=ok

This is the weird part ...

0

Hey Steve, I know :)

Tha problem is that with GET is working but with POST and REQUEST is not.

mesaje_furnizori.php?furnizor=53443&file=mesaje.png&mesajTrimis=adsdasd&trimis=ok

This is the weird part ...

If I have to help you have to remove that bad $_REQUEST and we can then troublshoot together. PHP should remove REQUEST alltogether!

0

Steve,

I have no REQUEST on this page, at all, but my file POST is not submitting with method="POST" only with method="GET"

<?php
if(isset($_GET['mesaj']) && $_GET['mesaj'] == 'nou')
{
?>
      <form enctype="multipart/form-data" action="mesaje_furnizori.php" method="POST"> 
      <table>
      <tr><td align="right">Va rugam selectati &raquo; </td><td><?php echo $selectare_furnizor; ?></td></tr>
      <tr><td align="right"><td><input type="file" name="file" id="file"/></td></tr>      
      <tr><td align="right" colspan="2">Fisiere suportate (.*gif,*.jpg,.*jpeg,.*png,.*bmp,.*doc,.*docx,.*xls,.*xlsx) Marimea maxima de: <strong>5MB</strong></td></tr>
      <tr><td colspan="2"><textarea name="mesajTrimis" cols="70" rows="15"></textarea></td></tr>
      </table>
      <input type="hidden" name="trimis" value="ok" />      
      <input type="submit" value="Trimite"/>
      </form>
<?php
}



if(isset($_POST['furnizor_selectat']) || isset($_POST['file'])  || isset($_POST['mesajTrimis']) || isset($_POST['trimite']) && $_POST['trimite'] == 'ok')
{
	$hash = md5(date("H:i:s Y.m.d"));
	
	echo $_POST['file'];
	exit;

And the output is ->
Notice: Undefined index: file in /web/sites/blabla.com/mesaje_furnizori.php on line 154

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.