Has anyone tried putting PHP ActiveRecord on WordPress?

If you plan to use it just for your own code, and have it running alongside WordPress’ default database driver (wpdb), I see no real problems. It’s only if you plan on fully integrating/overriding WP’s driver that I see it being near-impossible; hard-coded SQL is prolific throughout core, and translating them to ActiveRecord method calls … Read more

How to submit data from HTML form?

I agree with other answers that most of the time it is better to use a plugin to handle form submissions. However, there are exceptions to this rule. If you find yourself in a situation where you need to handle the form submissions yourself, you can submit data to admin-post.php. Here is how to set … Read more

How to handle a custom form in wordpress to submit to another page?

<form action=”<?php echo esc_url( admin_url(‘admin-post.php’) ); ?>” method=”post”> <input type=”hidden” name=”action” value=”your_action_name”> Add these in your form. Where admin-post.php will process your form. In that case based on the value of your_action_name that is provided by you, an action hook will get involved. Say for example if you add a hook like the following in … Read more

Creating a contact form without a plugin [closed]

This is my very simple implementation of contact form: class WPSE_299521_Form { /** * Class constructor */ public function __construct() { $this->define_hooks(); } public function controller() { if( isset( $_POST[‘submit’] ) ) { // Submit button $full_name = filter_input( INPUT_POST, ‘full_name’, FILTER_SANITIZE_STRING ); $email = filter_input( INPUT_POST, ’email’, FILTER_SANITIZE_STRING | FILTER_SANITIZE_EMAIL ); $color = filter_input( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)