Welcome Guest, Not a member yet? Register   Sign In
Problem using anchor tag (solved)
#7

[eluser]stormlead[/eluser]
@Brian
i did not understand where we have to load the url helper.
and i am really not getting how to link a page. Please help through this following are the codes which i am writting
welcome.php
Code:
<?php

class Welcome extends Controller {
var $base;
var $css;

function Welcome()
{
     parent::Controller();    
}
    
function index()
{
    $this->load->helper('url');
     $base=$this->config->item('base_url');
     $css=$this->config->item('css');
    $data['css']=$this->css;
    $data['base']=$this->base;
    $data['mytitle']='Welcome to my first page';  
     $data['mytext']='Ok! So i am getting a hang of CI. Its good lets just move on...';  
    $this->load->view('index',$data);
    }

}
code for index.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;This is test page&lt;/title&gt;
&lt;base href="&lt;?php echo "$base"; ?&gt;" /&gt;
&lt;link rel="stylesheet" type="text/css" href="css/mystyle.css" /&gt;
&lt;body bgcolor="#CCCCCC"&gt;
<div align="center" class="style1" >
This is my test page </div><br />
<div align="center" class="style2" >
&lt;?php echo "$mytitle";?&gt;
</div><br />
<div align="center" class="style3" >
&lt;?php
echo "$mytext";
?&gt;
</div>
<br />
<div align="center" style="text-decoration:none;" class="style3" >
&lt;?php
echo  anchor('system/application/controllers/next.php','click here');
?&gt;
</div>

&lt;/body&gt;
&lt;/html&gt;

and in controller for next.php
the code is

Code:
&lt;?php

class Next extends Controller {
function Next()
{
     parent::Controller();    
}
    
function index()
{
    $this->load->view('welcome_message');
    }

}


Messages In This Thread
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 04:16 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 04:50 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 05:18 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 05:24 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 05:31 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 05:33 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 05:54 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 06:26 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 06:34 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 06:34 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 06:42 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 06:49 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 06:50 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 06:53 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 07:03 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 07:05 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 09:01 AM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 12:07 PM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 12:19 PM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 01:06 PM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 01:16 PM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 01:28 PM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 03:16 PM
Problem using anchor tag (solved) - by El Forum - 10-26-2009, 07:33 PM
Problem using anchor tag (solved) - by El Forum - 10-27-2009, 12:26 AM
Problem using anchor tag (solved) - by El Forum - 10-27-2009, 01:37 AM
Problem using anchor tag (solved) - by El Forum - 10-27-2009, 02:35 AM
Problem using anchor tag (solved) - by El Forum - 10-28-2009, 09:44 AM
Problem using anchor tag (solved) - by El Forum - 10-29-2009, 06:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB