i have this jQuery function:
$("#text").load("test3.php?id="+ Math.random());
And this code is in page: user.php
When i runt this page in this address: http://127.0.0.1/user.php - everthing is OK.
But, When i runt this page in this address: http://127.0.0.1/user/
开发者_如何学Pythonin div "text" insert all root page.
test3.php page code:
<?php
echo "test 678";
?>
I'm not quite following the question, but there's a difference there and so this may help:
When the browser resolves a relative URL, it uses the document location. Your two document locations are different in that one of them looks like a path to which test3.php
should be appended, the other looks like a page name that test3.php
should replace:
http://127.0.0.1/user.php + test3.php = http://127.0.0.1/test3.php
but
http://127.0.0.1/user/ + test3.php = http://127.0.0.1/user/test3.php ^-- note the difference
Your problem is when you call http://127.0.0.1/user/
, you're like calling http://127.0.0.1/user/index.php
. You should have a folder named user
which inside it has the file index.php
to make it work.
I suggest you rename user.php
to index.php
and move it to folder user
.
精彩评论