The plugin generated 683 characters of unexpected output during activation

i am facing this error, please help me.

<?php
 /*Plugin Name: Contact Form
 Plugin URI: http://localhost/redspark/wp-admin
 Description: Contact Form Create & Retrive By Ajax
 Author: Shifa Memon
 Author URI: http://localhost/redspark/wp-admin
 Version: 1.0 */
 function custom_contact_form_create(){
// echo "Active";
// die();
global $wpdb;
global $table_prefix;
$table = $table_prefix . 'contact_us';
    $sql = "CREATE TABLE 'wp_contact_us' (
      `id` int(50) NOT NULL PRIMARY KEY AUTO_INCREMENT,
      `name` varchar(50) NOT NULL,
      `email` varchar(100) NOT NULL,
      `subject` text NOT NULL,
      `message` longtext NOT NULL,
      `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON 
       UPDATE current_timestamp())";
       $wpdb->query($sql);
}
register_activation_hook(__FILE__,'custom_contact_form_create');

function custom_contact_form_delete(){
   global $wpdb;
   global $table_prefix;
   $table = $table_prefix.'contact-us';
   $sql = "DROP TABLE $table";
   $wpdb->query($sql);
   // echo "Deactivate";
  }
  register_deactivation_hook(__FILE__ ,'custom_contact_form_delete');

    ?>

The plugin generated 683 characters of unexpected output during activation

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

finally plugin is activated…

The plugin generated 683 characters of unexpected output during activation

this is code…

The plugin generated 683 characters of unexpected output during activation


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x