Welcome Guest, Not a member yet? Register   Sign In
URL Error
#1

[eluser]echo sara[/eluser]
Hi has anyone had this error before?

is the error due to the line below?
Code:
<?php echo form_open($base_url . 'blog/title');?>


Error below

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: base_url

Filename: views/entryview.php

Line Number: 8
#2

[eluser]memVN[/eluser]
I think should use follow:
Frist, you load helper url, and config['base_url'] in file config
After use <?php echo form_open(base_url(). 'blog/title');?>
#3

[eluser]appleboy[/eluser]
Please load URL helper before using base_url() or form_open
Code:
$this->load->helper('form');
$this->load->helper('url');

Please use the following code:

Code:
<?php echo form_open(base_url() . 'blog/title');?>
#4

[eluser]echo sara[/eluser]
Thanks memvn and Apple boy. Appleboy i love your little devil :-) soo cute
#5

[eluser]echo sara[/eluser]
ok something not right now i get the error below

In autoload i have both form and url and in the config on base url i added
http://localhost/testing/

Code:
<?php echo form_open(base_url() . 'blog/title');?>

Not Found

The requested URL /testing/blog/title was not found on this server.

I also want to mention that i do have a controller named blog and a function called title.

where did i go wrong?
#6

[eluser]memVN[/eluser]
Ok, you can use link follow: <?php echo form_open(base_url() . 'index.php/blog/title');?>
#7

[eluser]appleboy[/eluser]
Do you use .htaccess to remove index.php in url?

Please check http://localhost/testing/index.php/blog/title or http://localhost/testing/blog/title url
#8

[eluser]echo sara[/eluser]
memVN i tried that and no dice. Appleboy i still user index.php here the odd thing when i try this

Code:
<?php echo form_open($base_url .'blog/title/');?>
--> it work when i submit and all but keeps giving me the error below before submitting.

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: base_url

Filename: views/blogview.php

Line Number: 9


But when i try what you guys have show me i dont get the error mesage (above) in my view (where my forms are located, very clean) BUT when i submit i get this error

Not Found

The requested URL /testing/blog/title/ was not found on this server.


odd huh, ever see a issue like this. Another point i am using the latest version of codeigniter.
#9

[eluser]appleboy[/eluser]
Hi,

replace $base_url with base_url()

http://ellislab.com/codeigniter/user-gui...elper.html
#10

[eluser]echo sara[/eluser]
thats the issue i have when i have base_url(), its clean; i dont get any errors but after filling out the form and when i click submit i get

Not Found

The requested URL /testing/blog/title/ was not found on this server.




Theme © iAndrew 2016 - Forum software by © MyBB