Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 888877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:28:28+00:00 2026-05-15T13:28:28+00:00

I’m doing this tutorial: http://www.phpeveryday.com/articles/Zend-Framework-Database-Creating-Input-Form-P494.html We are building a simple input form using POST

  • 0

I’m doing this tutorial:
http://www.phpeveryday.com/articles/Zend-Framework-Database-Creating-Input-Form-P494.html

We are building a simple input form using POST and submitting it to a mySQL database. All is working fine. I’m just trying to get my head around the getRequest() function.

In the controller, we have this:

public function registerAction()
 {
    $request = $this->getRequest();

    $this->view->assign('action',"process");
    $this->view->assign('title','Member Registration');
    $this->view->assign('label_fname','First Name');
    $this->view->assign('label_lname','Last Name'); 
    $this->view->assign('label_uname','User Name'); 
    $this->view->assign('label_pass','Password');
    $this->view->assign('label_submit','Register');     
    $this->view->assign('description','Please enter this form completely:');        
}

and then in view:

 <form name="register" method="post" action="<?php echo $this->escape($this->action)?>">
  <table>
    <tr>
      <td><?php echo $this->escape($this->label_fname)?></td>
      <td><input type="text" name="first_name"></td>
    </tr>
    <tr>
      <td><?php echo $this->escape($this->label_lname)?></td>
      <td><input type="text" name="last_name"></td>
    </tr>   
    <tr>
      <td><?php echo $this->escape($this->label_uname)?></td>
      <td><input type="text" name="user_name"></td>
    </tr>   
    <tr>
      <td><?php echo $this->escape($this->label_pass)?></td>
      <td><input type="password" name="password"></td>
    </tr>   
  </table>
  <input type="submit" name="submit" value="<?php echo $this->escape($this->label_submit);?>">
  </form>

So what I don’t understand is why do we need a getRequest() if I already have the method=”post” and the action set? If I comment it out, the script doesn’twork. I see it’s needed, but I don’t understand why-especially since the $request variable doesn’t seem to be used?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:28:29+00:00Added an answer on May 15, 2026 at 1:28 pm

    In the code you have provided, $request doesn’t appear to be used at all. I don’t see why commenting it out would break.

    What happens, exactly, when you comment it out?

    The getRequest() function is for getting the Request object, which gives you parameters and such (i.e. controller, action, etc);

    EDIT:

    I had a look at the tutorial, and it has this:

    12   
    13    $sql = "INSERT INTO `user`
    14            (`first_name` , `last_name` ,`user_name` ,`password`)
    15            VALUES
    16            ('".$request->getParam('first_name')."', '".$request->getParam('last_name')."', '".$request->getParam('user_name')."', MD5('".$request->getParam('password')."'))";
    17    $DB->query($sql);
    

    You’ll note that it uses the $request variable to get the Parameters:
    ‘first_name’, ‘last_name’, ‘user_name’, ‘password’

    And saves them into the DB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 471k
  • Answers 471k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Request["id"] gets a value from the QueryString, Form, Cookies, or… May 16, 2026 at 3:15 am
  • Editorial Team
    Editorial Team added an answer Here's the simplest example I could come up with. In… May 16, 2026 at 3:15 am
  • Editorial Team
    Editorial Team added an answer No. Because it has not been implemented. There's a PECL… May 16, 2026 at 3:15 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.