CodeIgniter Forums
URL misconfigured in WAMP - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: URL misconfigured in WAMP (/showthread.php?tid=65575)



URL misconfigured in WAMP - JokerPW - 06-27-2016

Hi guys !

I'm having a problem for the past several days. I tried all possibilities and check the foruns but haven't found any kind of solution.
I'm trying to create a basic form to add stuff to a DB table, but I can't get the link of the button on the form to work.

No matter what kind of link I try to put in the  "form_open", it doesn't lead to the page I want. The link, somehow, adds up to itself and won't lead into the correct page.

Some exemples of what I tried below with its results:

echo form_open(base_url().'insertadmin/onadd');
http://localhost/ws_admin_portal/index.php/db/localhost/ws_admin_portal/index.php/localhost/ws_admin_portal/insertadmin/onadd

echo form_open(site_url('insertadmin/onadd'));
http://localhost/ws_admin_portal/index.php/db/localhost/ws_admin_portal/index.php/localhost/ws_admin_portal/index.php/insertadmin/onadd

echo form_open(current_url('/onadd'));
http://localhost/ws_admin_portal/index.php/db/localhost/ws_admin_portal/index.php/localhost/ws_admin_portal/index.php/db/insertadmin

echo form_open('onadd');
http://localhost/ws_admin_portal/index.php/db/localhost/ws_admin_portal/index.php/onadd

The result I was expecting was:
http://localhost/ws_admin_portal/index.php/db/onadd

Please, help me !  =[
[ ]'s


RE: URL bug in WAMP - Narf - 06-27-2016

Set your $config['base_url'] properly.
It has to have the 'http://' or 'https://' prefix.


RE: URL bug in WAMP - JokerPW - 06-27-2016

(06-27-2016, 07:13 AM)Narf Wrote: Set your $config['base_url'] properly.
It has to have the 'http://' or 'https://' prefix.

I have it like this:

$config['base_url'] = 'localhost/ws_admin_portal/';

How it was supposed to be set up, please ?  =]
[ ]'s


RE: URL bug in WAMP - ciadmin - 06-27-2016

Read the reply above ... you need to include http:// in the setting


RE: URL bug in WAMP - JokerPW - 06-27-2016

(06-27-2016, 11:45 AM)ciadmin Wrote: Read the reply above ... you need to include http:// in the setting

OMG !!!  Sorry !
Thank you very much, guys !  =D

[ ]'s


RE: URL misconfigured in WAMP - InsiteFX - 06-28-2016

Also in the future the correct way of using base_url() is like this.

PHP Code:
base_url('insertadmin/onadd'); 

And you can also pass it an array().


RE: URL misconfigured in WAMP - Narf - 06-28-2016

(06-28-2016, 03:43 AM)InsiteFX Wrote: Also in the future the correct way of using base_url() is like this.

PHP Code:
base_url('insertadmin/onadd'); 

While this is available for convenience and historical reasons, the OP's usage is not incorrect.


RE: URL misconfigured in WAMP - InsiteFX - 06-28-2016

I know you can use both I am just stating how the user guide states it.