SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    form mail script without email input

    Can I use a form mail script that does not have a required email field, the formmail script (sunfrog) I used before does not work without the email input,
    my client only wants to have the comments sent to him
    see http://www.tedsonmain.net/contact.html

    Thanks for any help, PHP is way over my head,

  2. #2
    SitePoint Guru
    Join Date
    Feb 2004
    Location
    Oregon
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so why can't you take the email out of the form and just have it hard coded in the email function?
    success is not by chance, it is by choice.

  3. #3
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's when it doesn't work,
    once I take out the email field and any reference to it in php file it doesn't send

  4. #4
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    this is code when I take out the email filed

    <?
    if ((!$comments))
    {
    $display .= '<p align="center">All fields are required. Please check your information and try again.</p>';
    $display .= '<p align="center"><a href=javascript:history.back()>Go back</a></p>';
    }
    else{

    $comments = $_POST['comments'];

    // send form results through email
    $recipient = "hardy@mydomain.com";
    $subject = "Feedback from website";
    $forminfo =
    (
    $comments . "\r\n" .
    );
    $formsend = mail("$subject", "$forminfo");
    $display .= '<p>Thank you. You have successfully submitted the following information/p>';
    $display .= nl2br($forminfo);
    }
    ?>

  5. #5
    SitePoint Guru
    Join Date
    Feb 2004
    Location
    Oregon
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    change this line

    $formsend = mail("$subject", "$forminfo");

    To this

    $formsend = mail($recipient,"$subject", "$forminfo");
    success is not by chance, it is by choice.

  6. #6
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, but not happening yet
    http://www.tedsonmain.net/contact3.php

  7. #7
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sahajin, you did it, I think it was the missing " " on recipient,
    thanks for your help !

  8. #8
    SitePoint Guru
    Join Date
    Feb 2004
    Location
    Oregon
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can do this as well

    $formsend = mail($recipient,$subject, $forminfo);

    You do not need the quotes for variables.
    success is not by chance, it is by choice.


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
  •