Welcome Guest, Not a member yet? Register   Sign In
Obviously, I've bumbed my head.
#1

[eluser]kenetiks[/eluser]
I seem to be unable to see the forest for the trees here...I've looked, looked, thrown my mouse at the cat(haven't seen her since), smoked a half a pack of cigarettes and looked some more. I've asked Google, the user guide, my second cousin's brother's sister's roommate, my mom(she thought I was on drugs of course) and I'm no still closer to an answer.

If someone could give me a pretty good smack, I'd be appreciative.

Entire Controller:

<?php

class hello_world extends Controller {

function Hello_world()
{
parent::Controller();
}

function index() {

$data['hello'] = "hello1";
$data['world'] = "world";
$this->load->view('helloindex', $data);

}

}

Entire view:
<pre>&lt;?php print_r($data); ?&gt;</pre>

Result:

A PHP Error was encountered


Severity: Notice

Message: Undefined variable: data

Filename: views/helloindex.php

Doesn't matter how, what, why, when or where you call $data.

I've doesn't something blatantly, obviously and stupefyingly dumb haven't i?
#2

[eluser]kenetiks[/eluser]
Also, just for future reference...NEVER.....EVER call 911 for coding help. They are rude, coarse and threatening. You'll get no help there, let me tell you.
#3

[eluser]John_Betong[/eluser]
&nbsp;
try this view:
Code:
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;My first CodeIgniter Program&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
<div>
<h1>
    &lt;?php echo $hello; ?&gt;
</h1>

<h2>
    &lt;?php echo $world; ?&gt;
</h2>
</div>
&lt;/body&gt;
&lt;/html&gt;
&nbsp;
After it is working maybe take some time to look at the User Guide and the Wiki,
&nbsp;
Stick with it and you will reap the rewards.
&nbsp;
&nbsp;
&nbsp;
#4

[eluser]kenetiks[/eluser]
oh noes....face/palm.

Forget I posted this.
#5

[eluser]InsiteFX[/eluser]
Also your class name is different then your constructor!

hello
Hello

Enjoy
InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB