sNews Forum

Previous sNews versions => sNews 1.3 => sNews 1.3 problem solving => Topic started by: Patric Ahlqvist on December 02, 2006, 01:55:39 pm

Title: Guy's, problem with current install... contact page ! NEED HELP ;)
Post by: Patric Ahlqvist on December 02, 2006, 01:55:39 pm
Hey guy's this problem might not seem big to you as we are on 1.5 soon enough ;)... but it is to me.

The contact page works well in default appearance, but when applying the BRAM SPAM solution it mocks things up a bit...What happens is that in the SPAM version the mail never get sent, and instead of coming to the thankyou page, you and up at a blank center function...

I have turned the feature of for now, but will need to get the contact page up and then with Bram's captcha solution...

The working code is ths:
Quote from: doddeling someting that I
// CONTACT
function contact() {
if ($_POST['show'] = "contact" AND $_POST['contactform'] == "") {?>
   


   

      

:


      


      :


      


      :


      


      :


        


        


   

     if (isset($_POST['contactform'])) {
   $to = s('website_email');
   $subject = s(contact_subject);
   $body = l('name') .": ". $_POST['name'] ."\n";
   $body .= l('email') .": ". $_POST['email'] ."\n";
   $body .= l('url') .": ". $_POST['weblink'] ."\n\n";
   $body .= l('message') .": ". $_POST['message'] ."\n";
if (strlen($_POST['name']) > 1 AND strlen($_POST['message']) > 1) {
   mail($to, $subject, $body);
   echo "

". l('contact_sent') ."

";
     echo "

". l('backhome') ."

";
} else {
   echo "

". l('contact_not_sent') ."

";
   echo "

". l('message_error') ."

";
   echo "

". l('backhome') ."

";
}}}
And Brams' enhanced SPAM controller uses the audit and button.php  and looks like this:
Quote from: bram have not
// CONTACT
function contact() {
if ($_POST['show'] = "contact" AND $_POST['contactform'] =="") {?>
   


   

      :

      
      
:

      

      :

      

      
:
        










        

   

     if (isset($_POST['contactform'])) {
   $to = s('website_email');
   $subject = s(contact_subject);
   $body = l('name') .": ". $_POST['name'] ."\n";
   $body .= l('email') .": ". $_POST['email'] ."\n";
   $body .= l('url') .": ". $_POST['weblink'] ."\n\n";
   $body .= l('message') .": ". $_POST['message'] ."\n";
if (strlen(clean($_POST['name'])) > 1 AND strlen(clean($_POST['message'])) > 1 AND audit()) {
   mail($to, $subject, $body);
   echo "

". l('contact_sent') ."

";
     echo "

". l('backhome') ."

";
} else {
   echo "

". l('contact_not_sent') ."

";
   echo "

". l('message_error') ."

";
   echo "

". l('backhome') ."

";
}}}
The only thing changed from the working default contact function to this not working SPAM protected version is what's posted here... I need help.
Title: Guy's, problem with current install... contact page ! NEED HELP ;)
Post by: bramsyuur on December 02, 2006, 05:51:59 pm
Patric:
Are you sure that you include the file "audit.php" in the index.php file? Are both, audit.php and button.php in the same folder as sNews?
Title: Guy's, problem with current install... contact page ! NEED HELP ;)
Post by: Patric Ahlqvist on December 02, 2006, 06:04:02 pm
Yupp, both files are in there, I am using this for comments currently, so it works, it's just the contactform that's bugging things up...

It is a ver 1.3 install, but as the "commentary SPAM sheild" work,  why don't contact ?