Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8735773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:08:57+00:00 2026-06-13T10:08:57+00:00

I went the easy way and used the program Web Form Builder for Mac

  • 0

I went the easy way and used the program Web Form Builder for Mac to create a form for my website. It actually is doing a decent job of making a nice form that uploads to mySQL, but I really want it to be able to find the userID of the logged in user to upload with the form. That way I can correlate the submissions with the WordPress user in the Database.

The user of my site has to be logged in to access the form, so getting the userID should always be possible. I did find this on WordPress which should help, but I am unsure how to add the code correctly and where to put it: http://codex.wordpress.org/Function_Reference/get_userdata

I am attaching the php for the forms down here. Hopefully I can get some guidance, cause this would be a HUGE help for my site.

Idea Submission.php:

<?php

$scriptpath = substr( $_SERVER['SCRIPT_FILENAME'], 0, -4 );
$paths = explode ( DIRECTORY_SEPARATOR , $scriptpath );
$myName = end($paths);
require $scriptpath . '/fbapp/php/config.inc.php';


if( strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) {

    $ctl = new FormController();
    $ctl->Dispatch();

} else {

    if( ! isset( $_GET['action'] ) )        $myPage->ReportStats( 'NotifyFormView' );
}

ob_start();

$myPage->Show();
ob_end_flush();

?>

Form.cfg.php (I have changed sensitive material & got rid of some unnecessary code for this post):

