Why is this PHP code showing up as regular text (html)? -
i've been staring @ hour , last resort hoping of guys might give me hand figuring out php code showing regular text in html file? appreciated.
<?php $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; $from = 'from:'; $to = ''; $subject = 'hello'; $human = $_post['human']; $body = "from: $name\n e-mail: $email\n message:\n $message"; if ($_post['submit'] && $human == '4') { if (mail ($to, $subject, $body, $from)) { echo '<p>your message has been sent!</p>'; } else { echo '<p>something went wrong, go , try again!</p>'; } } else if ($_post['submit'] && $human != '4') { echo '<p>you answered anti-spam question incorrectly!</p>'; } ?>
i see 2 possibilities:
a) not running on server, on local pc. if case , don't have acces websapce, @ wamp (windows) or mamp (mac)
b) have .html-file-extension instead of .php
if it's neither of these, give more information you're runnng script, how it's saved , everything. php should never show plain text because of error inside php - merley because of errors surrounding php.
Comments
Post a Comment