huntersj78 Posted May 31, 2010 Share Posted May 31, 2010 Hello. There is a page here: https://www.discoveryfirm.com/upload/index.php The customer logs in and then is able to upload his/her files to us. We get the files but after they click the upload/send button they should be taken to this page: https://www.discoveryfirm.com/upload/end.php but instead they get this: Warning: mb_send_mail() [function.mb-send-mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in C:\xampp\htdocs\download\receive.php on line 239 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\download\receive.php:239) in C:\xampp\htdocs\download\receive.php on line 241 We get the uploaded files from the customer so that is OK, but the customer thinks they get an error when they dont because the end.php page does not show. Here is my code: <?php include"../cms/db.php"; db(); if($_POST[user] && $_POST[password]) { $USER = htmlspecialchars($_POST[user]); $USER = mysql_escape_string($USER); $PASS = htmlspecialchars($_POST[password]); $PASS = mysql_escape_string($PASS); $SQL = "SELECT * FROM Account WHERE FolderName='$USER' AND Password='$PASS'"; $RST = mysql_query($SQL); $DATA= mysql_fetch_assoc($RST); if(!$DATA[FolderName]){ header('Location:index.php?error=1'); } } else { header('Location:index.php?error=2'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <title>ディスカバリーファーム FTPアップローダー</title> <link href="ftp.css" rel="stylesheet" type="text/css" /> </head> <body> <img src="images/file_upload.gif" alt="ファイルのアップロード" width="436" height="28" border="0" class="title" /> <div class="catchcopy">「参照」ボタンをクリックし、ファイルをアップロードしてください。 <?php if($_REQUEST[error]){ print "<br /><br /><font color=\"red\">ファイルを送信できませんでした。</font>";} //<td width="300"><input name="file1" type="file" class="txtfeed1" value="" /></td> ?> </div> <form action="http://221.255.244.20/download/receive.php" method="post" enctype="multipart/form-data"> <!--<table border="0" cellpadding="0" cellspacing="0" class="logintable"> <tr> <td width="600">--> <table border="0" cellpadding="0" cellspacing="0" class="logintable"> <tr align="left"><td width="600"><div class="login"> <input name="file1" type="file" value="" size="60" /> </div></td> </tr> </table> <!--</td> </tr> </table>--> <br /> <table border="0" cellpadding="0" cellspacing="0" class="logintable"> <tr> <td width="600"><div class="login"> <div class="comment">コメント欄(注意事項・質問など)</div> <textarea name="conmment" rows="5" class="txtfeed2"></textarea> </div></td> </tr> </table> <div class="catchcopy">よろしければ、「送信」ボタンを押し、データをアップロードしてください。<br /> (ファイル容量が200MB以上の場合、送信できない場合があります。) </div> <input type="image" src="images/submit.gif" alt="送信" width="140" height="24" border="0" class="icon" /> <?php if($DATA[MakeDay] == "0000-00-00 00:00:00") { print "<input type=\"hidden\" name=\"folder\" value=\"$DATA[FolderName]\">\n"; print "<input type=\"hidden\" name=\"staff_folder\" value=\"1\">\n"; } else { print "<input type=\"hidden\" name=\"folder\" value=\"$DATA[FolderName]\">\n"; } ?> <input type="hidden" name="mail" value="<?php print $DATA[staffMail]; ?>" > </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/203410-please-help-my-form-is-all-screwed-up/ Share on other sites More sharing options...
trq Posted May 31, 2010 Share Posted May 31, 2010 There is a sticky in the top of this board that covers the very common header error you are experiencing, you should read it. Quote Link to comment https://forums.phpfreaks.com/topic/203410-please-help-my-form-is-all-screwed-up/#findComment-1065598 Share on other sites More sharing options...
huntersj78 Posted May 31, 2010 Author Share Posted May 31, 2010 There is a sticky in the top of this board that covers the very common header error you are experiencing, you should read it. Actually I read that before I posted, but I still couldn't figure what is wrong. I am quite the newb. Quote Link to comment https://forums.phpfreaks.com/topic/203410-please-help-my-form-is-all-screwed-up/#findComment-1065599 Share on other sites More sharing options...
trq Posted May 31, 2010 Share Posted May 31, 2010 You have output on line 239 of receive.php. You cannot output anything prior to using the header() function. Quote Link to comment https://forums.phpfreaks.com/topic/203410-please-help-my-form-is-all-screwed-up/#findComment-1065606 Share on other sites More sharing options...
huntersj78 Posted May 31, 2010 Author Share Posted May 31, 2010 You have output on line 239 of receive.php. You cannot output anything prior to using the header() function. I dont get it. If I change the form action to "end.php" then it goes to the correct confirmation page, but it doesnt upload the files. If I leave it how it is it uploads the files but I get an error page and not the "end.php" page. Quote Link to comment https://forums.phpfreaks.com/topic/203410-please-help-my-form-is-all-screwed-up/#findComment-1065612 Share on other sites More sharing options...
riwan Posted May 31, 2010 Share Posted May 31, 2010 You don't need to change the form action. The problem is at Warning: mb_send_mail() [function.mb-send-mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in C:\xampp\htdocs\download\receive.php on line 239 Which would mean that somehow your mailing failed and it output the error text. when you have fixed this, you wouldn't get the below message, but redirected to then end.php page Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\download\receive.php:239) in C:\xampp\htdocs\download\receive.php on line 241 Quote Link to comment https://forums.phpfreaks.com/topic/203410-please-help-my-form-is-all-screwed-up/#findComment-1065640 Share on other sites More sharing options...
huntersj78 Posted June 1, 2010 Author Share Posted June 1, 2010 You don't need to change the form action. The problem is at Warning: mb_send_mail() [function.mb-send-mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in C:\xampp\htdocs\download\receive.php on line 239 Which would mean that somehow your mailing failed and it output the error text. when you have fixed this, you wouldn't get the below message, but redirected to then end.php page Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\download\receive.php:239) in C:\xampp\htdocs\download\receive.php on line 241 Could someone be willing to go on Skype with me and I will show my screen? It might be better if you see what I am seeing? Quote Link to comment https://forums.phpfreaks.com/topic/203410-please-help-my-form-is-all-screwed-up/#findComment-1065961 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.