<?php exit(0); ?> { 
"settings":
{
    "data_settings" : 
    {
        "save_database" : 
        {
            "database" : "database",
            "is_present" : true,
            "password" : "password",
            "port" : 3306,
            "server" : "55.55.555.55",
            "tablename" : "Submissions",
            "username" : "username"
        },
        "save_file" : 
        {
            "filename" : "ideasubmissionform-results.csv",
            "is_present" : true
        },
        "save_sqlite" : 
        {
            "database" : "Idea Submission.dat",
            "is_present" : false,
            "tablename" : "Idea Submission"
        }
    },
    "email_settings" : 
    {
        "auto_response_message" : 
        {
            "custom" : 
            {
                "body" : "<!DOCTYPE html>\n<html dir=\"ltr\" lang=\"en\">\n<head>\n<title>RegisterYourApp has received your files!!</title>\n</head>\n<body>\nHello [FirstName] [LastName],\n<br>\n   We really appreciate you signing up for our services and our excited to tell you that your app idea submission for [Title] has been received! Within the next 24 hours you'll be receiving confirmation of your file(s) being stamped and your unique hash code for the submitted files.  If you've submitted multiple files they will be stamped in one zip file so will contain a single hash code and confirmation e-mail.</p>\n<br>\n<br>\n<br>\nHere's a copy of what you submitted for your records:\n<p>\n[_form_results_]\n</body>\n</html>\n",
                "is_present" : true,
                "subject" : "We have received your submission!!"
            },
            "from" : "Info@MyDomain.com",
            "is_present" : true,
            "to" : "[email]"
        },
        "notification_message" : 
        {
            "bcc" : "",
            "cc" : "",
            "custom" : 
            {
                "body" : "<!DOCTYPE html>\n<html dir=\"ltr\" lang=\"en\">\n<head>\n<title>You got mail!</title>\n</head>\n<body>\nHey there,\n<p>\n<b>Someone filled out your form, and here's what they said:</b>\n<p>\n[_form_results_]\n</body>\n</html>\n",
                "is_present" : false,
                "subject" : "Idea Submission"
            },
            "from" : "[email]",
            "is_present" : true,
            "replyto" : "[email]",
            "to" : "Info@MyDomain.com"
        }
    },
    "general_settings" : 
    {
        "colorboxautoenabled" : false,
        "colorboxautotime" : 3,
        "colorboxenabled" : false,
        "colorboxname" : "Default",
        "formname" : "Idea Submission",
        "is_appstore" : "0",
        "timezone" : "America/Los_Angeles"
    },
    "mailchimp" : 
    {
        "apiKey" : "0ef1f58",
        "lists" : 
        [

            {
                "action" : 
                {
                    "subscribe" : 
                    {
                        "condition" : "fields",
                        "fb_name" : "mailing_list",
                        "fb_value" : "Yes"
                    },
                    "unsubscribe" : 
                    {
                        "condition" : "never"
                    }
                },
                "is_present" : true,
                "listid" : "0bfc32032c",
                "merge_tags" : 
                [

                    {
                        "fb_name" : "email_mailing",
                        "field_type" : "email",
                        "isGrouping" : false,
                        "name" : "",
                        "req" : true,
                        "tag" : "EMAIL"
                    },

                    {
                        "fb_name" : "firstname",
                        "field_type" : "text",
                        "isGrouping" : false,
                        "name" : "",
                        "req" : false,
                        "tag" : "FNAME"
                    },

                    {
                        "fb_name" : "lastname",
                        "field_type" : "text",
                        "isGrouping" : false,
                        "name" : "",
                        "req" : false,
                        "tag" : "LNAME"
                    }
                ],
                "name" : "Updates & News",
                "subscribe" : 
                {
                    "double_optin" : true,
                    "email_address_field" : "email_mailing",
                    "email_type_field" : "html",
                    "replace_interests" : true,
                    "send_welcome" : false,
                    "update_existing" : true
                },
                "unsubscribe" : 
                {
                    "delete_member" : false,
                    "email_address_field" : "email_mailing",
                    "send_goodbye" : true,
                    "send_notify" : true
                }
            }
        ]
    },
    "payment_settings" : 
    {
        "confirmpayment" : "",
        "currencysymbol" : "",
        "decimals" : 2,
        "fixedprice" : "",
        "invoicelabel" : "",
        "is_present" : false,
        "paymenttype" : "invoice",
        "shopcurrency" : "TRY",
        "usecustomsymbol" : false
    },
    "redirect_settings" : 
    {
        "confirmpage" : "<!DOCTYPE html>\n<html dir=\"ltr\" lang=\"en\">\n<head>\n<title>Success!</title>\n<meta charset=\"utf-8\">\n<style type=\"text/css\">\nbody {background: #f9f9f9;padding-left: 110px;padding-top: 70px; padding-right: 20px;max-width:700px;font-family: Helvetica, Arial;}\np{font-size: 16px;font-weight: bold;color: #666;}\nh1{font-size: 60px; !important;color: #ccc !important;margin:0px;}\nh2{font-size: 28px !important;color: #666 ! important;margin: 0px; border-bottom: 1px dotted #00A2FF; padding-bottom:3px;}\ntd {font-size: 12px !important; line-height: 30px;  color: #666 !important; margin: 0px;border-bottom: 1px solid #e9e9e9;}\ntd:first-child {font-size: 13px !important; font-weight:bold; color: #333 !important; vertical-align:text-top; min-width:100px; padding-right:5px;}\n</style>\n</head>\n<body>\n<h1>Thanks! </h1>\n<h2>The form is on its way.</h2>\n<p>Here&rsquo;s what was sent:</p>\n<div>[_form_results_]</div>\n</body>\n</html>\n",
        "gotopage" : "http://www.MyDomain.com/success/",
        "inline" : "<center><h2>Thank you!</h2>\n<p>We received your form</p></center>",
        "type" : "gotopage"
    },
    "uid" : "a67968bef1ba64039314ab953a1ce923",
    "validation_report" : "in_line"
},
"rules":{"firstname":{"label":"Name","fieldtype":"text","required":true,"maxlength":"25"},"lastname":{"fieldtype":"text","required":true,"maxlength":"25"},"email":{"email":true,"label":"Email","fieldtype":"email","required":true,"equalTo":"email_verification","label_equal":"Confirm Email","maxlength":"254"},"form_of_id":{"label":"Social Security #, Driver&#39;s License, ID or Other","fieldtype":"text","required":true},"streetaddress":{"label":"Address","fieldtype":"text","required":true},"city":{"fieldtype":"text","required":true,"maxlength":"100"},"zip_code":{"fieldtype":"text","required":true,"maxlength":"25"},"state_province":{"fieldtype":"text","required":true,"maxlength":"50"},"country":{"fieldtype":"text","required":true},"phonenumber":{"phone":"phoneUS","label":"Phone Number (Optional)","fieldtype":"tel"},
"payment_rules":{},
"application_version":"Web Form Builder (OSX), build 2.1.4944"
}

uid.php:

<?php

$txt = false;

if( file_exists( 'form.cfg.dat' ) )
    $txt = file_get_contents( 'form.cfg.dat' );
else if ( file_exists( 'form.cfg.php' ) )
    $txt = file_get_contents( 'form.cfg.php' );

if( $txt === false ) {
    echo 'null';
    exit(0);
}

$config = json_decode( substr( $txt, strpos( $txt, "{" ) ), true );

if( isset( $config['settings'] ) &&
    isset( $config['settings']['uid'] ) ) {

        echo $config['settings']['uid'];

} else {

    echo 'null';
}

?>

Idea Submission.html (I have changed sensitive material & got rid of some unnecessary code for this post):

<!DOCTYPE HTML>
<html>

  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Start of the headers for CoffeeCup Web Form Builder -->
    <script type="text/javascript" src="common/js/form_init.js" data-name=""
    id="form_init_script">
    </script>
    <link rel="stylesheet" type="text/css" href="theme/blue_pad/css/default.css?version=884"
    id="theme" />
    <!-- End of the headers for CoffeeCup Web Form Builder -->
    <title>
      Idea Submission
    </title>
  </head>

  <body>
    <!-- Start of the body content for CoffeeCup Web Form Builder -->
    <form id="docContainer" enctype="multipart/form-data" method="POST" action="../Idea%20Submission.php"
    novalidate="novalidate" class="fb-toplabel fb-100-item-column selected-object"
    style="width: 650px; " data-form="manual_iframe">
      <div id="fb-form-header1" class="fb-form-header" style="padding-bottom: 30px; padding-top: 20px; padding-left: 35px; height: 1px; ">
        <a id="fb-link-logo1" class="fb-link-logo" href="" target="_blank"><img alt="Alternative text" title="Alternative text" id="fb-logo1" class="fb-logo" src="common/images/image_default.png" style="display: none; "/></a>
      </div>
      <div id="section1" class="section">
        <div id="column1" class="column ui-sortable">
          <div style="display:none; min-height:2332px;" id="fb_confirm_inline">
          </div>
          <div style="display:none;" id="fb_error_report">
          </div>
          <div id="item13" class="fb-item fb-100-item-column" style="opacity: 1; ">
            <div class="fb-header fb-item-alignment-center">
              <h2 style="display: inline; color: rgb(8, 2, 0); ">
                Submit
              </h2>
            </div>
          </div>
          <div id="item14" class="fb-item fb-100-item-column" style="opacity: 1; padding-top: 0px; padding-bottom: 10px; padding-right: 0px; padding-left: 25px; ">
            <div class="fb-static-text fb-item-alignment-center">
              <p style="font-style: italic; ">
                Hello! Welcome to our submission page!
              </p>
            </div>
          </div>
          <div id="item50" class="fb-item fb-100-item-column" style="padding-bottom: 10px; padding-right: 0px; padding-left: 25px; opacity: 1; padding-top: 20px; ">
            <div class="fb-static-text fb-item-alignment-center">
              <p style="font-weight: bold; ">
                Please only upload submission per form.
                <BR>
              </p>
            </div>
          </div>
          <div id="item51" class="fb-item fb-100-item-column" style="padding-top: 0px; padding-bottom: 10px; padding-right: 0px; padding-left: 25px; opacity: 1; ">
            <div class="fb-static-text fb-item-alignment-center">
              <p>
                You may come back as many times as you want.
                <BR>
              </p>
            </div>
          </div>
          <div id="item1" class="fb-item fb-33-item-column" style="opacity: 1; padding-bottom: 5px; ">
            <div class="fb-grouplabel">
              <label id="item1_label_0" style="display: inline; ">Name</label>
            </div>
            <div class="fb-input-box">
              <input type="text" id="item1_text_1" maxlength="25" placeholder="First"
              autocomplete="on" data-hint="" name="FirstName" required autofocus/>
            </div>
          </div>
          <div id="item2" class="fb-item fb-66-item-column" style="padding-bottom: 0px; padding-top: 33px; ">
            <div class="fb-grouplabel">
              <label id="item2_label_0" style="display: none; "></label>
            </div>
            <div class="fb-input-box">
              <input type="text" id="item2_text_1" maxlength="25" placeholder="Last"
              autocomplete="on" data-hint="" name="LastName" required/>
            </div>
          </div>
          <div id="item9" class="fb-item fb-100-item-column" style="padding-top: 0px; padding-bottom: 0px; opacity: 1; ">
            <div class="fb-grouplabel">
              <label id="item9_label_0">Email</label>
            </div>
            <div class="fb-input-box">
              <input type="email" id="item9_email_1" maxlength="254" placeholder="you@domain.com"
              autocomplete="on" data-hint="" name="email" required/>
              <div class="fb-hint" style="color: rgb(136, 136, 136); font-weight: normal; font-style: normal; ">
                We will contact you by this email address.
              </div>
            </div>
            <div class="fb-grouplabel">
              <label style="color: rgb(0, 113, 188); ">Confirm Email</label>
            </div>
            <div class="fb-input-box">
              <input type="email" id="item9_email_1_verification" maxlength="254" placeholder=""
              autocomplete="off" data-hint="" name="email_verification" />
            </div>
          </div>
          <div id="item22" class="fb-item fb-100-item-column" style="opacity: 1; ">
            <div class="fb-grouplabel">
              <label id="item22_label_0" style="display: inline; ">Social Security #, Driver&#39;s License, ID or Other</label>
            </div>
            <div class="fb-input-box">
              <input type="text" id="item22_text_1" maxlength="254" placeholder="" autocomplete="off"
              data-hint="" name="Form_Of_ID" required/>
              <div class="fb-hint" style="color: rgb(136, 136, 136); font-weight: normal; font-style: normal; ">
                <BR>
              </div>
            </div>
          </div>
          <div id="item3" class="fb-item fb-100-item-column" style="padding-top: 0px; padding-bottom: 0px; ">
            <div class="fb-grouplabel">
              <label id="item3_label_0" style="display: inline; ">Address</label>
            </div>
            <div class="fb-input-box">
              <input type="text" id="item3_text_1" maxlength="254" placeholder="Address Line 1"
              autocomplete="on" data-hint="" name="StreetAddress" required/>
            </div>
          </div>
          <div id="item5" class="fb-item fb-33-item-column" style="padding-top: 0px; padding-right: 1px; ">
            <div class="fb-grouplabel">
              <label id="item5_label_0" style="display: none; "></label>
            </div>
            <div class="fb-input-box">
              <input type="text" id="item5_text_1" maxlength="100" placeholder="City"
              autocomplete="on" data-hint="" name="City" required/>
            </div>
          </div>
          <div id="item6" class="fb-item fb-33-item-column" style="opacity: 1; padding-top: 0px; padding-bottom: 0px; padding-right: 1px; padding-left: 2px; ">
            <div class="fb-grouplabel">
              <label id="item6_label_0" style="display: none; "></label>
            </div>
            <div class="fb-input-box">
              <input type="text" id="item6_text_1" maxlength="25" placeholder="Postal / Zip Code"
              autocomplete="on" data-hint="" name="Zip_Code" required/>
            </div>
          </div>
          <div id="item27" class="fb-item fb-33-item-column" style="opacity: 1; padding-top: 0px; padding-right: 0px; padding-left: 2px; ">
            <div class="fb-grouplabel">
              <label id="item27_label_0" style="display: none; "></label>
            </div>
            <div class="fb-input-box">
              <input type="text" id="item27_text_1" maxlength="50" placeholder="State/Province"
              autocomplete="on" data-hint="" name="State_Province" required/>
            </div>
          </div>
          <div id="item28" class="fb-item fb-50-item-column" style="opacity: 1; padding-top: 0px; padding-right: 0px; padding-left: 115px; ">
            <div class="fb-grouplabel">
              <label id="item28_label_0" style="display: none; "></label>
            </div>
            <div class="fb-input-box">
              <input type="text" id="item28_text_1" maxlength="254" placeholder="Country"
              autocomplete="on" data-hint="" name="Country" required/>
            </div>
          </div>
          <div id="item19" class="fb-item fb-66-item-column" style="padding-top: 0px; opacity: 1; padding-bottom: 10px; ">
            <div class="fb-grouplabel">
              <label id="item19_label_0" style="display: inline; ">Phone Number (Optional)</label>
            </div>
            <div class="fb-phone">
              <input type="tel" id="item19_tel_1" data-hint="" name="PhoneNumber" placeholder="890-123-4567"
              />
            </div>
          </div>

          <div id="item32" class="fb-item fb-100-item-column" style="padding-top: 0px; ">
            <div class="fb-grouplabel">
              <label id="item32_label_0" style="display: inline; ">Would You Like To Join Our Mailing List?</label>
            </div>
            <div class="fb-dropdown">
              <select id="item32_select_1" data-hint="" name="Mailing_List" required>
                <option selected id="item32_0_option" value="">
                  Choose one
                </option>
                <option id="item32_1_option" value="Yes">
                  Yes
                </option>
                <option id="item32_2_option" value="No">
                  No
                </option>
              </select>
            </div>
            <div class="fb-hint" style="color: rgb(136, 136, 136); font-weight: normal; font-style: normal; ">
              Stay caught up on all the awesome things happening with the site and company.
            </div>
          </div>
          <div id="item34" class="fb-item fb-100-item-column">
            <div class="fb-grouplabel">
              <label id="item34_label_0" style="display: inline; ">Email For Mailing List</label>
            </div>
            <div class="fb-input-box">
              <input type="email" id="item34_email_1" maxlength="25" placeholder="you@domain.com"
              autocomplete="on" data-hint="" name="email_mailing" required/>
              <div class="fb-hint" style="color: rgb(136, 136, 136); font-weight: normal; font-style: normal; ">
                The address you would like are updates sent to, if signing up for the
                mailing list. It is a required field, but if mark &quot;no&quot; above
                you will not be added to list.
              </div>
            </div>
          </div>
          <div id="item35" class="fb-item fb-100-item-column" style="opacity: 1; padding-bottom: 0px; ">
            <div class="fb-grouplabel">
              <label id="item35_label_0" style="display: inline; ">How&#39;d You Find Out About Us? (Optional)</label>
            </div>
            <div class="fb-input-box">
              <input type="text" id="item35_text_1" maxlength="254" placeholder="ie. Friend, Google Search, Blog..."
              autocomplete="off" data-hint="" name="HowFound" />
            </div>
          </div>
          <div id="item52" class="fb-item fb-100-item-column" style="padding-bottom: 10px; padding-right: 0px; padding-left: 25px; opacity: 1; padding-top: 20px; ">
            <div class="fb-static-text fb-item-alignment-center">
              <p style="font-style: italic; ">
                Thanks for being a member!
                <BR>
                <BR>
                We guarantee to keep all your info and idea materials confidential.
                <BR>
                We will never look at the content of your uploaded files until you inform
                us to do so.
                <BR>
                <BR>
              </p>
            </div>
          </div>
        </div>
      </div>
      <div id="fb-captcha_control" class="fb-captcha fb-item-alignment-center"
      style="cursor: default; display: block; ">
        <script type="text/javascript">
        var RecaptchaOptions = { theme : 'clean' };
        </script>
        <script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=6Lc368kSAAAAALIQElOa6ig3G3PwwicRRKHM6gUK">
        </script>
        <noscript>
          <iframe src="https://www.google.com/recaptcha/api/noscript?k=6Lc368kSAAAAALIQElOa6ig3G3PwwicRRKHM6gUK"
          height="300" width="500" style="border:none;">
          </iframe>
          <br>
          <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
          <input type="hidden" name="recaptcha_response_field" value="manual_challenge">
        </noscript>
      </div>
      <div id="fb-submit-button-div" class="fb-item-alignment-left fb-footer"
      style="min-height: 1px; ">
        <input type="submit" class="fb-button-special" id="fb-submit-button" data-regular=""
        style="" value="Submit" />
      </div>
      <input type="hidden" name="fb_form_custom_html" />
      <input type="hidden" name="fb_form_embedded" />
      <input type="hidden" id="fb_js_enable" name="fb_js_enable" />
    </form>
    <!-- End of the body content for CoffeeCup Web Form Builder -->
  </body>

</html>

THANKS SOOOOOOO MUCH!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:08:58+00:00Added an answer on June 13, 2026 at 10:08 am

    Maby not the most secure way to do it but since your form and wordpress are seperate, you can set the userid in a $_SESSION from the WordPress header and catch that session at your form page.

    For WordPress something like:

    global $current_user;
    $current_user = wp_get_current_user();    
    $_SESSION['WP']['userId'] = get_userdata( $current_user->ID);
    

    And catch it on your form page with:

    <input type="hidden" name="fb_form_user_id" value="<?php echo $_SESSION['WP']['userId']; ?>" />
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I went to connect to my website via firefox earlier this afternoon and I
According to Daniel, in his answer, there is no easy way to modify the
I'm creating a web service using PHP5's native SOAP Methods. Everything went fine until
To make my program a bit more user friendly and easy to update, when
I went through and had the program System.exit(0) whenever the user clicked the window's
I'm in the process of developping a Web Application for mobiles. I went with
I went through this whole procedure http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx a couple weeks ago and got https
I went to Twitter's resource page here (https://twitter.com/about/resources/tweetbutton) and got the following code: <a
I went as far as searching C sources, but I can't find this function,
I went to download SharpZipLib assemblies but it looks like its not on SourceForge.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.