Jakarta Commons FileUpload ; Internet Explorer Problem

Hi all,
Environment:
Tomcat 5 ;Apache 2; JDK 1.5.0; Jakarta Commons Fileupload 1.0
OS: Windoze XP
Previously I've used jakarta commons fileupload package to succussfully to upload a file.
However, I am trying to check the content type of the file and throw an exception if its not a jpeg file. The following code works great when I use firefox. But it fails when I use Internet Explorer!
When I supply an existing jpg file on my desktop as the input to the HTML form, the code works fine. However if I enter a non-existing jpg filename, I get a "HTTP 500 Internal Server Error"! I expect to get the "Wrong content type!" message (which my JSP throws as an exception and should be caught by the error page). This problem happens only with Internet Explorer. With firefox, I get the "Wrong Content Type" message as expected.
What could be the problem? Please advise.
Thanks
Joe.
Code follows......
/************** file-upload.html *************/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>File Upload</title>
<script type="text/javascript" language="JavaScript">
<!--
function fileTypeCheck() {
     var fileName = document.uploadForm.pic.value;
     if (fileName == "") {
          alert ("Please select a file to upload!");
          return false;
     var indexOfExt = fileName.lastIndexOf (".");
     if (indexOfExt < 0) {
          alert('You can only upload a .jpg/.jpeg/.gif file!');
          return false;
     var ext = fileName.substring(indexOfExt);
     ext = ext.toLowerCase();
     if (ext != '.jpg' && ext != 'jpeg') {
         alert('You selected a ' + ext + ' file;  Please select a .jpg/.jpeg file instead!');
          return false;
     return true;
//--></script>
</head>
<form action="uploadPhoto.jsp" enctype="multipart/form-data" method="post" name="uploadForm" onSubmit="return fileTypeCheck();">
     <input type="file" accept="image/jpeg,image/gif" name="pic" size="50" />
     <br />
     <input type="submit" value="Send" />
</form>
<body>
</body>
</html>
/*************** photoUpload.jsp **************/
<%@ page language="java" session="false" import="org.apache.commons.fileupload.*, java.util.*" isErrorPage="false" errorPage="uploadPhotoError.jsp" %>
<%!
public void processUploadedFile(FileItem item, ServletResponse response) throws Exception {
     try {
          // Process a file upload
              String contentType = item.getContentType();
          if (! contentType.equals("image/jpeg") && ! contentType.equals("image/pjpeg")) {
               throw new FileUploadException("Wrong content type!");
     } catch (Exception ex) {
          throw ex;
%>
<%
// Check that we have a file upload requeste
boolean isMultipart = FileUpload.isMultipartContent(request);
// Create a new file upload handler
DiskFileUpload upload = new DiskFileUpload();
// Parse the request
List /* FileItem */ items = upload.parseRequest(request);
// Process the uploaded items
Iterator iter = items.iterator();
while (iter.hasNext()) {
    FileItem item = (FileItem) iter.next();
    if (! item.isFormField()) {
        processUploadedFile(item, response);
%>
<html>
<head>
</head>
<body>
File uploaded succesfully! Thank you!
</body>
</html>
/******** uploadPhotoError.jsp ****/
<%@ page language="java" session="false" isErrorPage="true" %>
<html>
<head>
</head>
<body>
<%
out.println(exception.getMessage());
%>
</body>
</html>

I just found out that the problem that I have mentioned in my previous post has nothing to do with Jakarta Commons Fileupload. It happens whenever I try throwing an exception. And it happens only when I use Internet Explorer
Thanks,
Joe
See the code below...
/**** throw-error.jsp ***/
<%@ page language="java" session="false" isErrorPage="false" errorPage="catch-error.jsp" %>
<%
throw new Exception("Catch this!");
%>
/****** catch-error.jsp ****/
<%@ page language="java" session="false" isErrorPage="true" %>
<html>
<head>
</head>
<body>
<%
out.println(exception.getMessage());
%>
</body>

Similar Messages

  • Apache Jakarta Commons FileUpload misleading message

    I have a JSP page doing file upload using commons FileUpload package. The code looks like this:
    <%
    DiskFileUpload upload = new DiskFileUpload();
    List items = upload.parseRequest(request);
    Iterator itr = items.iterator();
    while(itr.hasNext()) {
         FileItem item = (FileItem) itr.next();
         // check if the current item is a form field or an uploaded file
         if(item.isFormField()) {
              String fieldName = item.getFieldName();
              if(fieldName.equals("name"))
                   request.setAttribute("msg", "Thank You: " + item.getString());
         } else {
              File fullFile = new File(item.getName());
              File savedFile = new File("c:\\tmp\\",     fullFile.getName());
              item.write(savedFile);
    %>
    The JSP successfully uploaded the files but it still show me HTTP Status 404 - c:\tmp (Access is denied).
    What's wrong with my code? Thank you.

    I just found out that the problem that I have mentioned in my previous post has nothing to do with Jakarta Commons Fileupload. It happens whenever I try throwing an exception. And it happens only when I use Internet Explorer
    Thanks,
    Joe
    See the code below...
    /**** throw-error.jsp ***/
    <%@ page language="java" session="false" isErrorPage="false" errorPage="catch-error.jsp" %>
    <%
    throw new Exception("Catch this!");
    %>
    /****** catch-error.jsp ****/
    <%@ page language="java" session="false" isErrorPage="true" %>
    <html>
    <head>
    </head>
    <body>
    <%
    out.println(exception.getMessage());
    %>
    </body>
    </html>

  • Question about Jakarta common fileUploader

    Hello!
    I want to be able to upload files to my databas through a jsp-page and have beeing recommended to use Jakarta common fileUploader.
    When extracting that file I saw that there was a lot of files, should all files be put in my WEB_INF/classes/"mypachage"-catalogue or?
    Thanks in advance!
    /D_S

    I am not sure what you mean. When you downloaded the commons-fileupload-1.0.zip there should be some JavaDoc files and a jar file (commons-fileupload-1.0.jar). You dont need to unzip the jar file. Just place it in WEB-INF/lib so the classes will be load. You'll also need to add the jar file to you classpath (or IDE classpath) so that you can compile.
    (Adjust the file names for what ever version you are using)

  • Jakarta Commons FileUpload error : How should I go about it ?

    Hi fellas,
    I am using the Jakarta commons fileupload jar to write an upload servlet.
    I have created an html file where I upload a file as follows :
    <form name="upload_form" enctype="multipart-form/data" method="post" action="servlet/UploadServlet2">
    <center>
    <font face="tahoma" size="3">
    Please choose a file to upload <input type="file" name="upload_file">
    <hr>
    <input type="submit" name="bttn_submit" value="Upload File">
    </font>
    </center>
    </form>
    On posting this form, I am calling the UploadServlet which has the following code :
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.apache.commons.fileupload.*;
    public class UploadServlet2 extends HttpServlet
              protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
                   doWork(req, res);
              protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
                   doWork(req, res);
              private void doWork(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
                   PrintWriter out = res.getWriter();
                   out.println(req.toString());
                   out.println("page loading");
                   out.println(req.getContentType());
                   out.println(req.getParameter("myText"));
                   boolean isPart = FileUpload.isMultipartContent(req);
                   out.println(isPart);
                   if(isPart)
                        out.println("is multipart");
                        DiskFileUpload upload = new DiskFileUpload();
                        try
                             List items = upload.parseRequest(req);
                             Iterator it = items.iterator();
                             while(it.hasNext())
                                  FileItem item = (FileItem)it.next();
                                  if(!(item.isFormField()))
                                       out.println("success");
                        catch (FileUploadException e)
                             // TODO Auto-generated catch block
                             System.out.println(e.getMessage());
                             out.println(e.getMessage());
                   else
                        out.println("file not received");
                   out.flush();
                   out.close();
    But the output that I get is :
    org.apache.coyote.tomcat4.CoyoteRequestFacade@7244ca page loading application/x-www-form-urlencoded null false file not received
    WHATS THAT SUPPOSED 2 MEAN ?
    Where's the mistake in my code ?
    How should I remedy the situation ?
    Help needed immediately

    Hey thanx serlank,
    I never thought I could be sooooooooooo stupid...but u c, I have Java'd so much over the last 1 year that it's now become a headache 4 me 2 spot out such small mistakes.
    But thanx 2 people like u I never can drown in the Java Ocean. U're always there in the Search-and-Rescue team...
    Hope u'll always be there...
    Well ur ego glows again...
    Thanx alot 1ce again. It works now.
    Can I have ur mail Id if u don't mind ??

  • Weird Internet Explorer problem!

    Something really stranged has happened to my computer within the past couple of hours. I use IE 5 (yeah, I know...I am hopelessly out of date, but it has all my bookmarks and preferences and I like the way it functions much better than any other browser I've tried...). A little while ago I was doing some surfing and I guess something I did--some page I visited?--caused my Command key to be tied in to Subscriptions. I don't understand how this could be, but it's true. If I want to do something like copy + paste, or something else I might normally use the Command key for, I can't do it. Instead, my pushing the Command key causes a window to pop up asking if I wish to subscribe to the site in question. (Actually, at first, whenever I pushed Command, my subscriptions were updated, so I went in and deleted all my subscriptions, but that didn't take care of the underlying problem.)
    I am not particularly computer literate. For instance, I can't even tell you what the bar across the top of my screen is called (the one that starts on the left with the Apple logo, followed by File, Edit, View, Go, etc.). But I can tell you that that bar, when I'm in IE, is fouled up. After "Go," there is a bunch of garbled stuff that reads, approximately (I can't type all the symbols), "p[symbols]>Favorites[symbol]AddPagetoFavoritesD[checkmark]OrganizeFavorites[bu nch of other symbols ending in a black apple]Update Su." Then the bar continues with Tools, Window, and Help. When I click on that bar and the dropdown menu appears, it is some weird, mangled, unusable version of my bookmarks. However, if I use the Favorites tab on the left side of the window, my bookmarks are there and usable.
    I've poked all around in Help and Preferences and, not surprisingly, cannot find any way to undo this. (I'd be amazed if I actually found something telling me what to do if my Command key brings up my subscription window!) It's really unfortunate because, as I said, I like IE and this is making it pretty hard for me to use it, since I can't do anything involving the Command key.
    Have any of you ever encountered this? It is about the weirdest thing my computer has ever done!
    imac   Mac OS 9.2.x   IE 5

    Hmmmm. Are you getting problems with disappearing
    words in the menu in IE alone? How about other
    programs or when you open your HD - any strangeness
    with the titles in the windows?
    It seems only to be in IE. By the way, I also have a Mozilla browser on my computer, which I installed because so many sites were simply not working with IE anymore. Mozilla is working fine. If I liked Mozilla as well as IE, I'd just use that, but it has numerous differences (mostly about commands and things like not being able to click and hold on an image or page to open it in a new window) and 9 times out of 10 I prefer the IE way of doing things (though that could mostly be habit).
    IIRC, Microsoft is set to remove Internet Explorer
    for Mac from it's website VERY soon..
    Yeah, I think in April. It's too bad--IE for Mac has become the unwanted stepchild browser.Yahoo doesn't work with it (at least, not the version I have), and I frequently get alerts when I go to sites that tell me my experience won't be optimal since I'm using IE. But I really like it! I use Safari at work (I have OS X there) and, like Mozilla, it has various differences that bug me, plus it just looks strange--somehow less "live" than IE--as if I am looking at a PDF of a web page rather than the actual page.
    In a pinch, there's also iCab which is a wonderful
    browser that is still being developed for OS 9.
    http://icab.de
    Thanks for the tip. But with an unusual browser like that, don't you get the same warnings all over the net about how this or that site doesn't support your browser?
    Beth

  • Portal and Internet Explorer problem

    Hi everyone. My problem is that I'm using Portal through the WEB AS Java stack SP09 and i can't update to the newer stacks since I'm on IDES system, so it has to be SP09. Well, my operating system Win 2003 x64 comes with Internet explorer 8 by default.
    i have some problems with IE8, Chrome or FireFox when browsing through the Portal, for example, I can't add to the Group "Everyone" End user permissions, because the "ADD" button is greyed out.
    I tried to uninstall the IE8, but i can't find the way to do it. I can't remove it through the Control panel (there is no option to remove it)
    nor can I do it through the Command Line with %windir%\ie8\spuninst\spuninst.exe    because I don't have the IE8 folder!!
    Do you have any ideas on how could i solve it?

    Thank you guys for the answers, but
    1/ I can't upgrade the SP lever, since I'm on IDES system and I don't have any Maintenance Certificates to installa packages, besides the fact that they have to be dowloaded through the Solution manager
    2/ I tries the compatibility mode and nothings's changed. The problem I'm having is that when I'm in the Portal and do a right-click for example in PortalContent > landscapesystem > SAP_BW. it opens the Internet Explorer menu and not the Portal's, so I can't choose "new" or "open" or "permissions"  and when i doble click it the drop-down menu that appears where I could choos the same options is too narrow and empty.....
    i donwgraded finally the IE to the IE7 version, but no luck either.  i tried to install the IE6, but there is no IE6 version for x64 bits systems.
    Any other suggestions? How could i make this context menu available?

  • Adobe PDF direct open in internet explorer problem

    Hi all,
    I have a problem when I want do download a pdf byte stream created by Jasper Reports. I read the necessary information out of my formbean (Struts). Here's the code from the jsp:
    response.setContentType(runReportForm.getContentType());
    String filename = runReportForm.getTechName() + "." + runReportForm.getMode();
    response.setHeader("Content-Disposition", "attachment; filename='" + filename + "'\"");
    byte[] bytes = runReportForm.getBytesOutput();
    response.setContentLength(bytes.length);
    ServletOutputStream ouputStream = response.getOutputStream();
    try {
            ouputStream.write(bytes, 0, bytes.length);
            ouputStream.flush();
         ouputStream.close();
    } catch (IOException e) {
    }The content type for PDF is "application/pdf" or "application/octet-stream", of course.
    Normally, it should open a download dialog with the question "Open" and "Save". In this download dialog is the Adobe icon displayed, too.
    But in my case, I get the dialog with an empty (like unknown file format) icon, but the text says "Adobe Acrobat Document". When I click to open it directly it will open in a separately Adobe Acrobat window instead of displaying in the internet explorer. (Saving to the hard disk works fine).
    Of course I have set the setting "display inside browser" in the options of my Acrobat Reader.
    The same procedure with Excel (content type "application/vnd.ms-excel") makes no problems.
    Thanks for any help.
    Manuel

    If you want to open the PDF in the browser you have to explicitely set the content type to "application/pdf", if you use "application/octet-stream" you'll always get the download box and when you choose to open from this box the reader will be used because the reader is configured to open PDF documents in the windows filetypes settings.

  • File size with Jakarta Commons FileUpload

    Hello fella experts,
    I am using the org.apache.commons.FileUpload package to upload a file via a servlet.
    I'm implementing the DiskFileUpload() method in the servlet.
    My problem is that I want to apply a file-size validation and specify that files with size greater than 1MB should not be uploaded.
    How to accomplish this ?
    Any suggessions ?
    Thanx in advance.

    Hi, I'm trying this code, and it works pretty fine, but when I try to transfer a .zip file, it give me a .zip file that I can't extract.
    Please.. Am I doing something wrong, do I miss something??
    I set already the File Type to binary...
    any comments..
    public static void copyFiles(String server, String user, String pwd, String origen, String destino)
    try {
    FTPClient ftp = new FTPClient();
    ftp.connect(server);
    ftp.login(user,pwd);
    ftp.setFileType(ftp.BINARY_FILE_TYPE);     
    //ftp.enterLocalPassiveMode();
    ftp.changeWorkingDirectory(origen);
    int reply = ftp.getReplyCode();
    if(!FTPReply.isPositiveCompletion(reply)) {
    ftp.disconnect();
    FTPFile[] files = ftp.listFiles();
    FTPFile ftpfile = null;
    OutputStream output = null;
    for (int i = 0; i < files.length; i++) {
    ftpfile = files;
    if (ftpfile.isFile()){
    output = new FileOutputStream(new File(destino+ftpfile.getName()));
    if (ftp.retrieveFile(ftpfile.getName(),output)){
    output.close();
    ftp.logout();
    ftp.disconnect();
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("Error : " + e.toString());

  • Internet Explorer problems

    I'm having a problem with the flash player in Internet
    Explorer. I've removed all older versions and installed version 9
    (ActiveX).
    If I open Adobe's Home Page all I see in the box where the
    animations supposed to be is a black box.
    If I directly goto this URL:
    L=FMA.swf]http://wwwimages.adobe.com/www.adobe.com/swf/homepage/fma_shell/FMA.swf[/L]
    the animation displays correctly.

    When I click on the touchscreen icon for the internet explorer on my start menu it automatically opens the desktop one which I DON'T want to open.
    It's a setting in Internet Options. Clear the box.
    PS Always tell us which Satellite C55t you have when you post here. See the label on the bottom.
    -Jerry

  • HP Presario internet explorer problems

    I have a HP Presario NY541AA-ABA. I used to be able to view bills on their website, now for some reason when I click on them a window pops up and says internet explorer is not working and shuts down. If anyone can help I would appreciate any feedback to get this issue resolved.

    mayberry02 wrote: Hi I have know idea what you are asking me. This did not help me. Thanks
    Hello mayberry02, What banhien was trying to determine, is which operating system and which Internet browser you are using.
    If you are using Internet Explorer, you may want to upgrade to Internet Explorer 9, it you have not done so already.
    If you are using Internet Explorer 9, you may want to reset Internet Explorer back to the default settings.
    Please click the White Kudos star on the left, to say thanks.
    Please mark Accept As Solution if it solves your problem.

  • Jakarta commons FileUpload - ServletFileUpload.parseRequest(...)

    Hello people. I am using:
    # Orion app server (don't ask why)
    # WebWork 2.1.7 framework
    # Jakarta commons file upload 1.2
    While writing a file upload action I am having problems with ServletFileUpload.parseRequest(...) as it always returns an empty list.
    Reading related Jakarta FAQ it says "this most commonly happens when the request has already been parsed, or processed in some other way."
    I then assumed it was my WebWork interceptor so I took that out but I'm still getting the same problem.
    Am I missing something in my JSP, another <input> or something?
    Is the request being parsed somehwere else beforehand (maybe a WebWork issue)?
    Any help would be much appreciated.
    Here is the relevant code...
    My JSP<html>
         <head>
              <title>File Upload</title>
         </head>
         <body>
              <form enctype="multipart/form-data" method="post" action="doUpload.action" name="uploadForm">
                   <input name="upload" type="file" label="File"/>
                   <input type="submit" value="upload" />
              </form>
         </body>
    </html>
    The execute() method of my action     public String execute() {
              log.info("executing");
              // get the request
              HttpServletRequest request = ServletActionContext.getRequest();
              // check that we have a file upload request
              boolean isMultipart = ServletFileUpload.isMultipartContent(request);
              log.debug("request "+ ( (isMultipart ? "IS" : "is NOT") ) +" a multi-part");
              if (isMultipart) {
                   // Create a factory for disk-based file items
                   DiskFileItemFactory factory = new DiskFileItemFactory();
                   factory.setSizeThreshold(100);
                   factory.setRepository(new File("C:/tmp/cms/uploads"));
                   // Create a new file upload handler
                   ServletFileUpload upload = new ServletFileUpload(factory);
                   // Parse the request
                   try {
                        //List /* FileItem */ items = upload.parseRequest(request);
                        _uploads = upload.parseRequest(request);
                   } catch (FileUploadException e) {
                        log.error("Error parsing request" , e);
                   // if the above method doesn't work, use my method :)
                   if (_uploads.isEmpty()) {
                        _uploads = parseRequest(request);
              return (_uploads == null) || _uploads.isEmpty() ? INPUT : SUCCESS;
         }My implementation of parseRequest(...) works but returns File objects and I need FileItem objects. I don't really want to use this method but will include it here just incase it triggers some inspiration for someone.
    private List<File> parseRequest(HttpServletRequest requestObj) {
             List<File> files = new ArrayList<File>();
             // if the request is a multi-part
             if (requestObj instanceof MultiPartRequestWrapper) {
                  // cast to multi-part request
                  MultiPartRequestWrapper request = (MultiPartRequestWrapper) requestObj;
                   // get file parameter names
                   Enumeration paramNames = request.getFileParameterNames();
                   if (paramNames != null) {
                        // for each parameter name, get corresponding File
                        while (paramNames.hasMoreElements()) {
                             File[] f = request.getFiles("" + paramNames.nextElement() );
                             // add the File to our list
                             if (!ArrayUtils.isEmpty(f)) {
                                  files.add(f[0]);
              return files.isEmpty() ? null : files;
        }

    Hi edin7976, just wonder have you got any feedback for this problem?
    I really want to push this thread up as I am stuck at the exact same question. Can anybody give a hint?

  • BI Internet Explorer problem.

    Hi, I have look around the forum but I don't find definitive answer to the solution of my problem. When I use internet explorer to login to BI I'm able to login but when I click on something else the login screen comes out again. This only happen to IE but not firefox. BTW I install oracle BI in win 2003 environment. The thing is I install in my laptop using winxp and I use IE it did not do this. Any Idea? Thx

    Problem is the name of the computer in the url. Change it to the IP address. For example: http://my_computer/analytics -> http://10.200.230.1/analytics.

  • Validation problem in Internet Explorer (Was: Internet Explorer problem)

    Ive found a problem on my website ive got customer details as seen below, but the validation doesn't work in Internet Explorer. So for example the date is a validation, if i dont enter anything in there then it stills go to the next page. Any ideas on what the problem is? Thanks
    <input name="Company" type="text" id="Company" value="Company *" size="20" readonly />
      <input name="Company" type="text" required />
      <input name="Tel Number" type="text" id="Tel Number" value="Tel Number *" size="20" readonly />
      <input name="Tel_Number" type="tel" required/>
    </p>
    <p>
      <input name="Email Address" type="text" id="Email Address" value="Email Address *" size="20" readonly />
      <input name="Email_Address" type="email" value="" required/>
      <input name="Delivery Date" type="text" id="Delivery Date" value="Delivery Date *" size="20" readonly />
      <input name="Delivery_Date" type="date" value="" required/>
    </p>
    <p>
      <input name="Ordered By" type="text" id="Ordered By" value="Ordered By *" size="20" readonly />
      <input name="Ordered_By" type="text" value="" required/>
      <input name="PO Number" type="text" id="PO Number" value="PO Number" size="20" readonly />
      <input name="PO_Number" type="text" value="" id="PO_Number"/>
    </p>
    <p>
      <textarea name="Address" cols="16" rows="3" readonly id="Address">Delivery Address and Post Code *</textarea>
      <textarea name="Address" cols="20" rows="3" required ></textarea>
      <textarea name="Special Requirements" cols="35" rows="3" readonly id="Special Requirements">Special Requirements
    (**EG. No of Vegetarians, Delivery Time, Gluten Free/Celiac etc..**)</textarea>
      <textarea name="Special_Requirements" cols="23" rows="3" id="Special_Requirements"></textarea>
    </p>

    Save the code below as customer_order.php and change:
    // recipient
    $to = "[email protected]";
    This will send the information to your email address if all the required fields are filled in. The fields you dont want validated remove them from the code - for instance remove the below if you do NOT want to validate the Special Requirements form field:
    $Special_Requirements = trim($_POST['Special_Requirements']);
    if(empty($Special_Requirements)) {
    $error['Special_Requirements'] = "Please provide any Special Requirements";
    Change the below if the email is sent to point to a page which informs the sender the order has been successfully sent:
    header ('Location: order_sent_successfully.php');
    <!-- CODE STARTS HERE -->
    <?php
    if (array_key_exists('submit' , $_POST)) {
    $Company = trim($_POST['Company']);
    if(empty($Company)) {
    $error['Company'] = "Please Provide Company Name";
    $Tel_Number = trim($_POST['Tel_Number']);
    if(empty($Tel_Number)) {
    $error['Tel_Number'] = "Please Telephone Number";
    $Email_Address = trim($_POST['Email_Address']);
    // check for valid email address
    $pattern = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
    if (!preg_match($pattern, trim($Email_Address))) {
    $error['Email_Address'] = 'Please Enter a Valid Email Address';
    $Delivery_Date = trim($_POST['Delivery_Date']);
    if(empty($Delivery_Date)) {
    $error['Delivery_Date'] = "Please Provide Deliver Date";
    $Ordered_By = trim($_POST['Ordered_By']);
    if(empty($Ordered_By)) {
    $error['Ordered_By'] = "Please Provide Ordered By";
    $PO_Number = trim($_POST['PO_Number']);
    if(empty($PO_Number)) {
    $error['PO_Number'] = "Please provide PO Number";
    $Delivery_Address = trim($_POST['Delivery_Address']);
    if(empty($Delivery_Address)) {
    $error['Delivery_Address'] = "Please provide Delivery Address";
    $Special_Requirements = trim($_POST['Special_Requirements']);
    if(empty($Special_Requirements)) {
    $error['Special_Requirements'] = "Please provide any Special Requirements";
    // recipient
    $to = "[email protected]";
    // email subject
    $subject = "Customer Order from Website";
    // sender
    $sender = "From: ".$_POST['Email_Address']."\r\n";
    // build the email message
    $message = "Order from Website.\n\n";
    $message .= "Company: $Company\n\n";
    $message .= "Telephone: $Tel_Number\n\n";
    $message .= "Email Address: $Email_Address\n\n";
    $message .= "Delivery Date: $Delivery_Date\n\n";
    $message .= "Ordered By: $Ordered_By\n\n";
    $message .= "PO Number: $PO_Number\n\n";
    $message .= "Delivery Address: $Delivery_Address\n\n";
    $message .= "Special Requirements: $Special_Requirements\n\n";
    if(!isset($error)) {
    mail($to, $subject, $message, $sender);
    header ('Location: order_sent_successfully.php');
    ?>
    <?php
    foreach($error as $value) {
        echo "<p style='color: red;'>".$value."</p>";
    ?>
    <form name="customer_details" action="customer_order.php" method="post">
    <input name="Company1" type="text" id="Company" value="Company *" size="20" readonly />
      <input name="Company" type="text" value="<?php if(isset($Company)) { echo $Company; } ?>" />
    <input name="Tel Number" type="text" id="Tel Number" value="Tel Number *" size="20" readonly />
      <input name="Tel_Number" type="tel" value="<?php if(isset($Tel_Number)) { echo $Tel_Number; } ?>"/>
    </p>
    <p>
      <input name="Email Address" type="text" id="Email Address" value="Email Address *" size="20" readonly />
      <input name="Email_Address" type="email" value="<?php if(isset($Email_Address)) { echo $Email_Address; } ?>"/>
      <input name="Delivery Date" type="text" id="Delivery Date" value="Delivery Date *" size="20" readonly />
      <input name="Delivery_Date" type="date" value="<?php if(isset($Delivery_Date)) { echo $Delivery_Date; } ?>"/>
    <label>
    </label>
    </p>
    <p>
      <input name="Ordered By" type="text" id="Ordered By" value="Ordered By *" size="20" readonly />
      <input name="Ordered_By" type="text" value="<?php if(isset($Ordered_By)) { echo $Ordered_By; } ?>" />
      <input name="PO Number" type="text" id="PO Number" value="PO Number" size="20" />
      <input name="PO_Number" type="text" id="PO_Number" value="<?php if(isset($PO_Number)) { echo $PO_Number; } ?>"/>
    </p>
    <p>
    <textarea name="Delivery Address" cols="16" rows="3" readonly id="Address">Delivery Address and Post Code *</textarea>
    <textarea name="Delivery_Address" cols="20" rows="3"  ><?php if(isset($Delivery_Address)) { echo $Delivery_Address; } ?></textarea>
    <textarea name="Special Requirements" cols="35" rows="3" readonly id="Special Requirements">Special Requirements
    (**EG. No of Vegetarians, Delivery Time, Gluten Free/Celiac etc..**)</textarea>
    <textarea name="Special_Requirements" cols="23" rows="3" id="Special_Requirements"><?php if(isset($Special_Requirements)) { echo $Special_Requirements; } ?></textarea>
    </p>
    <input type="submit" name="submit" id="submit" value="Submit">
    <form>

  • Adobe Standard 8.0 Internet Explorer problem

    After I install AS 8.0, the license agreement won't pop up and instead the "Internet Explorer cannot continue". There is connection to the internet so that's not the problem. I cannot use adobe 8.0, but 6.0 I can.

    I have the same problem. A window tries to open, then reverts to IE saying there is no connection to the internet. I close this window and another windows opens saying that the license agreement was not accepted so the application will close. Have uninstalled twice and disabled firewall but still the same.

  • Internet Explorer problem

    I have finally been successful in installing HTMLDB 1.6 on 10g. Now, when I try to run the sample application I get "Internet Explorer has encountered a problem and needs to close. We are sorry for the inconvenience." Then I get a dialog box saying that explorer will close. At that point, if I dont press OK, and switch back to the sample application, it actually works. What is going on?
    I am using IE 6
    Thanks,
    David

    Hi,
    Do not approve the update in WSUS server.
    http://technet.microsoft.com/en-us/library/hh852348.aspx
    Regards.
    Vivian Wang

Maybe you are looking for

  • HP OfficeJet Pro 8600 Premium - Unable to Enable Scan to Email

    I was out the country for the past two weeks, and just returned to find that I can no longer scan to email (or the computer) from the printer. I have verified the email settings many times over, yet I continue to receive the message that "Connection

  • PDF NOT RECONIZE BY WEBSITE HELP

    Hello, I have buyed a new desknop for scanning files with pdf to a website witch only accept PDF files. The problem is when is scanned everything goes good it works and i can also read them with adobe reader and open them with it but when i wanted to

  • FLASH ASPECT RATIO!?? Help

    I have set up a flash movie to be played on a 37" lcd. It said the resolution is 1366x768 WXGA, HDTV compatible. So that is the resolution I have set it to play in. It will be playing as .swf My question is: will it fill the entire screen, look corre

  • Adobe Reader XI does not open

    Why won't my adobe reader open and read PDF files. It is very annoying

  • System icon for power is not turned on and wont let us change it

    The system icon for power is off, but the power icon will not change to on. Can you please assist