Results 1 to 2 of 2

Thread: custom mail form help?

  1. #1
    Join Date
    Jul 2007
    Posts
    126

    Default custom mail form help?

    guys. where have i gone wrong with this form?

    Code:
    /*===================================================
        ShowFormSpider()
      ===================================================*/
    
      function ShowFormSpider() {
    
        // vars global configuration
        global $dbConn, $theme_path;
    
        // vars url & form
        global $u, $lid, $revid, $looking, $spelling, $to;
    
        // vars messages
        global $msg;
    
        // vars template
        global $error_msg, $email, $name, $looking, $spelling, $body;
    
        if ($u) {
          $to = $u;
        }
        elseif ($lid) {
          $to = $dbConn->Lookup('contact_name', 'idx_link', "link_id = '$lid'");
        }
        elseif ($revid) {
          $to = $dbConn->Lookup('username', 'idx_review', "review_id = '$revid'");
          if (!$to) {
            $to = $dbConn->Lookup('name', 'idx_review', "review_id = '$revid'");
          }
        }
    
        $name    = stripslashes($name);
        $body    = stripslashes($body);
    	$email	 = stripslashes($email);
    	$looking = stripslashes($looking);
    	$spelling    = stripslashes($spelling);
    
        DisplayTemplate($theme_path . "spider_form.html", "\$error_msg,\$email,\$name,\$looking,\$spelling,\$to,\$u,\$lid,\$revid,\$body");
      }
    
    
      /*===================================================
        ProcessFormSpider()
      ===================================================*/
      
      function ProcessFormSpider() {
    
        // vars global configuration
        global $dbConn, $theme_path;
    
        // vars url & form
        global $error_msg, $email, $name, $looking, $spelling, $u, $lid, $revid, $to, $body;
    
        // vars messages
        global $msg;
    
        // vars template
        global $error_msg;
    
        // verify input
    
        $name    = stripslashes($name);
        $body    = stripslashes($body);
    	$email	 = stripslashes($email);
    	$looking = stripslashes($looking);
    	$spelling    = stripslashes($spelling);
    
        if (empty($email))
          $error_msg = $msg["10282"];
    	  
        elseif (!IsEmailAddress($email))
          $error_msg = $msg["10283"];
    	  
    	elseif (empty($name)) {
          $error_msg = $msg["20400"];
        }
    	elseif (empty($looking)) {
          $error_msg = $msg["20500"];
        }
    	elseif (empty($spelling)) {
          $error_msg = $msg["20501"];
        }
    	elseif ($_POST['captcha_key'] != $_SESSION['captcha_key'])
          $error_msg = $msg["10120"];
    	
        if (empty($error_msg)) {
          if ($u) {
            $users_obj             = new clsUsers;
            $users_obj->table_name = "idx_users";
            $email_to              = $users_obj->GetEmailAddress($u);
          }
          elseif ($lid) {
            $email_to = $dbConn->Lookup('email', 'idx_link', "link_id = '$lid'");
          }
          elseif ($revid) {
            $email_to = $dbConn->Lookup('email', 'idx_review', "review_id = '$revid'");
            if (!$email_to) {
              $to = $dbConn->Lookup('username', 'idx_review', "review_id = '$revid'");
              $users_obj             = new clsUsers;
              $users_obj->table_name = "idx_users";
              $email_to              = $users_obj->GetEmailAddress($to);
            }
          }
          
          $email_from = $email;
          $from       = $name . "<$email_from>";
          @mail($email_to, $name, $body, "From: $from \nX-Mailer: INDEXU_X-Mailer/1.0");
    
          DisplayTemplate($theme_path . "spider_ok.html", "\$to,\$u");
        }
        else {
          ShowFormSpider();
        }
      }
    
    
      /*===================================================
        main
      ===================================================*/
    
      include "application.php";
    
      RunPreFilter(__FILE__);
    
      if (empty($pflag)) {
        ShowFormSpider();
      }
      elseif ($pflag == 'send') {
        ProcessFormSpider();
      }
    
      RunPostFilter(__FILE__);
    i need the form to post the vars $looking & $spelling. but if i include as such:

    Code:
    @mail($email_to, $name, $body, $looking, $spelling "From: $from \nX-Mailer: INDEXU_X-Mailer/1.0");
    V5.3

    the form does not send. there are no errors shown and ok form is shown. if i exclude those 2 vars, then i receive the form with the default vars. I cannot see where to amend. cheers
    Last edited by smyhte; 08-20-2007 at 05:56 AM. Reason: addition

  2. #2
    Join Date
    Jul 2007
    Posts
    126

    Default

    ok sorted it.

Similar Threads

  1. notification e-mail different than contact e-mail
    By vsevedko in forum Blocks and Modification
    Replies: 2
    Last Post: 09-23-2006, 09:53 AM
  2. Custom fields in New Ticket form in iDesk?
    By shDave in forum iDesk - Customer Service Helpdesk
    Replies: 0
    Last Post: 09-28-2005, 02:32 PM
  3. custom form field
    By acio in forum v5.x
    Replies: 1
    Last Post: 05-26-2003, 02:59 AM
  4. Replies: 1
    Last Post: 06-24-2002, 06:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •