Values in URL, but segments are blank. ? |
[eluser]gordon Stewart[/eluser]
Hello. New problem. We put in values in URl http://domain.com/news/1 It 'activates' the news function, However the '1' isn't being passed though as a segment value. Code: if ($this->uri->segment(2) === FALSE) all the $item values are blank. my system admin is online now, & i'm chatting - He's trying to figure it out... Query 1) How can I (as a user / Controller file - Check / de-bug why segments aren't being passed.. 2) What can the system administrator do - To debug from a higher level (parts I can't get access to change)...
[eluser]tomcode[/eluser]
If URI segments aren't passed, Your routes or Your .htaccess may not be set up right. To see what's going on, You need access to the code: Code: $segments = $this->uri->segment_array(); // gives the segments
[eluser]gordon Stewart[/eluser]
Segment & rsegment arrays - Blank, Blank, Blank & more blank / nada / zip / zero.. is there anything in the 'admin' side that the administrator can go into the CI code & put 'echo' commands in certain places (or save things to a log report & echo it in the controller / View page... )
[eluser]gordon Stewart[/eluser]
[quote author="tomcode" date="1274886273"]Post Your config/routes.php .htaccess[/quote] Server = nginx/0.6.32 routes.php >> Code: $route['default_controller'] = "root"; :- admin renamed "welcome" to root... :- nginx server has no htaccess (It will be ignored) I've quoted all the routes.php, except the comments (above / below)
[eluser]gordon Stewart[/eluser]
Ps, changed it to :- Code: $route['maps/(:any)'] = "maps/model_maps/$1"; Get a 404 error if we add anything after /maps/
[eluser]tomcode[/eluser]
Change the entry for the news in Your routes file [code] // is $route['news/(:any)'] = "news/item"; // change to $route['news/(:any)'] = "news/item/$1"; // or change to $route['news/(:any)'] = "news/item/$2";
[eluser]gordon Stewart[/eluser]
WEIRD WEIRD WEIRD!!! This code :- Code: $route['news/(:any)'] = "news/item"; Produces all the HTML / PHP output (but still no segments)... This code :- Code: // $route['news/(:any)'] = "news/item"; White screen on ANY page - no PHP output, No HTML output - Nothing, just a white page...... EDIT:- This code :- Code: $route['news/(:any)'] = "news/item/$2"; Displays the HTML etc on screen - But still, no segments....
[eluser]tomcode[/eluser]
I don't know whether that's the cause but Your're using this sign ‘ instead of ' in the code of the rule
[eluser]gordon Stewart[/eluser]
[quote author="tomcode" date="1274888315"]I don't know whether that's the cause but Your're using this sign ‘ instead of ' in the code of the rule[/quote] I copied your ’ ’ & replaced all of my quotes.. Uploaded the routes.php file & White screen on ALL pages (no HTML / PHP / Other output) |
Welcome Guest, Not a member yet? Register Sign In |