+ Reply to Thread
Results 1 to 4 of 4

Thread: Sending data form disabled textfiels

  1. #1
    Join Date
    Mar 2006
    Posts
    3

    Default Sending data form disabled textfiels

    Hi,

    I'm using formmail for a while now and never had any problems until now.

    I have two forms. The first form the client has to fill in and click the submit button. All the data of the first form has been send to the second form where all the textfields are disabled.

    The values of the second form are filled in with php :
    <?php print $_POST["name_textfield_of_the_first_form"]; ?>

    When this form appears to be ok, the client clicks submit again.
    Here it goes wrong. I always get the following error:

    The following error occurred in FormMail :
    no_recipients
    **********
    Error=The form has an internal error - no actions or recipients were specified.

    To fill in a form the client has to login first.

    Here you find my form (offerte.php):
    Code:
    <form action="offerte2.php" method="post">
                        
        Firma<br />
        <input name="firma" type="text" />
        <br />
        Contact<br />
        <input name="realname" type="text" />
        <br />
        Straat + nr.<br />
        <input name="straat" type="text" />
        <br />
        Postcode + Gemeente<br />
        <input name="gemeente" type="text" />
        <br />
        E-mail<br />
        <input name="email" type="text" />
        <br />
        Telefoon<br />
        <input name="telefoon" type="text" />
        <br />
        Fax<br />
        <input name="fax" type="text" />
        <br />
        Oplage °<br />
        <input name="oplage" type="text" />
        <br />
        Object °<br />
        <input name="object" type="text"  />
        <br />
        Omvang °<br />
        <input name="omvang" type="text" />
        <br />
        Formaat (B x H mm) °<br />
        <input name="formaat" type="text" />
        <br />
        Papier* °<br />
        <input name="papier" type="text" />
        <br />
        Bedrukking R/V** °<br />
        <input name="bedrukking" type="text"/>
        <br />
        <input name="bevestigen" id="bevestigen" value="Bevestigen" type="submit" />
        <input name="wissen" id="wissen" value="Wissen" type="reset" />
                        
    </form>
    The second form is the same but al the fields are disabled.

    Second form (I've made it shorter) (offerte2.php):
    Code:
    <form method="post" action="formmail.php" name="frm_offerte_verzenden" target="_parent" enctype="text/plain">
                        
        Firma<br />
        <input name="firma" type="text" disabled="disabled" value="<?php print $_POST['firma']; ?>" />
        <br />
        Contact<br />
        <input name="realname" type="text" disabled="disabled" value="<?php print $_POST['realname']; ?>" />
        <br />
        ...
        <br />
        <input name="versturen" id="versturen" value="Versturen" type="submit" class="css_submit"/>
        <input type="hidden" name="recipients" value="info@lasalcommunicatie.be" />
        <input type="hidden" name="required" value="email:Uw e-mail,realname:Uw naam" /> 
        <input type="hidden" name="subject" value="Offerte aaanvraag" />
        <input type="hidden" name="mail_options" value="NoEmpty" />
        <input type="hidden" name="good_url" value="http://www.lasalcommunicatie.be/login/bredero/nl/offerte3.php" />
        <input onClick="javascript: history.go(-1)" name="wijzig" id="wijzig" value="Wijzig" type="button" />
                        
    </form>
    This is the php code I used for the accesscheck in offerte.php and offerte2.php
    Code:
    <?php
    if (!isset($_SESSION)) {
      session_start();
    }
    $MM_authorizedUsers = "";
    $MM_donotCheckaccess = "true";
    
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
      // For security, start by assuming the visitor is NOT authorized. 
      $isValid = False; 
    
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
      // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
      if (!empty($UserName)) { 
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
        // Parse the strings into arrays. 
        $arrUsers = Explode(",", $strUsers); 
        $arrGroups = Explode(",", $strGroups); 
        if (in_array($UserName, $arrUsers)) { 
          $isValid = true; 
        } 
        // Or, you may restrict access to only certain users based on their username. 
        if (in_array($UserGroup, $arrGroups)) { 
          $isValid = true; 
        } 
        if (($strUsers == "") && true) { 
          $isValid = true; 
        } 
      } 
      return $isValid; 
    }
    
    $MM_restrictGoTo = "index.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) 
      $MM_referrer .= "?" . $QUERY_STRING;
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo); 
      exit;
    }
    ?>
    I've searched the forum but did not find the solution.
    All help is welcome.

    Cheers,
    Berthjen

  2. #2
    Join Date
    Dec 2006
    Location
    Israel
    Posts
    17

    Default Re: Sending data form disabled textfiels

    ummm,

    I can't seem to see where you defined the recipients of your form after it has been posted as per the instructions in the formmail documentation in the actual php file.

    What formmail is saying is that it doesn't know who to send it to, and you have to define at least one person who can get the form results, either using a hidden field in your form.

    the error itself is being displayed by the following section of the formmail php file:

    // send email
    //
    if (!isset($SPECIAL_VALUES["recipients"]) || empty($SPECIAL_VALUES["recipients"]))
    {
    //
    // No recipients - don't email anyone...
    // If nothing has been done above (CSV, logging, or CRM),
    // then report an error.
    //
    if (!$bDoneSomething)
    if (!$bGotGoBack && !$bGotNextForm)
    Error("no_recipients",GetMessage(MSG_NO_ACTIONS));
    }

    try adding the hidden field for testing purposes and see if the error stops and of course if you get the email.

    Hth in some way,

    Mike

  3. #3
    Join Date
    Mar 2006
    Posts
    3

    Default Re: Sending data form disabled textfiels

    Hi MikeG,

    THX for your reply.

    The first form doesn't work with formmail. It only sends its content to the second form.
    The second form does work with formmail and there I did use recepients.

    Code:
     <input type="hidden" name="recipients" value="info@mymail.be" />
    Nothing wrong there I guess? Steel looking for a solution.
    Last edited by Berthjen; 04-Jan-2007 at 05:33 PM.

  4. #4
    Join Date
    Mar 2006
    Posts
    3

    Default Re: Sending data form disabled textfiels

    Okey,

    I started over. This time more luck. Not sure how I did it, but it works.

    Formmail sends an e-mail to the requested adress but de e-mail is blank !
    When the textfields are enabled, the email is ok.

    Is it possible to send the value of the disabled textfields???

    The fields must be disabled, because they are filled in by a mysql database and these fields may not be altered by the visitor.

    Conclusion, still looking for a solution for this problem.

    All help welkom.

    Cheers,
    Berthjen

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Sending form results in an HTML email
    By russellr in forum HOWTO Guides and Tips
    Replies: 26
    Last Post: 12-Jan-2006, 09:31 PM
  2. Everything works except sending
    By Froduss in forum FormMail Subscription Support
    Replies: 5
    Last Post: 06-Jul-2004, 09:49 PM
  3. Problem with new server sending mail
    By mstookey in forum FormMail Subscription Support
    Replies: 7
    Last Post: 25-Jun-2004, 02:27 AM
  4. POST form data as well as email
    By zippy in forum FormMail Subscription Support
    Replies: 20
    Last Post: 24-Jan-2004, 05:29 PM
  5. not seeing form data
    By brownie in forum FormMail Subscription Support
    Replies: 6
    Last Post: 19-Jan-2004, 02:37 AM

Bookmarks

Posting Permissions

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