Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Guy's, problem with current install... contact page ! NEED HELP ;)  (Read 4233 times)

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com

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.
Logged
"It's only dead fish that goes with the flow... "
Updated

bramsyuur

  • Hero Member
  • *****
  • Karma: 23
  • Posts: 873
    • http://snews.vietbee.net
Guy's, problem with current install... contact page ! NEED HELP ;)
« Reply #1 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?
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Español

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
Guy's, problem with current install... contact page ! NEED HELP ;)
« Reply #2 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 ?
Logged
"It's only dead fish that goes with the flow... "
Updated