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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:56:33+00:00 2026-05-22T12:56:33+00:00

I’m working on a signup page in CodeIgniter. The problem is, my post data

  • 0

I’m working on a signup page in CodeIgniter. The problem is, my post data doesn’t come through. The following code always produces ‘fail’:

class Signup extends CI_Controller {

    function index()
    {    
        if ($this->input->post())
        {
            echo 'success'; 
        }
        else
        {
            echo 'fail';

            echo form_open('signup');

            echo form_input('username', 'Username');
            echo form_input('email_address', 'Email address');
            echo form_submit('submit', 'Create Acccount');

            echo form_close();
        }
    }

}

What could be the problem?

To make matters even more interesting, on my localhost the form works just fine. It’s when on the remote server when this fails.


Update 1: As requested, this is what the server outputs: (I obscured the url, I’m under non disclosure)

<form accept-charset="utf-8" method="post" action="http://www.url.com/signup">
<input type="text" value="Username" name="username">
<input type="text" value="Email address" name="email_address">
<input type="submit" value="Create Account" name="submit">
</form>

Update 2: I see another difference in behavior between the localhost and the remote server: When refreshing (cmd R or F5) the page after submitting the form, on the local host my browser asks me to send the form again. The same page on the remote server doesn’t invoke that question from the browser so it looks like some redirecting or url problem is causing the problem?


Update 3: It appears that on the remote server, the user is being redirected by a 301. (moved permanently) I still have no idea where this redirect is coming from. The redirect effectively kills the post-data, so it explains why post() is returning false.

So, does anyone know why I’m being 301’d?


Update 4: I got redirected within CodeIgniter by setting my base_url as http://www.url.com in stead of http://url.com

After changing that, it solved the problem! 🙂

  • 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-22T12:56:33+00:00Added an answer on May 22, 2026 at 12:56 pm

    The problem could be caused by a 301 redirection (Location HTTP header directive) from the remote server. If you use Firefox, you could check for this with the plugin TamperData. Of course, you could also just see if http://www.url.com/signup gets redirected when requesting the page.

    If the HTTP header Location is http://url.com/signup (without www), then the easiest solution is to use http://url.com/signup for the form action. Please note that you could also omit the server address if the form is on the same server. You could use /signup instead.

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

Sidebar

Related Questions

I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build

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.