• Resolved thisdudeoverthere

    (@thisdudeoverthere)


    Hello everyone,

    I want to create a custom html/php form, but I’m fairly new to WordPress. If I put the html code of the form in a page with the HTML bloc code, where do I put the PHP code? I should also point out that I don’t want to use any plugins.

    Thank you in advance for your reply.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Are you inserting the entries into the database?

    What are you planning to do onSubmit?

    Why no plugins?

    You could upload your php process file to the public html path, and then call that from the action on your form. Make sure the file is in your child theme.

    You could build the process file as a template, and call that on your POST action. And / or add an action in the functions file of your child theme to process like this:

    https://developer.ww.wp.xz.cn/reference/functions/add_action/

    It’s a lot of effort to re-invent the wheel.

    Thread Starter thisdudeoverthere

    (@thisdudeoverthere)

    Are you inserting the entries into the database?

    What are you planning to do onSubmit?

    No, this form will send an email containing the information entered by the user.

    You could upload your php process file to the public html path, and then call that from the action on your form. Make sure the file is in your child theme.

    You could build the process file as a template, and call that on your POST action. And / or add an action in the functions file of your child theme to process like this

    Ok thank you.

    Hi @thisdudeoverthere

    You can try contact form 7 plugin. No need any code.
    You can just put the field into the field section.
    https://ww.wp.xz.cn/plugins/contact-form-7/

    You can create custom shortcode by php into functions.php and call to any where.

    Also I can help with custom code.

    Thanks.

    • This reply was modified 2 years, 10 months ago by ravindra107.
    • This reply was modified 2 years, 10 months ago by ravindra107.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Creating a custom PHP form’ is closed to new replies.