diff options
Diffstat (limited to 'system/helpers/form_helper.php')
-rw-r--r-- | system/helpers/form_helper.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index d4e45a0af..069101063 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -38,11 +38,16 @@ * @param array a key/value pair hidden data * @return string */ -function form_open($action, $attributes = array(), $hidden = array()) +function form_open($action = '', $attributes = array(), $hidden = array()) { $obj =& get_instance(); - $form = '<form method="post" action="'.$obj->config->site_url($action).'"'; + $form = '<form action="'.$obj->config->site_url($action).'"'; + + if ( ! isset($attributes['method'])) + { + $form .= ' method="post"'; + } if (is_array($attributes) AND count($attributes) > 0) { |