wedge00 Posted October 20, 2009 Share Posted October 20, 2009 Hi Folks, I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form with PHP code in it- grabbed it from the sitemaster website. Unfortunately my form isn't sending any information to the account or anything when i hit submit- I'm using Go Live CS (Don't ask) The problem is when I preview the PHP code i get this. is_valid) { header( "Location: $errorurl" ); exit ; } } if (empty($email)) { $email = $mailto ; } $fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ; if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $fullname\n" . "Email of sender: $email\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; $headers = "From: \"$fullname\" <$fromemail>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.15.0" . $headersep . 'MIME-Version: 1.0' . $headersep . $content_type ; if ($use_envsender) { mail($mailto, $subject, $messageproper, $headers, $envsender ); } else { mail($mailto, $subject, $messageproper, $headers ); } header( "Location: $thankyouurl" ); exit ; ?> That comes up Quote Link to comment Share on other sites More sharing options...
xnowandtheworldx Posted October 20, 2009 Share Posted October 20, 2009 Well for one, you need to format your code when you post here within the php tags. two its fragmented code...do you not have the full code? without the full code it can't be much help, but I have a feeling you forgot an opening PHP tag. is_valid) { header( "Location: $errorurl" ); exit; } } if (empty($email)) { $email = $mailto ; } $fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ; if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $fullname\n" . "Email of sender: $email\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; $headers = "From: \"$fullname\" <$fromemail>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.15.0" . $headersep . 'MIME-Version: 1.0' . $headersep . $content_type; if ($use_envsender) { mail($mailto, $subject, $messageproper, $headers, $envsender ); } else { mail($mailto, $subject, $messageproper, $headers ); } header( "Location: $thankyouurl" ); exit; } //missing a closing bracket too ?> Quote Link to comment Share on other sites More sharing options...
wedge00 Posted October 20, 2009 Author Share Posted October 20, 2009 <?php /* CHFEEDBACK.PHP Feedback Form PHP Script Ver 2.15.0 Generated by thesitewizard.com's Feedback Form Wizard 2.15.0. Copyright 2000-2009 by Christopher Heng. All rights reserved. thesitewizard is a trademark of Christopher Heng. Get the latest version, free, from: http://www.thesitewizard.com/wizards/feedbackform.shtml You can read the Frequently Asked Questions (FAQ) at: http://www.thesitewizard.com/wizards/faq.shtml I can be contacted at: http://www.thesitewizard.com/feedback.php Note that I do not normally respond to questions that have already been answered in the FAQ, so *please* read the FAQ. LICENCE TERMS 1. You may use this script on your website, with or without modifications, free of charge. 2. You may NOT distribute or republish this script, whether modified or not. The script can only be distributed by the author, Christopher Heng. 3. THE SCRIPT AND ITS DOCUMENTATION ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. YOU AGREE TO BEAR ALL RISKS AND LIABILITIES ARISING FROM THE USE OF THE SCRIPT, ITS DOCUMENTATION AND THE INFORMATION PROVIDED BY THE SCRIPTS AND THE DOCUMENTATION. If you cannot agree to any of the above conditions, you may not use the script. Although it is not required, I would be most grateful if you could also link to thesitewizard.com at: http://www.thesitewizard.com/ */ // ------------- CONFIGURABLE SECTION ------------------------ // $mailto - set to the email address you want the form // sent to, eg //$mailto = "youremailaddress@example.com" ; $mailto = 'cacsapublic@gmail.com' ; // $subject - set to the Subject line of the email, eg //$subject = "Feedback Form" ; $subject = "Feedback Form" ; // the pages to be displayed, eg //$formurl = "http://www.example.com/feedback.html" ; //$errorurl = "http://www.example.com/error.html" ; //$thankyouurl = "http://www.example.com/thankyou.html" ; $formurl = "http://www.cacsa.org/feedback.html" ; $errorurl = "http://www.cacsa.org.au/error.html" ; $thankyouurl = "http://www.cacsa.org./thankyou.html" ; $email_is_required = 1; $name_is_required = 1; $comments_is_required = 1; $uself = 0; $use_envsender = 0; $use_sendmailfrom = 0; $use_webmaster_email_for_from = 0; $use_utf8 = 1; $my_recaptcha_private_key = '6Ld25AgAAAAAAPNOXBAXmj-Xd2-DjPmfCK8Co_9I' ; // -------------------- END OF CONFIGURABLE SECTION --------------- $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' : 'Content-Type: text/plain; charset="utf-8"' ; if (!isset( $use_envsender )) { $use_envsender = 0 ; } if (isset( $use_sendmailfrom ) && $use_sendmailfrom) { ini_set( 'sendmail_from', $mailto ); } $envsender = "-f$mailto" ; $fullname = (isset($_POST['fullname']))? $_POST['fullname'] : $_POST['name'] ; $email = $_POST['email'] ; $comments = $_POST['comments'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (($email_is_required && (empty($email) || !preg_match('/@/', $email))) || ($name_is_required && empty($fullname)) || ($comments_is_required && empty($comments))) { header( "Location: $errorurl" ); exit ; } if ( preg_match( "/[\r\n]/", $fullname ) || preg_match( "/[\r\n]/", $email ) ) { header( "Location: $errorurl" ); exit ; } if (strlen( $my_recaptcha_private_key )) { require_once( 'recaptchalib.php' ); $resp = recaptcha_check_answer ( $my_recaptcha_private_key, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] ); if (!$resp->is_valid) { header( "Location: $errorurl" ); exit ; } } if (empty($email)) { $email = $mailto ; } $fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ; if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $fullname\n" . "Email of sender: $email\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; $headers = "From: \"$fullname\" <$fromemail>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.15.0" . $headersep . 'MIME-Version: 1.0' . $headersep . $content_type ; if ($use_envsender) { mail($mailto, $subject, $messageproper, $headers, $envsender ); } else { mail($mailto, $subject, $messageproper, $headers ); } header( "Location: $thankyouurl" ); exit ; ?> Sorry new to all of this stuff- it's a steep lerning curve- cheers for the assistance Quote Link to comment Share on other sites More sharing options...
xnowandtheworldx Posted October 20, 2009 Share Posted October 20, 2009 Well I tested the code on my server, and the PHP code seems to be running fine, it could possibly be the apache configuration. I would make sure that your file has the correct file extension....other than that I don't really know what to tell you. Hopefully someone else can provide some input as well as I'm a noob when it comes to PHP/Apache configuration. Quote Link to comment Share on other sites More sharing options...
wedge00 Posted October 20, 2009 Author Share Posted October 20, 2009 Okay. Here is the form- It's not sending an email through to the listed account and it's not going to a successful or error page either. It just displays the form. http://www.cacsa.org.au/ And then click on Email subscription Quote Link to comment Share on other sites More sharing options...
xnowandtheworldx Posted October 20, 2009 Share Posted October 20, 2009 <form action="file:///Users/alan/Desktop/feedback.php" method="post"> do you have the file in which the data posts on your server? Quote Link to comment Share on other sites More sharing options...
wedge00 Posted October 20, 2009 Author Share Posted October 20, 2009 Thanks for the assistance! I really appreciate- it's working now- (Picked right!) Definitely going to be coming back for more help! Quote Link to comment Share on other sites More sharing options...
xnowandtheworldx Posted October 20, 2009 Share Posted October 20, 2009 Thanks for the assistance! I really appreciate- it's working now- (Picked right!) Definitely going to be coming back for more help! Your welcome don't forget to click "Topic Solved!" down at the bottom. Glad I could help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.