how to take the url to became a variable |
[eluser]yudahebat[/eluser]
Code: http://localhost/ci2/adminpage/choose_testi/4 I want to take '4' as an ID how to make the function??
[eluser]yudahebat[/eluser]
Code: function choose_testi() thx, Ive use it on my function but there is a problem how to call the adm_testimonial.php?? because on the url from the function that I make it makes me go to Code: http://localhost/ci2/adminpage/choose_testi/4 I want it became like this : Code: http://localhost/ci2/adminpage/adm_testimonial help me please
[eluser]sherpa[/eluser]
Code: function choose_testi() Code for Views (print the column fields in in your view (it only for your understanding purpose ) Code: echo $tanggal;
[eluser]jedd[/eluser]
You could, and arguably should, instead just do this: Code: function choose_testi ( $id = 0 ) With your cited URL of : http://localhost/ci2/adminpage/choose_testi/4 , the variable $id gets a value of 4. If your URL has no number after 'choose_testi' then $id is set to 0. EDIT: Accidentally left the urisegment assign in there .. whoops!
[eluser]yudahebat[/eluser]
didn't work... forget it I have new problem I want to make this Code: $this->load->view('adm_testimonial',$data); to redirect function how to make it?? is this true?? Code: redirect('/adminpage/adm_testimonial/',$data); make the function still on adm_testimonial page and read the $data also... please your opinion..
[eluser]yudahebat[/eluser]
Fatal error: Call to undefined method stdClass::num_rows() in C:\xampp\htdocs\CI2\system\application\controllers\adminpage.php on line 246
[eluser]jedd[/eluser]
[quote author="yudahebat" date="1238576205"]didn't work... forget it [/quote] I can't forget it. I'm not that kind of guy. I made a mistake - and have since edited the post above - you should re-read and re-try. With your follow-up question, I'm unsure what you mean. This bit is from your controller, I'm assuming: Code: $this->load->view('adm_testimonial',$data); And you say you want to 'redirect function' to: Quote: I don't understand what you are actually attempting to achieve, and what file structure you are attempting to use. Do you have a controller called adminpage? Or do you have a view-subdirectory by that name? Please use more words and less question marks. ![]()
[eluser]yudahebat[/eluser]
Code: function choose_testi() it produce this error statement : Code: Fatal error: Call to undefined method stdClass::num_rows() in C:\xampp\htdocs\CI2\system\application\controllers\adminpage.php on line 246 how to fixed it??
[eluser]yudahebat[/eluser]
Code: <?php this is my adminpage.php |
Welcome Guest, Not a member yet? Register Sign In |