Welcome Guest, Not a member yet? Register   Sign In
form_open() doesn't not being called?
#1

[eluser]Unknown[/eluser]
Hi, I'm new with CI and trying to run through the basic tutorials.

Following the "blog" video tutorial I am trying to use the form_open() helper function but with no success.

The function seems to not be getting called.

Any help would be appreciated, been trying to get it to work for a few hours now Smile

Running on CI 1.7.2

My view file contains the following code
Code:
Bob1
    <?= form_open('user/insert_user');?>
    Bob2

But my generated HTML source is :
Code:
Bob1  
    Bob2

I've made sure that the form_helper is properly loaded, I've activated CI logs and traced the load->helper('form'); function. I am pretty sure that the helper functions are loaded.

Log result
DEBUG - 2010-04-02 01:23:52 --> Helper loaded: form_helper
DEBUG - 2010-04-02 01:23:52 --> Helper loaded: url_helper
#2

[eluser]Bart v B[/eluser]
Don't you have a short tags open problem?

Maybe you can try this:

Code:
<?php
echo form_open('user/insert_user');
?>
#3

[eluser]Unknown[/eluser]
Just re-read my post title. Sorry about the horrible grammar, I guess I was tired when I posted Smile

Thanks for the reply, that was it. I'm new at PhP too, I don't understand why the short tags didn't for the form_open function. I used the same notation in the view for displaying variable values.

This worked
Code:
<h3>&lt;?=$user->first_name_usr?&gt;</h3>

This didn't work
Code:
&lt;?= form_open('user/insert_user');?&gt;

Thanks again.
#4

[eluser]cyberjunkie[/eluser]
mate you're not putting echo before form_open()
#5

[eluser]DarkManX[/eluser]
the alternative php syntax auto echo by calling &lt;?=
#6

[eluser]johnpeace[/eluser]
You can enable short open tags and the &lt;?= echo syntax in CI's config file.

[quote author="KungfuBob" date="1270173226"]

Thanks for the reply, that was it. I'm new at PhP too, I don't understand why the short tags didn't for the form_open function. I used the same notation in the view for displaying variable values.

[/quote]
#7

[eluser]NeoArc[/eluser]
cyberjunkie, this post is from 2010.
#8

[eluser]johnpeace[/eluser]
[quote author="NeoArc" date="1346185820"]cyberjunkie, this post is from 2010.[/quote]

So what, the replys are as valuable for posterity as they are for the OP.




Theme © iAndrew 2016 - Forum software by © MyBB