ryanschefke Posted November 23, 2007 Share Posted November 23, 2007 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 ryan@triomfgroup.com http://phpfi.com/278267 Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted November 23, 2007 Share Posted November 23, 2007 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. Quote Link to comment Share on other sites More sharing options...
ryanschefke Posted November 23, 2007 Author Share Posted November 23, 2007 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. Quote Link to comment Share on other sites More sharing options...
ryanschefke Posted November 23, 2007 Author Share Posted November 23, 2007 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. Quote Link to comment Share on other sites More sharing options...
ryanschefke Posted November 24, 2007 Author Share Posted November 24, 2007 I am all set here. I found the problem. I was outputing something via an echo above the header and that prevented the redirect. This thread is closed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.