+ Post New Thread
Results 1 to 8 of 8
Coding Thread, Feedback form in Coding and Web Development; I have designed two forms, first one is feedbackform.html and the second one is messagesent.php. When someone fills in the ...
  1. #1

    Join Date
    Nov 2007
    Posts
    8
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Feedback form

    I have designed two forms, first one is feedbackform.html and the second one is messagesent.php.
    When someone fills in the feedbackform and clicks submit, it gives the message that Thank you for message. We will respond as soon as we can. My feedback form is suppose to send me the comments to my email address but unfortunately it doesn't do that. I have checked my code again and again but can't see what I have done wrong.
    Following is the code for my feedbackform.html:


    Code:
    <!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=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    Website comments/Suggestions
    <form id="frm_message" name="frm_message" method="post" action="messagesent.php">
      <table width="482" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="2">Website comments/Suggestions </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>Your email address </td>
          <td><input name="emailaddress" type="text" id="emailaddress" size="55" /></td>
        </tr>
        <tr>
          <td>Subject</td>
          <td><label>
          <input name="subject" type="text" id="subject" size="55" />
          </label></td>
        </tr>
        <tr>
          <td>Comments</td>
          <td><textarea name="textarea" cols="55"></textarea></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" name="Submit" value="Submit" /></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>
    </form>
    <p>
      <!-- Website Contact Form Generator -->
      <!-- http://www.tele-pro.co.uk/scripts/contact_form/ -->
      <!-- This script is free to use as long as you  -->
      <!-- retain the credit link  -->
    </p>
    </body>
    </html>
    My code for the messagesent.php is as follows:

    Code:
    <!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=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <p>
    <?php
    mail($_POST['jtanna1@gamil.com'], $_POST['subject'],
    $_POST ['textarea']);
    ?>
    </p>
    <p>Thank you for message. We will respond as soon as we can.  </p>
    </body>
    </html>
    Would someone help me please. Check the above two and see where I am going wrong.

    Thanks in advance.

    Jay

  2. #2

    Join Date
    Nov 2007
    Location
    Preston
    Posts
    98
    Thank Post
    2
    Thanked 4 Times in 4 Posts
    Rep Power
    14
    Id hate for this to be the problem but, is your address a gmail account? or gamil account? lol

  3. #3

    Join Date
    Nov 2007
    Posts
    8
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Feedback form

    No I used the school email address and it didn't work. This morning I put gmail address and it did work so I don't understand why it wouldn't work with the other addresses.
    Sorry I noticed that you were just referring to the spelling mistake. With the correct gmail address it does work, but doesn't work with hotmail or the school email address. I am certain that I have not got a spelling mistake.
    Last edited by tannajay; 1st May 2008 at 12:34 PM.

  4. #4

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,546
    Thank Post
    719
    Thanked 1,682 Times in 1,497 Posts
    Rep Power
    432
    Well spotted that man

  5. #5

    Join Date
    Nov 2007
    Location
    Preston
    Posts
    98
    Thank Post
    2
    Thanked 4 Times in 4 Posts
    Rep Power
    14
    Hm, thats interesting, why dont you try printing the contents of your $_POSTS to try to debug?

  6. #6
    Shane's Avatar
    Join Date
    Apr 2007
    Location
    Kernow
    Posts
    166
    Thank Post
    23
    Thanked 14 Times in 12 Posts
    Rep Power
    22
    Have you managed to get any other of your PHP scripts to send an email?
    There is some settings in the php.ini file you need to set before you can send mail using a PHP script.

    I set these in the PHP script where I need it to send an email:

    ini_set('SMTP','email server address');
    ini_set('smtp_port','25');
    ini_set('sendmail_from','somename@someemailaddress .com');
    Last edited by Shane; 1st May 2008 at 01:03 PM.

  7. #7

    Join Date
    May 2008
    Location
    Birmingham
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Are you running on IIS and windows server?

  8. #8
    Iain's Avatar
    Join Date
    Oct 2006
    Location
    Warwickshire
    Posts
    189
    Thank Post
    28
    Thanked 94 Times in 54 Posts
    Rep Power
    32
    Your call to the mail function appears to be wrong in messagesent.php, you are passing a variable to it that has not been declaired: $_POST['jtanna1@gamil.com']

    It should read something like:

    Code:
    mail('jtanna1@gmail.com', $_POST['subject'], $_POST['textarea'], 'From: '.$_POST['emailaddress']."\r\n");
    Take a look here for more info on the mail function.

    Hope that is of some help,

    Iain

SHARE:
+ Post New Thread

Similar Threads

  1. Website feedback
    By Edu-IT in forum General Chat
    Replies: 1
    Last Post: 26th April 2008, 08:10 PM
  2. BETT Feedback
    By GrumbleDook in forum BETT 2014
    Replies: 2
    Last Post: 13th March 2008, 11:50 PM
  3. EEE PCs - anyone got feedback
    By speckytecky in forum General Chat
    Replies: 6
    Last Post: 16th January 2008, 01:27 PM
  4. Replies: 6
    Last Post: 29th November 2007, 03:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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