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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:51:29+00:00 2026-05-16T21:51:29+00:00

I am writing a web application using Codeigniter for a client and am using

  • 0

I am writing a web application using Codeigniter for a client and am using one of their internal development machines. Due to security restrictions the web server port is only internal and not exposed to the outside world so I must access it over a SSH tunnel. So I hit the web server like this: http://localhost/path_to_data.

I am creating a form in Codeigniter using the standard Form Helper, the only problem is that the form’s action is pointed at the location of the box from the Codeigniter config file. I cannot change this config value because we have internal developers that access this as well that won’t use a SSH tunnel so they hit it by the “real” URL.

Is there a way to force Codeigniter to use the form to point at itself with a relative path instead of the full path?

  • 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-16T21:51:30+00:00Added an answer on May 16, 2026 at 9:51 pm

    form_open() uses the base url set in config.php: $config['base_url']. Try making it conditional, based on $_SERVER['SERVER_NAME']. That way both the internal developers using, say, “http://demo.local“, as well as you using “http://localhost/” will be able to see the proper absolute urls, based on how they’re accessing the server.

    $config['base_url'] = 'http://demo.local/' ;
    if ($_SERVER['SERVER_NAME'] == 'localhost') {
        $config['base_url'] = http://localhost/' ;
    }
    

    As a sidenote, I notice that form_open() checks if the passed parameter is a full url (specifically if it includes a “://” ), and if it does then it sets it as the form’s action without any processing. So you could be calling form_open("http://localhost/form_submit") and having it be used as is without the base_url.

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

Sidebar

Related Questions

I am writing a web-application using Play 1.2.3 . One of the feature is
I am writing one web application using PHP/CodeIginter. Now, I want to add a
I'm writing a web application using python JSON-RPC implementation - http://json-rpc.org/wiki/python-json-rpc on server side
I am writing a web based application using Ruby on Rails. In one of
I am writing a web application using client side templating. This application needs to
I'm writing web application using codeigniter framework. Here is the structure of document root
I am writing a server application using Tornado web server . Application works with
I'm writing a web application using the Catalyst framework . I'm also using a
Suppose you're writing a simple database web application using Ruby and MySQL. Access to
I am writing an ASP.Net MVC 3 Web Application using Entity Framework 4.1. My

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.