Jump to content
Sign in to follow this  
fnets

_FILES array

Recommended Posts

I'm unable to submit questions to the Godaddy forum and no one is answering the phone "to exceed my expectation" ... any help appreciated.


trying to send an email with image file attachment ...my html form


<form method="post" action=".\sendContact.php" enctype="multipart/form-data">

<input type="TEXT" name="email">

<input type="file" name="file">

<input type="submit" value="Submit">


in sendContact.php I have


echo $_POST['email'];

echo $_FILES['file'];


which echo's the email address text ok but for file I just get "Array" (presumably empty)?


I have uploaded php.ini from https://gist.github.com/TheSunMan/4008090 with upload_max_filesize = 2M and max_file_uploads = 20


Share this post


Link to post
Share on other sites

Two things:

 

  • Set your form action to sendContact.php
  • As you've named your input "file" you'll need to reference that key within the files array i.e. $_FILES['file']

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Member Statistics

    • Total Members
      57,714
    • Most Online
      4,970

    Newest Member
    v8web
    Joined
  • Forum Statistics

    • Total Topics
      65,786
    • Total Posts
      454,632
×