Results 1 to 8 of 8

Thread: Create Lead Form

  1. #1
    ff76 is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    96

    Default Create Lead Form

    Hi,

    I have create a Campaign and I create Lead Capture but when I insert the Lead appeara this message:

    Method Not Allowed
    The request method POST is inappropriate for the URL /.

    The Url redirect is http://www.google.it

    How I can do to resolve this problem?

    Thank You

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Create Lead Form

    Did you set the redirect_url to google?
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  3. #3
    ff76 is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    96

    Default Re: Create Lead Form

    Quote Originally Posted by kuske View Post
    Did you set the redirect_url to google?
    yes.. Is a test..

    P.S.: I have apache

  4. #4
    ff76 is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    96

    Default Re: Create Lead Form

    Quote Originally Posted by ff76 View Post
    yes.. Is a test..

    P.S.: I have apache
    I tested this with other Url redirect but appear the message:

    Method Not Allowed
    The request method POST is inappropriate for the URL /.

  5. #5
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Create Lead Form

    The problem is that modules/Campaigns/WebToLeadCapture.php posts all the form paramters it was called with to the redirect url.

    I had the same problem calling a typo3 landing page.

    With that link to google I found the solution.

    Look to the code:
    PHP Code:
     
       
    if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){
        echo 
    '<html><head><title>SugarCRM</title></head><body>';
        echo 
    '<form name="redirect" action="' .$_POST['redirect_url']. '" method="POST">';
        foreach(
    $_POST as $param => $value) {
         if(
    $param != 'redirect_url' ||$param != 'submit') {
          echo 
    '<input type="hidden" name="'.$param.'" value="'.$value.'">';
         }
        }
        if(empty(
    $lead)) {
         echo 
    '<input type="hidden" name="error" value="1">';
        }
        echo 
    '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
        echo 
    '</body></html>';
       }
       else{
        echo 
    $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD'];
       }
       
    sugar_cleanup(); 
    Just change the method to get and comment the posting of the paramters

    PHP Code:
       if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){
        echo 
    '<html><head><title>SugarCRM</title></head><body>';
    /*** METHOD TO GET ***/
        
    echo '<form name="redirect" action="' .$_POST['redirect_url']. '" method="GET">';
    /*** NO PARAMS ***
        foreach($_POST as $param => $value) {
         if($param != 'redirect_url' ||$param != 'submit') {
          echo '<input type="hidden" name="'.$param.'" value="'.$value.'">';
         }
        }
        if(empty($lead)) {
         echo '<input type="hidden" name="error" value="1">';
        }
    *** NO PARAMS ***/
        
    echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
        echo 
    '</body></html>';
       }
       else{
        echo 
    $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD'];
       }
       
    sugar_cleanup(); 
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  6. #6
    ff76 is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    96

    Default Re: Create Lead Form

    Quote Originally Posted by kuske View Post
    The problem is that modules/Campaigns/WebToLeadCapture.php posts all the form paramters it was called with to the redirect url.

    I had the same problem calling a typo3 landing page.

    With that link to google I found the solution.

    Look to the code:
    PHP Code:
     
       
    if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){
        echo 
    '<html><head><title>SugarCRM</title></head><body>';
        echo 
    '<form name="redirect" action="' .$_POST['redirect_url']. '" method="POST">';
        foreach(
    $_POST as $param => $value) {
         if(
    $param != 'redirect_url' ||$param != 'submit') {
          echo 
    '<input type="hidden" name="'.$param.'" value="'.$value.'">';
         }
        }
        if(empty(
    $lead)) {
         echo 
    '<input type="hidden" name="error" value="1">';
        }
        echo 
    '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
        echo 
    '</body></html>';
       }
       else{
        echo 
    $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD'];
       }
       
    sugar_cleanup(); 
    Just change the method to get and comment the posting of the paramters

    PHP Code:
       if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){
        echo 
    '<html><head><title>SugarCRM</title></head><body>';
    /*** METHOD TO GET ***/
        
    echo '<form name="redirect" action="' .$_POST['redirect_url']. '" method="GET">';
    /*** NO PARAMS ***
        foreach($_POST as $param => $value) {
         if($param != 'redirect_url' ||$param != 'submit') {
          echo '<input type="hidden" name="'.$param.'" value="'.$value.'">';
         }
        }
        if(empty($lead)) {
         echo '<input type="hidden" name="error" value="1">';
        }
    *** NO PARAMS ***/
        
    echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
        echo 
    '</body></html>';
       }
       else{
        echo 
    $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD'];
       }
       
    sugar_cleanup(); 

    Thank you very much...
    You have resolve my problem..

  7. #7
    pigin is offline Junior Member
    Join Date
    Dec 2008
    Posts
    2

    Default Re: Create Lead Form

    Thank you. We used redirect to send people to register with gotomeeting. The gotomeeting changed smth in the system, thus their system stoped acepting redirected from webtolead form. I changed post to get as above, it solved the problem Thanks a lot!!

  8. #8
    manuel2283 is offline Junior Member
    Join Date
    Jul 2009
    Posts
    4

    Default Re: Create Lead Form

    FYI I had to to do the opposite. I just Installed version 6.0.0RC2 (Build 3840) and my forms were being submitted but not redirected properly, I would be returned to the original page that had the form but with alll the data submitted from the last form as part of the URL.

    Hope this helps someone.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do I customize the create lead form?
    By jharris in forum Help
    Replies: 1
    Last Post: 2010-02-17, 10:09 AM
  2. Replies: 10
    Last Post: 2009-08-05, 11:48 AM
  3. Create Lead Form.
    By xmaulino in forum General Discussion
    Replies: 2
    Last Post: 2009-07-28, 01:34 PM
  4. How do I create a web 2 lead form with sugar
    By marktaggart in forum Help
    Replies: 1
    Last Post: 2008-07-21, 09:03 PM

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
  •