我有一个php代码:
if($_SERVER['REQUEST_URI'] == '/?task=entry.add&sid=67'){echo'<script type="text/javascript">window.location.assign("/index.php");</script>';}else{echo"";}
if($_SERVER['REQUEST_URI'] == '/?task=entry.add&sid=68'){echo'<script type="text/javascript">window.location.assign("/index.php");</script>';}else{echo"";}
if($_SERVER['REQUEST_URI'] == '/?task=entry.add&sid=69'){echo'<script type="text/javascript">window.location.assign("/index.php");</script>';}else{echo"";}
我正在尝试循环执行此操作(例如,ID 应该从 67 到 100)
<?php
$page = $_POST['id'];
for ($i=1; $i<=$id; $i++){
$url = "/?task=entry.add&sid=".$i."<br/>";
echo'<script type="text/javascript">window.location.assign("/index.php");</script>';}else{echo"";
}
?>
我应该做些什么,我的问题在哪里?