33 users online (0 members and 33 guests)  

Thread: PHP Form Help


  Results 1 to 6 of 6

Related

  1. Replies: 1
  2. Replies: 4
  3. Replies: 1
  4. Form Handling Script for 'Tell A Friend' Form    Forum: Javascript Forum
    Replies: 1
  5. Replies: 3
  1. #1
    MR2nice's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    3

    PHP Form Help

    Hi,

    I'm using the mailer.php posted in this thread:

    http://www.ahfb2000.com/webmaster_help_desk/showthread.php?t=583&highlight=mailer.php

    Everything is working great and I like the simplicity of the script. However, I would like to change 1 option from the script so that when I receive an email it should display the sender's email address instead of what is typed at this line:

    $from = "From: My Website Emailer";

    Is this possible?

    Thanks,
    Ken

  2. #2
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: PHP Form Help

    Try to replace the code that you've pointed with:
    Code:
    $from = "From: ".$_POST['Email'];
    Checkout my porfolio.
    Please click the button when a member helped you.
    Take time to use Forum's Search function.

  3. #3
    MR2nice's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    3

    Re: PHP Form Help

    I gave it a try, but the Sender shows up as blank. Thunderbird flashed the incoming sender as "undefined."

  4. #4
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: PHP Form Help

    It's best indication is that you don't have a field whose name is Email in your form.

    Try to recheck your markup. Ensure that the name of the "email textbox" matches that of the POST's key.

    Hope that makes sense.
    Checkout my porfolio.
    Please click the button when a member helped you.
    Take time to use Forum's Search function.

  5. #5
    MR2nice's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    3

    Re: PHP Form Help

    rangana,

    Thank you so much for your help. I changed the name from "email" to "Email" like you've pointed it out and it works now. Thanks again!

  6. #6
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: PHP Form Help

    Quote Originally Posted by MR2nice View Post
    rangana,

    Thank you so much for your help. I changed the name from "email" to "Email" like you've pointed it out and it works now. Thanks again!
    This is a recommendation for all PHP programming. As PHP is case sensitive (i.e. "Email" and "email" are two completely different words and not related at all), it is good practice to at least start everything in lowercase. The exception to that is constants. This will provide consistency throughout the code making it easier to read, understand, and maintain.



Tags for this Thread