CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Connecting Form to CIVICRM
Pages: [1]

Author Topic: Connecting Form to CIVICRM  (Read 1139 times)

gavenp

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: WordPress
  • MySQL version: libmysql - 5.0.96
  • PHP version: 5.3.3
Connecting Form to CIVICRM
June 06, 2013, 06:28:37 pm
Hi there,

Complete novice but learning so please be kind.

I have a form.html file that I want to be able to capture the information into my CIVICRM as a Lead or Contact.  a the moment it comes to me in an email with the documents sent to a file on the server.

See attached file.  I will be moving to a wordpress system but thought I would start here.

Can someone assist me as to how to do this as I am sure I also have to add more files in the contacts page of the CRM also.

Thanks

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Connecting Form to CIVICRM
June 07, 2013, 04:49:22 am
I would recommend reading this: http://book.civicrm.org/user/current/the-user-interface/profiles/

Kurund
Found this reply helpful? Support CiviCRM

gavenp

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: WordPress
  • MySQL version: libmysql - 5.0.96
  • PHP version: 5.3.3
Re: Connecting Form to CIVICRM
June 07, 2013, 03:35:31 pm
Thanks for that.  Ill have a read and see if I can figure it out

lwolberg

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.3.1
  • CMS version: WordPress
  • MySQL version: 5.1.67
  • PHP version: 5.4.13
Re: Connecting Form to CIVICRM
June 19, 2013, 08:59:23 pm
I am new to civi also.
I could not find a form for users to add/update their own contact info in Wordpress, only Drupal and Joomla. So I wrote the following simple sign-up.

OBJECTIVE: generic signup form, accepts first name, last name, email, enters as a civi_contact with a default assigned group.

You need some logic, as you cannot insert to multiple tables with one SQL query.

Pseudo code: The logic works as follows
-- validate the names and email
-- insert to civicrm_contact, put the email temporarily into "nickname"
-- query civicrm_contact, discover your contact_id 
-- insert email to civicrm_email, then delete it from nickname
-- assign group by insert to civicrm_group_contact

The relevant SQL queries are as follows

insert contact
INSERT INTO civicrm_contact( contact_type, nick_name, first_name, middle_name, last_name, sort_name, display_name ) VALUES ( '$contact_type' , '$nick_name' , '$first_name' , '$middle_name' , '$last_name' , '$sort_name' , '$display_name' );

get contact id
SELECT id FROM civicrm_contact WHERE nick_name = '$email';

insert email
INSERT INTO civicrm_email (contact_id, location_type_id, email, is_primary) VALUES ($id, 3, '$email', 1);

nickname clear
UPDATE civicrm_contact SET nick_name = '' WHERE id = $id;

insert group (we assign group "2", you might need another group_id)
INSERT INTO civicrm_group_contact (group_id, contact_id, status) VALUES ($group_id, $id, '$status');

Attached, the basic logic
-- contact.php << a form to collect the first, last, email
-- contact-process.php << implementing the logic described above

« Last Edit: June 20, 2013, 01:15:06 am by lwolberg »

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Connecting Form to CIVICRM
June 20, 2013, 12:57:30 am
Quote
We see that profiles and forms are working in Joomla, not yet working in Wordpress.

Profile should work fine in WordPress too. If you are referring to shortcode, that support was added in 4.3.x

Kurund
Found this reply helpful? Support CiviCRM

lwolberg

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.3.1
  • CMS version: WordPress
  • MySQL version: 5.1.67
  • PHP version: 5.4.13
Re: Connecting Form to CIVICRM
June 20, 2013, 01:17:14 am
Kurund--Thanks for the feedback on profiles, I modified my post.

Is there a procedure to enable a simple signup page in Wordpress? How about enabling contacts to manage their own profile details?

If so, I do not need the custom page I defined above!

Thanks in advance. - L

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Connecting Form to CIVICRM
June 20, 2013, 02:18:53 am
Quote
Is there a procedure to enable a simple signup page in Wordpress? How about enabling contacts to manage their own profile details?

I think easiest way would be to use profile in edit mode. That will allow user to edit their info. Note that this link should be shown to only authenticated users.

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Connecting Form to CIVICRM

This forum was archived on 2017-11-26.