Jump to content
Larry Ullman's Book Forums

possowski

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by possowski

  1. I am also having some issue with the directory path and don't want to put it in the same folder as the upload_file.php file.  I have attached a snippet of my directory and here is the corresponding code:

      if (move_uploaded_file ($_FILES['the_file']['tmp_name'], "c:/xampp/uploads/
                {$_FILES['the_file']['name']}")) {
                print '<p>Your file has been uploaded.</p>';
              } else { // problem occurs

    My form is loading loading and seems to be functioning properly.652699556_uploadlocation.PNG.6f65a9c4e2d6e22ec164a92921a77341.PNG

    this is my error message:

    Warning: move_uploaded_file(c:/xampp/uploads/ Freedom PE form.docx): failed to open stream: No such file or directory in C:\xampp\htdocs\FilesAndDirectoriesCh11\upload_file.php on line 19

    Warning: move_uploaded_file(): Unable to move 'C:\xampp\tmp\phpE046.tmp' to 'c:/xampp/uploads/ Freedom PE form.docx' in C:\xampp\htdocs\FilesAndDirectoriesCh11\upload_file.php on line 19

    Your file could not be uploaded because: Something unforeseen happened.

     

  2. Larry,

    I am also working on script 8.10 and received the following error when I tried to send the email: 

    Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\CreatingWebAppsCh8\register.phpon line 44.

    this is my line 44: mail($_POST['email'], 'Registration Confirmation', $body, 'From: admin@example.com');

    I am running win10 on a 64bit system, xampp v3.2.2 and when I looked at the phpinfo.php file it was set for 

    SERVER_PORT 80

    but this is what the php.ini file has:

    [mail function]
    ; For Win32 only.
    ; http://php.net/smtp
    SMTP=localhost
    ; http://php.net/smtp-port
    smtp_port=25

    ; For Win32 only.
    ; http://php.net/sendmail-from
    ;sendmail_from = me@example.com

    I added the ini_set

     ini_set("smtp_port", 25);
    mail($_POST['email'], 'Registration Confirmation', $body, 'From: admin@example.com');

    and received the same error message.

    I have looked at several different sources, including the php site and am still at a loss.

  3. I am a little lost on loading the feedback.html form in Ch 3 into a url.  I am running XAMPP, Chrome, Windows 10 but whenever I open the file I get the local path. file:///C:/xampp/htdocs/feedback.html.  I have looked through various advise sites and am no better off.  How do I load this file into a http://url?

    I know my software is installed correctly because it has worked for all the previous exercises.

×
×
  • Create New...