這是我的基本網址:協議相對URL不工作
$config['base_url'] = '//'. $_SERVER['HTTP_HOST'].
str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
這是我的觀點:
<form action="<?php echo $this->config->base_url().'index.php/certification/add/'; ?>"
method="post" accept-charset="utf-8" onsubmit ='return false;'>
這是結果:
<form action="//localhost/php/index.php/localhost/php/index.php/certification/add/"
method="post" accept-charset="utf-8" onsubmit="return false;">
爲什麼會出現這種情況? (Read this如果你不知道相對協議網址是什麼。
http://stackoverflow.com/questions/550038/is-it-valid-to-replace-http-with-in-a-script-src- http – aWebDeveloper 2012-07-09 08:33:38