Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: php file will not send form

  1. #1
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,093
    Thanks
    157
    Thanked 3 Times in 3 Posts

    Default php file will not send form

    Hi,

    I have a form which can be seen here http://www.theremotedoctor.co.uk/form-contact-new.html

    The form you see on the page has a couple extra fields added from its default state BUT the php file is untouched.
    So when i receive the form in my email the extra fields are not shown.

    I have "what i thought was correct" added the extra text to another php file but the form will not send.
    I have attached below,
    The original php file which works "but has the extra missing fields"
    My edited php file.

    Please could you take a look and advise where i made an error which stops the form being sent.
    It must be something simple but i cant spot it.

    Thanks very much.
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    488
    Thanks
    0
    Thanked 62 Times in 58 Posts

    Default

    In your file at line 41 you are looking for "email_address":

    Code:
            !isset($_POST['email_address']) ||
    but at line 65 you are trying to scan for "email":

    Code:
        $email_from = $_POST['email']; // required
    The entity "email" doesn't exist in the data received from the form so the PHP code will fail.

  3. #3
    Join Date
    Jan 2009
    Location
    NH
    Posts
    673
    Thanks
    97
    Thanked 26 Times in 26 Posts

    Default

    I think this was your problem with the form I gave you too.

  4. #4
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,093
    Thanks
    157
    Thanked 3 Times in 3 Posts

    Default

    Please could you assist with th php with the pages form.
    Last edited by theremotedr; 02-12-2017 at 08:45 PM.

  5. #5
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,093
    Thanks
    157
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by styxlawyer View Post
    In your file at line 41 you are looking for "email_address":

    Code:
            !isset($_POST['email_address']) ||
    but at line 65 you are trying to scan for "email":

    Code:
        $email_from = $_POST['email']; // required
    The entity "email" doesn't exist in the data received from the form so the PHP code will fail.
    Well ive read it but like again makes no sense to me.
    Are you able to look at my form http://www.theremotedoctor.co.uk/form-contact-new.html
    And make the required edits so the form will send please.

    I can then just upload the file & finished for all days works doing this.

  6. #6
    Join Date
    Jan 2009
    Location
    NH
    Posts
    673
    Thanks
    97
    Thanked 26 Times in 26 Posts

    Default

    did you upload the php files folder?

  7. #7
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,093
    Thanks
    157
    Thanked 3 Times in 3 Posts

    Default

    Yes
    It's in the root with all the HTML files.
    It's called send_form_email.php

  8. #8
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    488
    Thanks
    0
    Thanked 62 Times in 58 Posts

    Default

    The problem isn't in the HTML file. As I said before the problem is in line 65 of your modified "send_form_email.php" file.

    On line 185 of the HTML file you have this:

    Code:
          <td valign="top"><label for="email_address">Email Address *</label></td>
    which defines the field identifier as "email_address". But in the PHP file on line 65 you have:

    Code:
    $email_from = $_POST['email']; // required
    which is looking for a field labelled as "email". That field doesn't exist so the PHP will fail. You need to change line 65 in the "send_form_email.php" file to the following:

    Code:
    $email_from = $_POST['email_address']; // required
    That is the first problem I noticed so you need to change that and try it. If it still doesn't work we'll need to look further.

  9. #9
    Join Date
    Jan 2009
    Location
    NH
    Posts
    673
    Thanks
    97
    Thanked 26 Times in 26 Posts

    Default

    theremotedoctor, this page uses the Bootstrap version that I showed you in the other question post. http://ahepa215.org/contact.html

  10. #10
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,093
    Thanks
    157
    Thanked 3 Times in 3 Posts

    Default

    I committed to now getting this php working after what I've done today.
    I can't afford to start over again.

    Are to able to edit the php I supplied above for the current form in use.
    Otherwise it's a needle in the haystack again tomorrow.

    I know it's not the HTML & didn't say it was hence supplying the two php files.

Similar Threads

  1. Resolved IE does not send form ??
    By Losj in forum PHP
    Replies: 2
    Last Post: 11-03-2012, 10:06 PM
  2. mootools form.send
    By nikomou in forum JavaScript
    Replies: 2
    Last Post: 03-24-2009, 11:04 AM
  3. Replies: 6
    Last Post: 03-05-2009, 07:18 AM
  4. Help:(Send form values to a file text whitout refresh the page.
    By pierre jaquet in forum Looking for such a script or service
    Replies: 2
    Last Post: 12-01-2008, 07:40 PM
  5. Replies: 2
    Last Post: 05-28-2008, 04:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •