Welcome Guest, Not a member yet? Register   Sign In
how is add subject blog to url with _remap and .htaccess? (dynamic)
#11

[eluser]dUspan[/eluser]
Code:
'date_b' => $row->date,

this is your error.

removed ','

Code:
foreach ($query->result() as $row)
    {
        $data = array(
        'subject_b' => $row->subject,
        'title_b' => $row->title,                
        'image_path_b' => $row->image_path,
        'alt_b' => $row->alt,
        'text_b' => $row->text,
        'date_b' => $row->date,
        );
    }
    $this->load->view('miniblog/blog', $data);

im not expert, but try this Big Grin
Code:
$this->view_data['result'] = $query->result();
$this=>load->view('miniblog/blog', $this->view_data);

with this you can generate result now on your View
Code:
foreach($result as $row)
{
//your query row
}
#12

[eluser]SaSa[/eluser]
Not work, i send a message for you please check that...
#13

[eluser]osci[/eluser]
Man I gave you an idea. If you like it you can study it. I 'm not here to write code for you, nor set it up in cpanel (?????). If you can't make it work I'm sorry but that's about it.
#14

[eluser]SaSa[/eluser]
[quote author="osci" date="1308448418"]Man I gave you an idea. If you like it you can study it. I 'm not here to write code for you, nor set it up in cpanel (?????). If you can't make it work I'm sorry but that's about it.[/quote]

No, i just want to see your code and tell where is the problem.
It will help to better
#15

[eluser]osci[/eluser]
Look man
Code:
<?php class Blog extends CI_Controller {
    function __construct()
    {
    parent::__construct();              
    }
    public function blog($g_subject)
    {
        $query = $this->db->where('subject', $g_subject)->get('miniblog');
        // etc
    }

Class Blog
php5 constructor __construct
php4 constructor blog (and wrong case btw, should be Blog since its the PHP4 CONSTRUCTOR)

Man I'm not here to tutor you. You need to read php. I gave you code to read not to copy paste.
And as I said that's about it.
#16

[eluser]dUspan[/eluser]
You have many errors.
what i gave you is just a sample of your error.
like osci said.
try to fixed the error one by one and you will know the answer.

cheers Big Grin
#17

[eluser]SaSa[/eluser]
Ok, let me see what I can do
#18

[eluser]SaSa[/eluser]
If i want replace url bottom to .htaccess, it is true?($url have Persian words)
My url:
Code:
http://localhost/blog?id=23

//real url:
http://localhost/index.php/index/blog?id=23

Replace .htaccess:
Code:
RewriteEngine on

#remove index.php to url- this true work
RewriteRule ^([a-z0-9_-]+)\.html$ index.php/page/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|asset|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

#replace blog?id=23 with $url-this true not work
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^blog/(.*)/?$ blog?url=$1 [QSA,L]

i want this result:
like: id=23 =$url=> وب سایت
Code:
http://localhost/blog/وب سایت




Theme © iAndrew 2016 - Forum software by © MyBB