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

  • SEARCH
  • Home
  • 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 8573567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:16:54+00:00 2026-06-11T19:16:54+00:00

If I have a form such as (not all the code just one field

  • 0

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?

  • 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-06-11T19:16:55+00:00Added an answer on June 11, 2026 at 7:16 pm

    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();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a relatively simple HTML / JavaScript form. Such as this: <form method='POST'
I have a such form with many links: <form name=myform action= method=get id=form> <p>
We have a place in a code of such form: void processParam(Object param) {
I have such code in my JSF template: <h:form> <table id=users cellspacing=0> <a4j:repeat var=person
I want to make a user-registration form where I will have fields such first
How do I get all the input elements in one row in my form?
I have a form where the user fills in all the information such as
I am new to php. I want to have a form such as this:
I have a HTML form with fields such as name, address, notes, etc. I
I have a directory full of log files in the form ${name}.log.${year}{month}${day} such that

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.