It is a simple way to do that.
Suppose you are in from.php, just call the function like:
And suppose in to.php, write the following code:
<?php
print_r($_POST);
?>
That will output:
Suppose you are in from.php, just call the function like:
<?php actionPost("www.pritom.com/to.php", array( "id" => 1, "name" => "Pritom K Mondal"; )); ?>
<?php
print_r($_POST);
?>
That will output:
<?php Array ( [id] => 1 [name] => Pritom K Mondal ) ?>
<?php function actionPost($action, $data = array()) { ?><html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> function closethisasap (){ document.forms["redirectpost"].submit(); } </script> <body onload="closethisasap();"> <form name="redirectpost" method="post" action="<?php echo $action; ?>" > <?php if (!is_null($data)) { foreach ($data as $k => $v) { ?><input type="hidden" name="<?php echo $k; ?>" value="<?php echo $v; ?>" /><?php } } ?> </form> </body> </head> </html> <?php exit(); } ?>
Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!
ReplyDeletePHP Database Programming in India