• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
site_url() and ?

#1
[eluser]nanetorg[/eluser]
Hi. I cannot resolve my problem with CI 2.0.2 and helper URL.
When i use:
Code:
$data['mail'] = site_url('contact');
it gives me:
Code:
http://127.0.0.1/test/?contact
instead of:
Code:
http://127.0.0.1/test/contact

Where is the problem? Why i have '?' before anything i pass to this function?

My config is simple:
Code:
$config['base_url']    = '';
$config['index_page'] = '';
$config['url_suffix'] = '';

Thanks.

#2
[eluser]nanetorg[/eluser]
Still working on this... can anyone help?

#3
[eluser]InsiteFX[/eluser]
If your trying setup an email contact then your doing it all wrong!

Is that what your trying to setup an email contact?

InsiteFX

#4
[eluser]nanetorg[/eluser]
Controller:

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {

    public function index()
    {
        // Data
        $data['mail'] = base_url() . 'contact';
        // Output
        $this->header->_echo();
        $this->load->view('common/home', $data);
        $this->load->view('common/footer');
    }
}

/* End of file home.php */
/* Location: ./controllers/common/home.php */

View:

Code:
<form id="contact_form" method="post" action="<?=$mail?>">

Is working like that...

#5
[eluser]patwork[/eluser]
Try changing uri_protocol.

Code:
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'            Default - auto detects
| 'PATH_INFO'        Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'        Uses the REQUEST_URI
| 'ORIG_PATH_INFO'    Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol']    = 'AUTO';

#6
[eluser]nanetorg[/eluser]
Does not work, still has this problem...

My server configuration is:
+ Apache 2.2.14 (IPV6 enabled)
+ MySQL 5.1.41 (Community Server) with PBXT engine 1.0.09-rc
+ PHP 5.3.1 (PEAR)
+ Miniperl 5.10.1
+ OpenSSL 0.9.8l
+ phpMyAdmin 3.2.4
+ Ming 0.4.3 for PHP

#7
[eluser]danmontgomery[/eluser]
Sounds like you have query strings enabled:

Code:
$config['enable_query_strings'] = FALSE;


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.