Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何加载php文件而不显示它?(/page.php->;/page)_Php - Fatal编程技术网

如何加载php文件而不显示它?(/page.php->;/page)

如何加载php文件而不显示它?(/page.php->;/page),php,Php,我想运行localhost/page?test=1,但由于我使用php,我必须创建一个名为“page”的文件夹,然后在其中创建一个index.php文件。即使我这样做了,也不一样,我必须调用localhost/page/?test=1,而不是localhost/page?test=1 我真的不知道用谷歌搜索什么,所以这是描述我问题的完美方式。你可以使用htaccess从URL-->中删除文件扩展名,将index映射到URL中的index.php 因此URL变为 localhost/page/in

我想运行localhost/page?test=1,但由于我使用php,我必须创建一个名为“page”的文件夹,然后在其中创建一个index.php文件。即使我这样做了,也不一样,我必须调用localhost/page/?test=1,而不是localhost/page?test=1


我真的不知道用谷歌搜索什么,所以这是描述我问题的完美方式。

你可以使用
htaccess
从URL-->中删除文件扩展名,将
index
映射到URL中的
index.php

因此URL变为

localhost/page/index?test=1
而不是
localhost/page/index.php?test=1


阅读如何操作以及有关
的更多信息。htaccess

这是否回答了您的问题?