Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

WordPress, PHP, WPForms questions...

I am new to WordPress, PHP and WPForms and have a basic question about how to make them interact.

I created a simple registration WPForm, then created a new WP page to be an instance of that form. But I m unsure how to make the fields interact with PHP.

I see how to insert HTML/PHP onto the Form. But, a simple "Hello" never made it to the Preview Page.
User generated image
Should that line of code "Hello!" have shown up on the page?

Also, the test page (Test) seems to own this form, through this line of code:
[wpforms id="9" title="false" description="false"]

User generated image
My Test Form seems to have an ID of 9. But I do not even recognize the language where the form is embedded. What language is that, with the square brackets? Is that a WordPress script? A non-PHP script?

And the big question for you is how do I assign values to the input fields from PHP? Where do I find their ID's? In the red oval above, I see the INT ID, but hope to be able to uncover a more unique value, like the field name.But it is not clear how I can get that information.

Thanks



ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

So, that line of code places one instance of the WPForm, with ID=9, on the page? Cool.

Now, how do I get/set values in the Name field? That's got ID #3. Is this the PHP that goes onto the WPForm?  
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am not trying anything. I do not have the understanding of where to put what code? Can you give me a hint?

I need to set and get the values in the fields.

I need the PHP connection to fields in the WPForm, aside from just the binding between the WPForm to the page which contains it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks. But my main ask is still not answered.

How do I interact with the data contained in the fields? I plan to use SQLite as my database. But, I need to insert values into these fields from another source than the DB, and have no idea where to do this?

In my first image (above), I attempted to insert a PHP test line, which seemed to produce no results.

Where do I insert PHP code that can access these input fields directly?

Should I be finding that php file, for the page I created, and just edit it directly? Is this what is required?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok.

5) So, I will drop SQLite and go straight to WP/MySQL. I do not want to create custom code, except for where there is no other option.
1) By using WP/MySQL, does this shield me from going long on the Shortcode system?
2) I need to find how I can use WPForms to write custom PHP code for the that form. Isn't that the purpose of that field?
3) Can you give me a hint where I can insert code that does this?
>Any page or post, allows you to access WPForms data from WordPress... any non-WordPress custom code.
4) I want to do zero custom coding. So far, the only thing I imagine that is slightly outside the norm is to pull parameter from the command line, and insert those values into the WP/MySQL database. Then, set the fields to contain those values (pulled from the URL).

Otherwise, I am 100% complaint, and not needing anything customer. Custom scares me, with my early knowledge and pressing deadlines.

So, #2 and #3 seem to be the only open questions.

Thanks for the help!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial