SitePoint Sponsor

User Tag List

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

    php form mail script not working after server upgrade

    the script on this page http://www.tedsonmain.net/contact3.php used to work before Godaddy upgraded my server to core6, they checked everything on their end (supposedly) and said it's ok

    Can anyone see a mistake in the script? The submit works, there are no error messages and the form action page at http://www.tedsonmain.net/thanks.php shows up, but the mail is never sent/recieved.
    Thanks for any ideas.

  2. #2
    SitePoint Wizard triexa's Avatar
    Join Date
    Dec 2002
    Location
    Canada
    Posts
    2,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We can't see the source code... only the front end. Post the code of the mail process
    AskItOnline.com - Need answers? Ask it online.
    Create powerful online surveys with ease in minutes!
    Sign up for your FREE account today!
    Follow us on Twitter

  3. #3
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    did you check the email junkbox?
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  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 the form page

    <?
    if(isset($submit)){
    $to = "info@tedsonmain.net";
    $subject = "Feedback from the Website!";
    $body = "A user has entered feedback on the site!\n";
    $body .= "Their feedback is:\n\n";
    $body .= $feedback;
    mail($to, $subject, $body);
    } else {
    }
    ?>
    </p>
    <form action="thanks.php" method="post">
    <span class="style18">your email address</span> <br />
    <input name="email" type="text" size="25" />
    <br />
    <span class="style18">your comments</span><br />
    <textarea name="comments" cols="20" rows="3" id="comments"></textarea>
    </p>
    <input type="submit" name="Submit" value="Submit" /></p></form>

    and the form action page
    <?
    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'];
    $email = $_POST['email'];

    // send form results through email
    $recipient = "info@tedsonmain.net";
    $subject = "Feedback from website";
    $forminfo =
    (
    $comments . "\r\n"
    );
    $formsend = mail("$recipient", "$subject", "$forminfo","$email","From: $email\r\nReply-to:$email\r\n");
    $display .= '';
    $display .= nl2br($forminfo);
    }
    ?>

    Thanks for looking

  5. #5
    SitePoint Wizard triexa's Avatar
    Join Date
    Dec 2002
    Location
    Canada
    Posts
    2,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ugh why are people still doing this!? PLEASE DON'T CODE WITH REGISTER_GLOBALS ON!
    AskItOnline.com - Need answers? Ask it online.
    Create powerful online surveys with ease in minutes!
    Sign up for your FREE account today!
    Follow us on Twitter

  6. #6
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't have one

  7. #7
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry triexa, what does that mean?

  8. #8
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Register_Globals sets the Post and Get form values to variables automatically - which is a very bad idea.

    use $_POST and $_GET to access form variables.

    for example, if the variable is passed through the URL, e.g. page.php?var=value, it's a $_GET variable. But you shouldn't use $var to access it - that can be very dangerous. use $_GET['var'], or set $var to $_GET['var']. same goes for post variables, but you should access them through $_POST instead.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  9. #9
    SitePoint Enthusiast hardline's Avatar
    Join Date
    Jul 1999
    Location
    sopranoland
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks ark, I know very little about coding, my earlier reply was to you too, I don't have a junk box and I also made sure there was no filtering


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
  •