Results 1 to 8 of 8

Thread: Pass Form Variables to LeadCapture.php

  1. #1
    insyncnet is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    26

    Default Pass Form Variables to LeadCapture.php

    Trying to figure out how to pass form variables including username and userhash to LeadCapture.php. This is what I am using, but the lead is not getting recorded....

    $getuser = $_POST['user'];
    $gethash = $_POST['assigned_user_id'];

    $users = array(
    'echo "$getuser";' => array('name'=>'echo "$getuser";', 'pass'=>'echo "$gethash";'),
    );

  2. #2
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: Pass Form Variables to LeadCapture.php

    The input variables 'assigned_user_id' and 'user' must exist on your original form that posts to the lead capture in order for this to work.
    If they are, then try echoing them to see what they are. If the user doesn't match, then it won't work. Also, the pass should be the password of that user in your sugar instance.

    -Sadek

  3. #3
    insyncnet is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    26

    Default Re: Pass Form Variables to LeadCapture.php

    Thanks for the reply. I echoed the form values, and they are correct. However, LeadCapture.php only works when I enter the username there, instead of trying to use a variable. Also, you said I need the user password - I thought it was user hash. Please clarify.

    Bottom line, does anyone have a way to pass the username and userhash to LeadCapture.php. It would be much appreciated....

  4. #4
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: Pass Form Variables to LeadCapture.php

    Quote Originally Posted by insyncnet
    Also, you said I need the user password - I thought it was user hash. Please clarify.
    Yes, that is what I meant. You should be passing the user hash.

    The only thing that confused me was the:
    Code:
    $gethash = $_POST['assigned_user_id'];
    The name 'assigned_user_id' does not sound like a user password hash.

    -Sadek

  5. #5
    insyncnet is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    26

    Default Re: Pass Form Variables to LeadCapture.php

    Sorry for the confusion, this is the code I'm currently trying to get to work....

    $username = $_POST['user'];
    $userhash = $_POST['hash'];

    $users = array(
    'echo "$username";' => array('name'=>'echo "$username";', 'pass'=>'echo "$userhash";'),
    );

  6. #6
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: Pass Form Variables to LeadCapture.php

    Ahh, silly of me not to see this:

    In php, you can't do echo statements within quotes.

    Change:
    Code:
    $users = array(
      'echo "$username";' => array('name'=>'echo "$username";', 'pass'=>'echo "$userhash";'),
    );
    to:
    Code:
    $users = array(
      "$username" => array('name'=>"$username", 'pass'=>"$userhash"),
    );

  7. #7
    insyncnet is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    26

    Default Re: Pass Form Variables to LeadCapture.php

    Bingo. Works Great. Thanks for your help!! My ColdFusion background has not prepared me very well for PHP...

  8. #8
    sadek's Avatar
    sadek is offline Sugar Team Member
    Join Date
    Sep 2005
    Posts
    244

    Default Re: Pass Form Variables to LeadCapture.php

    Yes, completely different languages

Thread Information

Users Browsing this Thread

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

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
  •