Jump to content

Recommended Posts

Can someone please tell me what I am doing wrong? Ultimately, I am trying to store the name of a file in mysql to reference it in html. i try to do simple things such as echo the size and name of the file but it outputs nothing. please help. The full script is in the link below. my email is [email protected]

 

http://phpfi.com/278267 

You need to specify an enctype in your form:

 

<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="formnewuser" id="formnewuser">

 

Without that, the server isn't expecting file as well as the other form data.

GingerRobot - You are the best! That was it!!! Next time I will spare myself the 2 days of trying to debug and ask an expert like you. Seriously, you saved me a lot of time and I was jumping up and down when I realized it worked.

I just ran a few more tests. The name, size, etc of the file output is now working; however, the redirect stopped working. In other words, when everything is filled out okay I want to use the following line: header ('Location: signupthanks.php?un='.$un.'&em='.$em); to send the user to another page. It was working but it 'magically' stopped and just refreshes back to the same page.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.