dsjfrkvn818747
dsjfrkvn818747
2013-02-10 01:01

Wordpress - 将php对象传递给新页面[关闭]

已采纳

I am creating a custom ordering site built using Wordpress. I've created an object-oriented plugin to store all the order details. (product specs, contact information, various options, etc) The ordering process spans three pages. What is the best way for me to pass the object from one page to the next that is the most widely browser friendly? JSON encoding? Serialization? $_SESSION variable? Wordpress does not allow this natively, but I found instructions on how to override this.

Any suggestions would be greatly appreciated!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dqrnskni67375 dqrnskni67375 8年前

    I would recommend storing data in different indexes of $_SESSION, so the information will remain persistent across pages.

    Because you aren't implementing a feature like search, $_SESSION is good choice because users may switch between ordering products and visiting other pages on your site. Additionally, this method does not depend on browser features.

    点赞 评论 复制链接分享

相关推荐