welcome.php
file located in application/controllers. Write the following code in index() function which is provided by default.
welcome_message.php
located at application/views folder and add the below code.
[html]
<div id="container">
<h1>Welcome to CodeIgniter!</h1>
<div id="body">
<p>Base URL : <?=base_url()?></p>
<p>Site URL : <?=site_url()?></p>
</div>
</div>
[/html]
The output is as follows:
Function | Description |
---|---|
base_url() | The base URL is returned by this function. |
site_url() | The site URL is returned by this function. |
current_url | The present URL full path is returned by this function. |
anchor() | Standard HTML anchor link is created by this function on the local site URL. It has three parameters text,uri segments and attributes. |
anchor_popup() | A popup is created in a new window by this function. |
mailto() | Email can be sent directly from a script using this function and it can be visible in view source. A standard output with HTML tag appears |
safe_mailto() | Emails can be sent by encoding it as a link address to avoid spam bots. |
auto_link() | This function will convert the Emails and URL's into links. |
prep_url() | This function adds 'http://' in the front of website url. |
redirect() | The function moves the given url to specified location. |