Monday, 15 March 2010

php - codeigniter only getting single digit params from url -


I have an issue that I can not understand.

I am recovering company records My database is a digit ID in some companies while others have 2 or 3 digits of ID.

If I look at a company using the URL: domain.com/company/view/3 , this will list the company when I connect to that company, The URL looks like this: domain.com/contact/add/3 and everything works fine.

However, the companies that have 2 or 3 digits here are:

If I look at a company using the URL: domain.com/company/ View / 54 This will list the company properly when I add contact with that company, the URL looks like this: domain.com/contact/add/5 . Therefore, it is closing the final digit (4).

If you need this, here's my controller:

  add public function ($ id) {if (continue ($ _ POST ["plus"]) ) {$ This- & gt; Device_model- & gt; Add ($ id); Redirect ('company / view /'. Id); } $ Data ['places'] = $ this- & gt; Device_model- & gt; Get_space ($ id); $ Data ['data'] = $ id; $ This- & gt; Load-> View ('templates / header'); $ This- & gt; Load-> View ('Tools / Additions', $ data); $ This- & gt; Load-> Views ('templates / footers'); }   

Any idea what's going on?

Edit: htaccess

  AddHandler application / x-httpd-php53 .php RewriteEngine Rwight condom at% {REQUEST_FILENAME}! -d Recovery code% {REQUEST_FILENAME}! -f Rewrite Convert% {REQUEST_FILENAME}! -l rewrite $ 1! ^ Index (index.) $ Index.php? Url = $ 1 [QSA, L]   

My routes look like this:

  $ route ['default_controller'] = "home"; $ Route ['logout'] = "atit / logout"; $ Route ['login'] = "auth / login"; // $ route ['(: any)'] = ''; $ Route ['404_override'] = 'error / error_404';   

Update 2: To make things easier, I made a quick video and uploaded it to make it so that you can see what talking about I

It seems that the ID is returning for your contact instead of your company. Have you checked that argument?

No comments:

Post a Comment