Welcome Guest, Not a member yet? Register   Sign In
Values in URL, but segments are blank. ?
#21

[eluser]WanWizard[/eluser]
Do a 'var_dump($_SERVER);' in the constructor of your news controller.

Check if your application really gets what you think it should get (PATH_INFO, REQUEST_URI, etc).
#22

[eluser]gordon Stewart[/eluser]
[quote author="WanWizard" date="1276698692"]Do a 'var_dump($_SERVER);' in the constructor of your news controller.

Check if your application really gets what you think it should get (PATH_INFO, REQUEST_URI, etc).[/quote]

I do get REQUEST_URI, but no PATH_INFO...

DOCUMENT_URI does get info Smile

PHP_SELF, SCRIPT_NAME also gets values
#23

[eluser]WanWizard[/eluser]
And does the request_uri contain the correct info? Nothing stripped or rewritten?

What is the uri_protocol defined in config.php? If it's set to 'PATH_INFO' or 'AUTO', try changing it to 'REQUEST_URI'.
#24

[eluser]gordon Stewart[/eluser]
[quote author="WanWizard" date="1276700578"]And does the request_uri contain the correct info? Nothing stripped or rewritten?

What is the uri_protocol defined in config.php? If it's set to 'PATH_INFO' or 'AUTO', try changing it to 'REQUEST_URI'.[/quote]

Config file :-

Code:
// $config['uri_protocol']    = "ORIG_PATH_INFO";

//$config['uri_protocol']    = "QUERY_STRING";
// $config['uri_protocol']    = "PATH_INFO";
//$config['uri_protocol']    = "AUTO"; << NO
$config['uri_protocol']    = "REQUEST_URI";
//$config['uri_protocol'] = "AUTO";


(already on REQUEST_URI)

REQUEST URI in output =

Code:
["REQUEST_URI"]=>
  string(13) "/news/item/54"

Nothing stripped
#25

[eluser]WanWizard[/eluser]
Ok, so far so good.

What's the output of
Code:
var_dump($this->uri->uri_string);
when put in the constructor of your news controller?
#26

[eluser]gordon Stewart[/eluser]
[quote author="WanWizard" date="1276703786"]Ok, so far so good.

What's the output of
Code:
var_dump($this->uri->uri_string);
when put in the constructor of your news controller?[/quote]


Code is :-
Code:
echo "<PRE>\n";
var_dump($_SERVER);
echo "</PRE>\n";
echo "<BR><HR><BR>\n";

echo "<PRE>

URI STRING \n";
var_dump($this->uri->uri_string);
echo "</PRE>\n";
echo "<BR><HR><BR>\n";


Output :-

Code:
URI STRING
NULL

I guess NULL is not a good result ?

(EDIT - Added 1st art of code, & yes, in order - I still get the values for $_SERVER )
#27

[eluser]WanWizard[/eluser]
No, guess not. Here it just displays the contents of the REQUEST_URI.

You haven't extended the Router library by any chance? Or defined 'enable_query_strings' in the config as TRUE?
#28

[eluser]gordon Stewart[/eluser]
[quote author="WanWizard" date="1276704649"]No, guess not. Here it just displays the contents of the REQUEST_URI.

You haven't extended the Router library by any chance? Or defined 'enable_query_strings' in the config as TRUE?[/quote]

Code:
$config['enable_query_strings'] = FALSE;
$config['controller_trigger']     = 'c';
$config['function_trigger']     = 'm';
$config['directory_trigger']     = 'd'; // experimental not currently in use

EDIT :- what / where / how do I extend the router library (so i can see if its on or off)

routes.php = minimal activity
#29

[eluser]gordon Stewart[/eluser]
I've checked the config file & various other files / directories - I don't think I've extended the router library
#30

[eluser]WanWizard[/eluser]
If you don't know how, you probably haven't. Smile

The URI is parsed by the router class very early on in the process. The fact that uri_string returns NULL means that the method responsible for fetching it isn't even called (as that method returns "", not NULL).

Add this to the constructor of your news controller:
Code:
global $URI;
var_dump($URI);die();
What's the contents of uri_string, segments and rsegments?




Theme © iAndrew 2016 - Forum software by © MyBB