当我尝试使用localhost在我的项目中上传图像时,它正在工作但是当我尝试使用我的IP地址时,它却无法正常工作。 例如,我尝试了以下内容:
<script type="text/javascript">
$(document).ready(fucntion()
{
$("#banner-container").mouseover(function() {
$("#sqm").hover(function(e) {
$(this).attr("src","b-3308-2a-active.png");
},
function() {
$(this).attr("src","b-3308-2a.png");
});
$("#pmlc").hover(function(e) {
$(this).attr("src","b-3308-3-active.png");
},
function() {
$(this).attr("src","b-3308-3.png");
});
$("#wireless").hover(function(e) {
$(this).attr("src","b-3308-4-active.png");
},
function() {
$(this).attr("src","b-3308-4.png");
});
$("#dst").hover(function(e) {
$(this).attr("src","b-3308-5-active.png");
},
function() {
$(this).attr("src","b-3308-5.png");
});
$("#nb").hover(function(e) {
$(this).attr("src","b-3308-2b-active.png");
},
function() {
$(this).attr("src","b-3308-2b.png");
});
});
});
哪个有效。然而,
localhost/my-project/upload
不起作用。
这个问题有什么解决方案吗?
所以有人可以告诉我在php中使用IP地址而不是localhost时会出现什么问题。
答案 0 :(得分:0)
Try this. First go to your folder. Example: (C:)xampp/htdocs/yourfoldername/application/config/config.php Open config.php. And add this /* |-------------------------------------------------------------------------- | Base Site URL |-------------------------------------------------------------------------- | | URL to your CodeIgniter root. Typically this will be your base URL, | WITH a trailing slash: | | http://example.com/ | | If this is not set then CodeIgniter will guess the protocol, domain and | path to your installation. | */ $config['base_url'] = 'http://192.192.52.2/yourfoldername/'; or $config['base_url'] = 'http://192.192.52.2/my-project/upload/'; /*