开发者

about post data

开发者 https://www.devze.com 2022-12-25 06:05 出处:网络
everyone.my question like this: pos开发者_如何转开发t.php <?php $str = \"testmytest\"; $str_serialize = serialize($str);

everyone.my question like this:

pos开发者_如何转开发t.php

<?php
$str = "testmytest";
$str_serialize = serialize($str);

http_post_fields("get_post.php", array('str' => $str_serialize));
?>

get_post.php

<?php
if (isset($_POST['str']))
{
  $echo $_POST['str'];

  $str = unserialize($_POST['str']);

  echo $str;
}
?>

i can not unserialize the $str, it is changed.who knows why? Thanks for everybody.


You need to provide associative array for http_post_fields function:

http_post_fields("get_post.php", array('str' => $str_serialize));


The data parameter in http_post_fields() should look like this:

http_post_fields('get_post.php', array('str' => $str_serialize));
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号