Welcome Guest, Not a member yet? Register   Sign In
URL misconfigured in WAMP
#1

(This post was last modified: 06-27-2016, 11:45 AM by ciadmin.)

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.p...dmin/onadd

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

echo form_open(current_url('/onadd'));
http://localhost/ws_admin_portal/index.p...nsertadmin

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

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

Please, help me !  =[
[ ]'s
Reply
#2

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

(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
Reply
#4

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

(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
Reply
#6

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().
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#7

(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.
Reply
#8

I know you can use both I am just stating how the user guide states it.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB