I have the following index.php:
<?php
$uri = $_SERVER["REQUEST_URI"];
require_once "sql.php";
$link = mysqli_connect($host, $user, $pw, $db);
$urls = $link->query("SELECT URL FROM TEST");
switch ($uri) {
case "/":
header("location: http://www.mysite.com/en/index.php");
break;
while($rurl = mysqli_fetch_array($urls)){
case $rurl['URL']:
header("location: http://www.mysite.com/folder/page.php?test=$rurl['URL']");
break;
}
default:
include "errors/404.php";
header("HTTP/1.0 404 Not Found");
break;
}
?>
I get a couple of errors on the while loop. How can I insert a "case:" into the while?
Thank you