How can I save email adress like array?

Home Forums Quform WordPress How can I save email adress like array?

This topic is: resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #9113
    morarioan
    Participant

    I use email adress from one field to create one folder.

    But this code doesn’t work.
    For example if i inserted: first_second@gmail.com my folder is first, and I need folder with same name like email.

    This code is what I used and dont work good:

    function mytheme_override_upload_path($path, $element)
    {
    $newfolder = $element->getForm()->getValue(‘iphorm_1_57’);
    return “$newfolder/”;
    }
    add_filter(‘iphorm_upload_path_1’, ‘mytheme_override_upload_path’, 10, 2);

    #9117
    morarioan
    Participant

    Help me fast if you can! Thx

    #9130
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #9131
    morarioan
    Participant

    Dont works for me. I checked with test_example@example.ro and folder was created just “test”. Where can be the problem?

    #9132
    morarioan
    Participant

    My code:

    function modify_contact_methods($profile_fields) {

    // Add new fields
    $profile_fields[‘datee’] = ‘Date of Submission’;
    $profile_fields[‘company_name’] = ‘Company Name’;
    $profile_fields[‘url’] = ‘Company Website’;
    $profile_fields[‘additional_name’] = ‘Additional Name’;
    $profile_fields[‘main_contact’] = ‘Main Contact’;
    $profile_fields[‘phone’] = ‘Main Contact Phone Number’;
    $profile_fields[‘docket’] = ‘Docket#’;
    $profile_fields[‘dot’] = ‘DOT#’;
    $profile_fields[‘year_in_business’] = ‘#Year in Business’;
    $profile_fields[‘physical_address’] = ‘Main Office: Physical Address’;
    $profile_fields[‘city’] = ‘City’;
    $profile_fields[‘state’] = ‘State/Province’;
    $profile_fields[‘postal_code’] = ‘Postal Code’;
    $profile_fields[‘organization_type’] = ‘Organization Type’;
    $profile_fields[‘federal’] = ‘Federal Safety Rating’;
    $profile_fields[‘q1’] = ‘Do you use owner-operators?’;
    $profile_fields[‘q2’] = ‘Does your Automobile Liability insurance cover the owner-ops?’;
    $profile_fields[‘q3’] = ‘Does your Cargo insurance cover the owner-ops?’;
    $profile_fields[‘other_text’] = ‘Other’;
    $profile_fields[‘q4’] = ‘Are you a Certified Minority-Owned Business Enterprise?’;
    $profile_fields[‘upl1’] = ‘» Uploaded file’;
    $profile_fields[‘q5’] = ‘Are you a Certified Women-Owned Business Enterprise?’;
    $profile_fields[‘upl2’] = ‘» Uploaded file’;
    $profile_fields[‘upl3’] = ‘W-9 Uploaded file’;
    $profile_fields[‘upl4’] = ‘Insurance Certificate Upload file’; //multiple
    $profile_fields[‘upl5’] = ‘Motor Carrier Agreement Uploaded file’;

    return $profile_fields;
    }
    add_filter(‘user_contactmethods’, ‘modify_contact_methods’);

    function mytheme_check_username_exists($valid, $value, $element)
    {
    if (username_exists($value)) {
    $element->addError(‘This username is already taken’);
    $valid = false;
    }

    return $valid;
    }
    add_filter(‘iphorm_element_valid_iphorm_1_3’, ‘mytheme_check_username_exists’, 10, 3);
    function mytheme_check_email_exists($valid, $value, $element)
    {
    if (email_exists($value)) {
    $element->addError(‘This email address is already registered’);
    $valid = false;
    }

    return $valid;
    }
    add_filter(‘iphorm_element_valid_iphorm_1_57’, ‘mytheme_check_email_exists’, 10, 3);
    function mytheme_register_wp_user($form)
    {
    $username = $form->getValue(‘iphorm_1_57’);
    $email = $form->getValue(‘iphorm_1_57’);
    $url = $form->getValue(‘iphorm_1_56’);
    $password = $form->getValue(‘iphorm_1_53’);
    $company_name = $form-> getValue(‘iphorm_1_3’);
    $additional_name = $form-> getValue(‘iphorm_1_4’);
    $main_contact = $form-> getValue(‘iphorm_1_5’);
    $phone = $form-> getValue(‘iphorm_1_47’);
    $docket = $form-> getValue(‘iphorm_1_9’);
    $dot = $form-> getValue(‘iphorm_1_10’);
    $year_in_business = $form-> getValue(‘iphorm_1_11’);
    $physical_address = $form-> getValue(‘iphorm_1_12’);
    $city = $form-> getValue(‘iphorm_1_15’);
    $state = $form-> getValue(‘iphorm_1_50’);
    $postal_code = $form-> getValue(‘iphorm_1_17’);
    $organization_type = $form-> getValue(‘iphorm_1_19’);
    $federal = $form-> getValue(‘iphorm_1_20’);
    $q1 = $form-> getValue(‘iphorm_1_26’);
    $q2 = $form-> getValue(‘iphorm_1_27’);
    $q3 = $form-> getValue(‘iphorm_1_28’);
    $other_text = $form-> getValue(‘iphorm_1_29’);
    $q4 = $form-> getValue(‘iphorm_1_30’);
    $upl1 = $form-> getValue(‘iphorm_1_31’);
    $upl1 = isset($upl1[0][‘url’]) ? $upl1[0][‘url’] : ”;
    $q5 = $form-> getValue(‘iphorm_1_32’);
    $upl2 = $form-> getValue(‘iphorm_1_33’);
    $upl2 = isset($upl2[0][‘url’]) ? $upl2[0][‘url’] : ”;
    $upl3 = $form-> getValue(‘iphorm_1_36’);
    $upl3 = isset($upl3[0][‘url’]) ? $upl3[0][‘url’] : ”;
    $upl4 = $form-> getValue(‘iphorm_1_41’);
    $upl4 = isset($upl4[0][‘url’]) ? $upl4[0][‘url’] : ”;
    $upl5 = $form-> getValue(‘iphorm_1_44’);
    $upl5 = isset($upl5[0][‘url’]) ? $upl5[0][‘url’] : ”;
    $datee = $form-> getValuePlain(‘iphorm_1_23’);

    wp_insert_user(array(
    ‘datee’ => $datee,
    ‘user_login’ => $username,
    ‘user_pass’ => $password,
    ‘user_email’ => $email,
    ‘url’ => $url,
    ‘company_name’ => $company_name,
    ‘additional_name’ => $additional_name,
    ‘main_contact’ => $main_contact,
    ‘phone’ => $phone,
    ‘docket’ => $docket,
    ‘dot’ => $dot,
    ‘year_in_business’ => $year_in_business,
    ‘physical_address’ => $physical_address,
    ‘city’ => $city,
    ‘state’ => $state,
    ‘postal_code’ => $postal_code,
    ‘organization_type’ => $organization_type,
    ‘federal’ => $federal,
    ‘q1’ => $q1,
    ‘q2’ => $q2,
    ‘q3’ => $q3,
    ‘other_text’ => $other_text,
    ‘q4’ => $q4,
    ‘upl1’ => $upl1,
    ‘q5’ => $q5,
    ‘upl2’ => $upl2,
    ‘upl3’ => $upl3,
    ‘upl4’ => $upl4, //multiple
    ‘upl5’ => $upl5

    ));
    }
    add_action(‘iphorm_post_process_1’, ‘mytheme_register_wp_user’, 10, 1);

    function mytheme_override_upload_path($path, $element)
    {
    $newfolder = $element->getForm()->getValue(‘iphorm_1_57’);
    return “$newfolder/”;
    }
    add_filter(‘iphorm_upload_path_1’, ‘mytheme_override_upload_path’, 10, 2);

    #9133
    morarioan
    Participant

    in Wp-content/uploads I need folders like : test_acb@… , test@…
    Full array.

    #9134
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #9137
    morarioan
    Participant

    Now it work. I dont know why. Maybe my server is slow and have some cache. I reuploaded functions.php

    Sorry and thx.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy