<tfoot id='NaHJO'></tfoot>

      <i id='NaHJO'><tr id='NaHJO'><dt id='NaHJO'><q id='NaHJO'><span id='NaHJO'><b id='NaHJO'><form id='NaHJO'><ins id='NaHJO'></ins><ul id='NaHJO'></ul><sub id='NaHJO'></sub></form><legend id='NaHJO'></legend><bdo id='NaHJO'><pre id='NaHJO'><center id='NaHJO'></center></pre></bdo></b><th id='NaHJO'></th></span></q></dt></tr></i><div id='NaHJO'><tfoot id='NaHJO'></tfoot><dl id='NaHJO'><fieldset id='NaHJO'></fieldset></dl></div>
        • <bdo id='NaHJO'></bdo><ul id='NaHJO'></ul>

        <small id='NaHJO'></small><noframes id='NaHJO'>

        <legend id='NaHJO'><style id='NaHJO'><dir id='NaHJO'><q id='NaHJO'></q></dir></style></legend>
      1. 将对象从一页移动到另一页?

        move object from 1 page to another?(将对象从一页移动到另一页?)
        <i id='DSLwa'><tr id='DSLwa'><dt id='DSLwa'><q id='DSLwa'><span id='DSLwa'><b id='DSLwa'><form id='DSLwa'><ins id='DSLwa'></ins><ul id='DSLwa'></ul><sub id='DSLwa'></sub></form><legend id='DSLwa'></legend><bdo id='DSLwa'><pre id='DSLwa'><center id='DSLwa'></center></pre></bdo></b><th id='DSLwa'></th></span></q></dt></tr></i><div id='DSLwa'><tfoot id='DSLwa'></tfoot><dl id='DSLwa'><fieldset id='DSLwa'></fieldset></dl></div>
          <bdo id='DSLwa'></bdo><ul id='DSLwa'></ul>
        • <legend id='DSLwa'><style id='DSLwa'><dir id='DSLwa'><q id='DSLwa'></q></dir></style></legend>

            <small id='DSLwa'></small><noframes id='DSLwa'>

                  <tfoot id='DSLwa'></tfoot>
                    <tbody id='DSLwa'></tbody>
                1. 本文介绍了将对象从一页移动到另一页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  伙计们.我对 PHP 中的 OOP 有点陌生.我已经学会了如何编写和创建对象.有没有办法获取一个对象并将其传递给另一个脚本?使用 GET 或 POST 或 SESSION 或其他.如果没有,我将如何在一个页面上为对象分配一些变量,然后在另一页上为同一对象分配更多变量?

                  Hay guys. I'm kinda new to OOP in PHP. I've learnt how to write and create objects. Is there a way to take an object and pass it to another script? either using GET or POST or SESSION or whatever. If there isn't how would i assign an object some variables on one page, then assign the same object more variables on another page?

                  谢谢

                  推荐答案

                  您可以在会话中存储对象,但您需要在调用 session_start() 之前包含包含类定义的文件(或使用 类自动加载 并在开始会话之前进行设置).例如:

                  You can store objects in the session but you need to include the file which contains the class definition before calling session_start() (or use class autoloading and set this up before you start the session). For example:

                  在每一页上:

                  //include class definition
                  require('class.php');
                  
                  //start session
                  session_start();
                  

                  第一页:

                  $object = new class();
                  $object->someProperty = 'hello';
                  
                  //store in session
                  $_SESSION['object'] = $object;
                  

                  后续页面:

                  $object = $_SESSION['object'];
                  
                  //add something else, which will be stored in the session
                  $object->anotherPropery = 'Something';
                  

                  这篇关于将对象从一页移动到另一页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <i id='9SQBd'><tr id='9SQBd'><dt id='9SQBd'><q id='9SQBd'><span id='9SQBd'><b id='9SQBd'><form id='9SQBd'><ins id='9SQBd'></ins><ul id='9SQBd'></ul><sub id='9SQBd'></sub></form><legend id='9SQBd'></legend><bdo id='9SQBd'><pre id='9SQBd'><center id='9SQBd'></center></pre></bdo></b><th id='9SQBd'></th></span></q></dt></tr></i><div id='9SQBd'><tfoot id='9SQBd'></tfoot><dl id='9SQBd'><fieldset id='9SQBd'></fieldset></dl></div>
                2. <small id='9SQBd'></small><noframes id='9SQBd'>

                  • <bdo id='9SQBd'></bdo><ul id='9SQBd'></ul>
                    <tfoot id='9SQBd'></tfoot>
                        <tbody id='9SQBd'></tbody>

                        • <legend id='9SQBd'><style id='9SQBd'><dir id='9SQBd'><q id='9SQBd'></q></dir></style></legend>