/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * * Creates a form and posts all the data using javascript recieved to the url provided * @param string $url * @param string $postarray //Multi level array, array( array('fieldname','fieldvalue') ) */ public function PostForward($url,$postarray=null) { $string = '<form method="post" name="form" action="'.$url.'">'; if ($postarray != null) { foreach ($postarray as $postfield) { $string .= '<input type="text" name="'.$postfield[0].'" value="'.$postfield[1].'">'; } } $string .= '</form>'; $string .= '<script> document.form.submit();</script>'; echo $string; exit; }