Welcome Guest, Not a member yet? Register   Sign In
form_open(), why always localhost
#1

[eluser]Unknown[/eluser]
I'm debugging a website on a local machine
in the view, I have a form
Code:
echo form_open('basicquery/result', $attributes);

but when I access the site from other machine, I received error"couldn't access localhost"
I "view the page source", found the url is always :
Code:
<form action="http://localhost/index.php/basicquery/result" method="post">

But, in some other place, I can simply use the relative path, like
Code:
< src="/js/jquery.js">

The file location is like the following structure:
.
|-- application
| |-- controllers
| | |-- basicquery.php
|-- js
| |-- jquery.js

where, in basicquery.php, I have the function "result"
Code:
function result() {
}

Could anyone tell me how to fix this? Thanks.
#2

[eluser]vrencianz[/eluser]
Check your base_url in config.php. Leave it empty or use ip instead of 'localhost' in it.




Theme © iAndrew 2016 - Forum software by © MyBB