Title: widget problem
Last modified: August 19, 2016

---

# widget problem

 *  [nhtin](https://wordpress.org/support/users/nhtin/)
 * (@nhtin)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/widget-problem-4/)
 * i try to write very simple widget, everything was fine, yeah fine, it running
   well but when i put some code only for testing
 * print_r($_POST); it show nothing on widget control panel, and i try to echo $
   _POST[‘zoaw_pisc_title’];, it way show empty but update always successful, i 
   don’t know what happen here?
 *     ```
       function zoaw_postinsamecategory_control() {
       	$options = $newoptions = get_option('zoaw_postinsamecategory');
   
       	if ( $_POST['zoaw_pisc_submit'] ) {
       		$newoptions['title'] = strip_tags(stripslashes($_POST['zoaw_pisc_title']));
       print_r($_POST);
       echo $_POST['zoaw_pisc_title'];
       	}
       print_r($_POST);
       	if ( $options != $newoptions ) {
       		$options = $newoptions;
       		update_option('zoaw_postinsamecategory', $options);
       	}
   
       	$zoaw_title = attribute_escape($options['title']);
   
       	?>
       	<p>
       		<label><?php _e('Title:'); ?></label>
       		<input style="width: 200px;" name="zoaw_pisc_title" type="text" value="<?php echo $zoaw_title; ?>" />
       	</p>
       	<input type="hidden" name="zoaw_pisc_submit" value="1" />
       	<?php
       }
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [nhtin](https://wordpress.org/support/users/nhtin/)
 * (@nhtin)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/widget-problem-4/#post-805532)
 * noone know this?
 *  [1hkcook](https://wordpress.org/support/users/1hkcook/)
 * (@1hkcook)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/widget-problem-4/#post-805600)
 * sorry? where did you post the widget on?
 *  [hoodajan](https://wordpress.org/support/users/hoodajan/)
 * (@hoodajan)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/widget-problem-4/#post-805763)
 * i have the same problem now!
 * my action calls:
 * `
    add_action ('widgets_init', array('satpress_widgets','init'));
 * //in the init function:
 * $widget = new Sprw();
    register_widget_control ('sprw_control', array($widget,'
   sprw_control'), 350, 200);
 * // in the sprw_control function:
 * ...
    print_r($options);
 * //is correct
 * print_r($_POST);
 * gives an empty array.
 *  [hoodajan](https://wordpress.org/support/users/hoodajan/)
 * (@hoodajan)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/widget-problem-4/#post-805764)
 * sorry, the first line has to be:
 * add_action (‘widgets_init’, array(‘Sprw’,’init’));

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘widget problem’ is closed to new replies.

## Tags

 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [hoodajan](https://wordpress.org/support/users/hoodajan/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/widget-problem-4/#post-805764)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
