Jump to content

PHP Page failing, without an error as to why - Simple mail() send.


Recommended Posts

Hi to all you clever peeps at PHP Freaks.

This is a great site and i think it's brilliant where everyone is helping everyone else out :-)

 

I think i've gone blind, i can't see what (probably very simple) error i have in my code:

 

<html>

<head>

<title>Thanks for sending in your comments. We really appreciate your feedback</title>

</head>

<body>

<h2>If you have requested a reply, then we shall email you within the next 24hours</h2>

 

<?php

 

ini_set("display_errors", "1");

error_reporting(E_ALL);

 

  $visitors_name = $_POST['VisitorsName'];

  $visitors_email = $_POST['VisitorsEmail'];

  $reply_requested = $_POST['ContactVisitor'];

  $visitors_comments = $_POST[ 'VisitorComments';

  $emailto = '[email protected]';

  $subject = 'Visitor Comments From Website';

   

  echo '<br />';

  echo '<br />';

  echo 'Thanks for using this form.<br />';

  echo '<br />';

  echo 'Your Name is ' . $visitors_name;

  echo '<br />';

  echo 'Your Email is ' . $visitors_email;

  echo '<br />';

  echo 'And you have answered ' . $reply_requested . ' to requesting a reply';

  echo '<br />';

  echo 'Your comments on our site are - ' . $visitors_comments;

 

  $msg = 'The Visitors Name is ' . $visitors_name . '  and the their email is ' . $visitors_email . '  and in response to requesting a reply back then answered - ' . $visitors_comments . '  and their comments on our site are - ' . $visitors_comments;

  echo '<br />';

  echo '<br />';

  echo $msg;

 

mail($emailto, $subject, $msg, 'From:[email protected]');

 

  echo 'Email Sent';

?>

 

</body>

</html>

 

 

It's just a simple bit of code for people to enter comments on one of our websites.

But when we hit submit on the previous html page, I just get the internal server error 500 page.

 

Please could someone point out my foolishness.

 

Many Thanks

Stu

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.