Ecommerce Shopify WordPress Discussion

dynamically generated form in wordpress is not forming correctly

I'm trying to generate a page with a form in a plugin. So I have this function function create_form_page(){ if ( did_action( 'init' ) >= 2 ) return; global $wpdb; $page_content = ' <div style="margin:auto;"> <h1>تسجيل الدخول</h1> <form name="contact_form" method="POST" enctype="multipart/form-data" autocomplete="off" accept-charset="utf-8" action="<?php echo admin_url( "admin-post.php" ); ?>" > <label>ID *</label> <input id="id" type="text" style="width:30%;" placeholder="please enter your id"/> <button type="submit" style="margin-right:5%;" onclick="submitLogin()">Login</button> </form> </div> '; $title = 'دخول الموظفين'; $slug = 'دخول-الموظفين'; $post_type = 'page'; $post = $wpdb->get_results("DELETE FROM $wpdb->posts WHERE post_title='$title'"); $page_args = array( 'post_type' => $post_type, 'post_title' => $title, 'post_content' => $page_content, 'post_status' => 'publish', 'post_author' => 1, 'post_slug' => $slug ); if(!get_page_by_title($title, 'OBJECT', 'page')){ wp_insert_post($page_args); } } but when I go to the page it's not forming correctly, the form element is instead generated like this <form name="contact_form" method="POST" enctype="multipart/form-data" autocomplete="off" accept-charset="utf-8" action="<?php echo admin_url( " admin-post.php"="" );="" ?="">” ><br> <label>ID *</label><br> <input id="id" type="text" style="width:30%;" placeholder="please enter your id"><br> <button type="submit" style="margin-right:5%;" onclick="submitLogin()">Login</button><br> </form> any ideas how can I prevent this?
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.