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 6986917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:52:11+00:00 2026-05-27T18:52:11+00:00

I am following this MVC guide to learn the basics of creating web apps

  • 0

I am following this MVC guide to learn the basics of creating web apps with the MVC pattern.

I have set it all up and it works fine, currently the system works with urls of this form;

address.co.uk/controller/method/params

I understand how this can work, however how would this work when posting data? for example a login form, i have tried accessing the POST variables from the controller, how ever this doesn’t work, im guessing this is due to the .htaccess file sends everything to the index.php?

UPDATE:

so i have created this basic form;

    <form name="input" action="register/newuser" method="post">
    Username: <input type="text" name="user" />
    password: <input type="text" name="pass" />
    <input type="submit" value="Submit" />
    </form> 

That submits data to this controller methods newuser;

function newuser()
{
    $data['user'] = $_POST["user"];
    $data['pass'] = $_POST["pass"];
    $this->loadView('view_register_result',$data);
}

Then finally the result page;

<body>
    <h1>Result</h1>

    im not sure? <br />
    user: <?php echo $data['user']; ?>
    pass: <?php echo $data['pass']; ?>
</body>

Is there any reason why this doesn’t work?

  • 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-27T18:52:12+00:00Added an answer on May 27, 2026 at 6:52 pm

    $_POST is a superglobal, meaning that it’s available everywhere. Of course, it won’t be filled unless you do an actual POST.

    mod_rewrite in the .htaccess will only rewrite the URL, but it won’t touch the $_POST, $_SESSION or $_COOKIE. Only the $_GET might be changed slightly, but that’s beyond the scope of your question.

    Edit
    Your issue is definitely unrelated to the $_POST. Does passing $data as an argument to loadView add it to the template as $data, or does it add it as two separate variables: user and pass? In that case, try loadView('..', array('data' => $data))

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

Sidebar

Related Questions

I've been following this guide from MSDN about Creating an ASP.NET MVC Areas Application
I'm building my application applying MVC pattern.Following this guide mvc guide , I would
I'm following this MVC model: http://java.sun.com/developer/technicalArticles/javase/mvc/ In my model I have an ArrayList shapes
This is a beginner level question for asp.net MVC I have the following code
What is wrong with this statement? I`m having the following error: Error 10 'System.Web.Mvc.HtmlHelper'
I am using ASP.NET MVC 4 with Web Api I have the following ApiController.
I am using web api with ASP.NET MVC 4. I have the following named
I'm following this guide: Spring MVC and I realized that I do not know
After following this MVC 4 tutorial series I was trying some of the stuff
Following this tutorial (http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/handling-concurrency-with-the-entity-framework-in-an-asp-net-mvc-application), I learned how to save data and do concurrency checks

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.