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

[eluser]gordon Stewart[/eluser]
[quote author="WanWizard" date="1276705934"]
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?[/quote]

Interesting - It died

You didn't tell me WHERE to put the code - so I added it here :-

Code:
function item($cat=0)
        {


global $URI;
echo "<PRE>\n

START URI

";
var_dump($URI);die();
echo "

END URI
</PRE>
<HR>\n";


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


It died - Didn't get to the "END URI" or the $_SERVER parts...


output

Code:
START URI

object(CI_URI)#13 (5) {
  ["keyval"]=>
  array(0) {
  }
  ["uri_string"]=>
  NULL
  ["segments"]=>
  array(0) {
  }
  ["rsegments"]=>
  array(0) {
  }
  ["config"]=>
  &object;(CI_Config)#3 (2) {
    ["config"]=>
    &array;(35) {
      ["base_url"]=>
      string(54) "http://BASE-URL-IS-CORRECT/index.php//news/item//"
      ["index_page"]=>
      string(0) ""
      ["uri_protocol"]=>
      string(11) "REQUEST_URI"
      ["url_suffix"]=>
      string(0) ""
      ["language"]=>
      string(7) "english"
      ["charset"]=>
      string(5) "UTF-8"
      ["enable_hooks"]=>
      bool(false)
      ["subclass_prefix"]=>
      string(3) "MY_"
      ["permitted_uri_chars"]=>
      string(14) "a-z 0-9~%.:_\-"
      ["uri_segment"]=>
      int(4)
      ["enable_query_strings"]=>
      bool(false)
      ["controller_trigger"]=>
      string(1) "c"
      ["function_trigger"]=>
      string(1) "m"
      ["directory_trigger"]=>
      string(1) "d"
      ["log_threshold"]=>
      int(4)
      ["log_path"]=>
      string(38) "/SERVER-CORRECT-PATH/logs/"
      ["log_date_format"]=>
      string(11) "Y-m-d H:i:s"
      ["cache_path"]=>
      string(0) ""
      ["encryption_key"]=>
      string(0) ""
      ["sess_cookie_name"]=>
      string(10) "ci_session"
      ["sess_expiration"]=>
      int(7200)
      ["sess_encrypt_cookie"]=>
      bool(false)
      ["sess_use_database"]=>
      bool(false)
      ["sess_table_name"]=>
      string(11) "ci_sessions"
      ["sess_match_ip"]=>
      bool(false)
      ["sess_match_useragent"]=>
      bool(true)
      ["sess_time_to_update"]=>
      int(300)
      ["cookie_prefix"]=>
      string(0) ""
      ["cookie_domain"]=>
      string(0) ""
      ["cookie_path"]=>
      string(1) "/"
      ["global_xss_filtering"]=>
      bool(false)
      ["compress_output"]=>
      bool(false)
      ["time_reference"]=>
      string(5) "local"
      ["rewrite_short_tags"]=>
      bool(false)
      ["proxy_ips"]=>
      string(0) ""
    }
    ["is_loaded"]=>
    array(0) {
    }
  }
}
#32

[eluser]gordon Stewart[/eluser]
ps - above url was :- /news/item/54/



EDIT:- Changed output URL to just URL (the URL I entered in my browser)
#33

[eluser]WanWizard[/eluser]
It died because of the 'die()' statement. Smile

Why does your base_url have '/news/item' in it? That shouldn't be there...

The Uri and Router libraries are loaded by Codeigniter.php, which is called by your index.php. The Router class fetches the URI in it's constructor. Nothing much happens before that.

This calls for some serious step by step debugging I'm afraid, because I'm through my ideas...
#34

[eluser]gordon Stewart[/eluser]
[quote author="WanWizard" date="1276709197"]It died because of the 'die()' statement. Smile

Why does your base_url have '/news/item' in it? That shouldn't be there...

The Uri and Router libraries are loaded by Codeigniter.php, which is called by your index.php. The Router class fetches the URI in it's constructor. Nothing much happens before that.

This calls for some serious step by step debugging I'm afraid, because I'm through my ideas...[/quote]

Read messages 15 & 17 by mddd - I took out the routing in route.php & used the URL directly to call the script / function. (this still has no value in the output)

Anyway, I'm off to bed soon - I'll re-add the route tomorow & try again...


Personally, I think something s wrong with the main CI scripts - Though I do not have access to the server directories, only the user-directories..

Query :- Is there an on/off debug command we (user) can implement, to echo / view the debug output in the main CI scripts ? - Or can these manually be added in by the / a system administrator...

EG :-

:- Start URL extraction
:- Values of URL are :- (blah.. blah...)
:- Expoloding into array (lists array...)
:- Storing each value (lists each value stored...)

I guess we can't micro-micro-manage the de-bugging like that unless we deliberately code it in right ?

OK, I'm off to bed..
#35

[eluser]WanWizard[/eluser]
That shouldn't be needed, the CI core code works as advertized (in most cases Smile )

So no, there is none. There are some server-side debuggers though, but since it looks like you don't own your server, thats going to be difficult.

I wasn't referring to routes, I said that the Uri and Router libraries are loaded quite early in the process, and the Router class parses the URI string in it's constructor. Before that, there are only a handful of lines of code, doing nothing special. This all happens in CI code, not in user code, to which you say you don't have access.

If you're willing to get me a zip of your application directory, I can have a look here. Probably faster than me working blind sending messages back and forth.

Sweet dreams... :-)




Theme © iAndrew 2016 - Forum software by © MyBB