我有一个名为friend.php的文件,我想这样做来更改friend.php的内容:
friend.php?content=1, friend.php?content=2
在google上搜索时,我可以从url中找到更改元素,但是我想更改内容完整,例如具有content1.php
,content2.php...
,但表明仅使用url即可。
答案 0 :(得分:2)
使用$_GET
superglobal进行访问:
<?php
if ($_GET["content"] == "1") {
// show content1.php
} else if ($_GET["content"] == "2") {
// show content2.php
}
?>