Jump to content

stuartsparks

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

stuartsparks's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks Guys! I knew i'd missed something simple! Cheers Stu
  2. 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
  3. Is that an exchange server you're running there?
  4. It works! Wahoo! Thanks so much! Can't believe that's all it was. Is this the bit i need to change in php.ini : ; - error_reporting = E_ALL ; By default, PHP suppresses errors of type E_NOTICE. These error messages ; are emitted for non-critical errors, but that could be a symptom of a bigger ; problem. Most notably, this will cause error messages about the use ; of uninitialized variables to be displayed. Shall i make it just: error_reporting = E_ALL (removing the colon) Thanks again for your help, now i can move onto the mySQL chapter! :-)
  5. Hi and thanks for the quick reply! I've added those 2 lines of code. But i'm still just getting: 500 - Internal server error. There is a problem with the resource you are looking for on Stus Server, and it cannot be displayed. The full code is (don't laugh!): <html> <head> <title>Stus Test PHP Results Screen</title> </head> <body> <h2>Displaying Text You input from the previous screen</h2> <?php ini_set("display_errors", "1"); error_reporting(E_ALL); $first_name = $_POST['YourFirstName']; $isstugreat = $_POST['isstugreat']; $emailto = '[email protected]'; $subject = 'phptestemail'; echo '<br />'; echo '<br />'; echo 'Thanks for trying this form.<br />'; echo '<br />'; echo 'Your First Name is ' . $first_name; echo '<br />'; echo 'Your Surname is ' . $_POST['YourSurName']; echo '<br />'; echo 'Is Stu Great - ' . $isstugreat; $msg = 'The users firstname is ' . $first_name . ' and the surname is ' . $_POST['YourSurName'] . ' and in response to is Stu Great they answer - ' . $isstugreat; echo '<br />'; echo '<br />'; echo $msg mail($emailto, $subject, $msg, 'From:[email protected]'); echo 'Email Sent'; ?> </body> </html> Thanks again.
  6. Hi, Apologies if this has been asked/answered before, but after much googling and looking through here, i believe i have done this right. But it's not working. I'm new to PHP and am using the Head First book to learn and i'm stuck with sending emails. I'm running PHP 5 on IIs 7 on Windows Server 2008 R2. The php.ini is set up as follows: [mail function] ; For Win32 only. SMTP = sparks-net.co.uk smtp_port = 25 [email protected] auth_password=**** My (basic) PHP script is currently has the command:- mail($emailto, $subject, $msg, 'From:[email protected]'); Obviously the 3 variables are defined and contain valid data. But when the form is submitted on explorer, i just get the "500 - Internal server error" page. If i remove this mail() line of code, then all works fine! Please help, as i don't know what's going wrong, and can't find any log files to help point me in the right direction! Many Thanks Stu
×
×
  • 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.