Welcome Guest, Not a member yet? Register   Sign In
Header and redirect
#1

[eluser]finord[/eluser]
Hello, I have a problem with a script, not because they will not let me redirect. I have done looking at the guide, and without output anything(only process something) in the redirect page.

I've been looking at the forum, but I have not found anything that I can help

Here is the Code: add.php
Code:
<?
class add extends Controller

     {
        function add()
         {
           parent::Controller();
           $this->load->database();
         //  $this->load->model->('op_que_trnsfer');

          }

        function index() {
}

(other functions....)

function cl(){ //First Step
?>

<a href="http://www.example.com/add/ct">dr</a>  
&lt;? }

function ct(){  //Second Step
$this->load->helper('url');
$hoy = date("m.d.y His");  
$us="loc";
$hoy1=$hoy.$us;
$key=md5($hoy1);
redirect('add/ct2/'.$key, 'location', 301);
}

function ct2($key){ //Third Step
echo $key;
}

Im want to do:
Link to ct->in ct, process key, and send it by url, and redirect->Output it in ct2

Plz, if someone else can help me. Thanks ^^

EDIT:I forgot the error:

Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /usr/home/web_domain/www/system/application/config/database.php:1)

Filename: helpers/url_helper.php

Line Number: 485

In ulr_helper, Line Numer:485:

Code:
if ( ! function_exists('redirect'))
{
    function redirect($uri = '', $method = 'location', $http_response_code = 302)
    {
        switch($method)
        {
            case 'refresh'    : header("Refresh:0;url=".site_url($uri));
                break;
            default            : header("Location: ".site_url($uri), TRUE, $http_response_code);
                break;
        }
        exit;
    }
}


Messages In This Thread
Header and redirect - by El Forum - 01-13-2009, 05:40 PM
Header and redirect - by El Forum - 01-13-2009, 09:03 PM
Header and redirect - by El Forum - 01-14-2009, 12:20 AM
Header and redirect - by El Forum - 01-14-2009, 05:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB