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

    2. <small id='YLUnw'></small><noframes id='YLUnw'>

      <legend id='YLUnw'><style id='YLUnw'><dir id='YLUnw'><q id='YLUnw'></q></dir></style></legend>

        如何从帖子中抓取数据到班级

        How to grab data from post to a class(如何从帖子中抓取数据到班级)
      1. <tfoot id='pmkGV'></tfoot>

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

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

          <bdo id='pmkGV'></bdo><ul id='pmkGV'></ul>
                  <tbody id='pmkGV'></tbody>
              1. <legend id='pmkGV'><style id='pmkGV'><dir id='pmkGV'><q id='pmkGV'></q></dir></style></legend>

                  本文介绍了如何从帖子中抓取数据到班级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如果我有一个表格,例如(不是所有的代码只有一个字段和我的输入):

                  <form id="registration" method="post" action="results.php"><label for="first_name">名字:</label><input type="text" id="first_name" name="first_name" maxlength="100" tabindex="1"/><input type="submit" id="login_submit" name="submit" value="Submit"/align="right"></表单>

                  是否可以从表单中获取数据,然后将该数据输出到另一个页面.我现在拥有的方式只是将帖子从表单回显到页面:

                  我不知道如何开始,但我希望帖子中的数据先去上课.因此,如果我创建一个名为registeredUser 的类,我将如何从表单中获取该数据?

                  解决方案

                  你好,我觉得你需要先了解一些OPP教程

                  你管

                  • http://www.youtube.com/watch?gl=NG&feature=related&hl=en-GB&v=_JEEQ-OPVAY

                  介绍

                  • http://www.slideshare.net/mgirouard/a-gentle-introduction-to-object-oriented-php

                  其他链接

                  • http://buildinternet.com/2009/07/an-introduction-to-object-oriented-php-part-1/

                  • http://blog.teamtreehouse.com/getting-started-with-oop-php5

                  你想要的例子

                  class RegisterUser {私人 $firstName;私人 $lastName;私人 $emailAddress;函数__构造(){$this->firstName = isset($_POST['first_name']) ?$_POST['first_name'] : null;$this->lastName = isset($_POST['last_name']) ?$_POST['last_name'] : null;$this->emailAddress = isset($_POST['email_address']) ?$_POST['email_address'] : null;}函数开始(){if (empty($this->firstName) || empty($this->lastName) || empty($this->emailAddress)) {throw new Exception("不允许空帖");}别的{//做一些 stuiffecho "注册完成";}}}$register = new RegisterUser();如果(!空($_POST)){$register->start();}

                  If I have a form such as (not all the code just one field and my input):

                  <div id="login_form">
                  <form id="registration" method="post" action="results.php">
                  <label for="first_name"> First Name: </label>
                  <input type="text" id="first_name" name="first_name" maxlength="100" tabindex="1" />
                  
                  <input type="submit" id="login_submit" name="submit" value="Submit"/ align="right">
                  
                  </form>
                  </div>
                  

                  Is it possible to grab the data from the form and then output that data to another page. The way I have it now I am just echoing the post from a form to a page:

                  <?php
                  
                  $first_name = $_POST['first_name'];
                  $last_name = $_POST['last_name'];
                  $email_address = $_POST['email_address'];
                  
                  
                  echo 'Hello ';
                  echo "{$first_name} {$last_name}";
                  echo '<br/>';
                  echo '<br/>';
                  echo 'We have your email address as: "';
                  
                  echo "{$email_address}"; 
                  echo '"';
                  
                  
                   ?> 
                  

                  Im not sure how to get started but I would like the data from post to go to a class first. So if I create a class called registeredUser how would I grab that data from my form?

                  解决方案

                  Hello I think you need some tutorials on OPP first

                  You tube

                  • http://www.youtube.com/watch?gl=NG&feature=related&hl=en-GB&v=_JEEQ-OPVAY

                  Presentation

                  • http://www.slideshare.net/mgirouard/a-gentle-introduction-to-object-oriented-php

                  Other Links

                  • http://buildinternet.com/2009/07/an-introduction-to-object-oriented-php-part-1/

                  • http://blog.teamtreehouse.com/getting-started-with-oop-php5

                  Example of what you want

                  class RegisterUser {
                      private $firstName;
                      private $lastName;
                      private $emailAddress;
                  
                      function __construct() {
                          $this->firstName = isset($_POST['first_name']) ? $_POST['first_name'] : null;
                          $this->lastName = isset($_POST['last_name']) ? $_POST['last_name'] : null;
                          $this->emailAddress = isset($_POST['email_address']) ? $_POST['email_address'] : null;
                      }
                  
                      function start() {
                          if (empty($this->firstName) || empty($this->lastName) || empty($this->emailAddress)) {
                              throw new Exception("Empty Post not allowed");
                          }
                  
                          else
                          {
                              // Do some stuiff
                              echo " Registration Done";
                          }
                      }
                  }
                  
                  $register = new RegisterUser();
                  if(!empty($_POST))
                  {
                      $register->start();
                  }
                  

                  这篇关于如何从帖子中抓取数据到班级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)
                  <tfoot id='4yO4N'></tfoot>

                    <tbody id='4yO4N'></tbody>
                  <legend id='4yO4N'><style id='4yO4N'><dir id='4yO4N'><q id='4yO4N'></q></dir></style></legend>

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

                        <small id='4yO4N'></small><noframes id='4yO4N'>

                        • <bdo id='4yO4N'></bdo><ul id='4yO4N'></ul>