echo '<select name="newspage" onchange="location = this.options[this.selectedIndex].value;">';
for ($i = 0; $i < $page_amount; $i++) {
if ($i == $page) {
echo '<option value="index.php?page='.$i.'" selected>Page '.$i.'</option>';
} else {
echo '<option value="index.php?page='.$i.'">Page '.$i.'</option>';
}
}
echo '</select>';
} else {
echo '<p>No news exist.</p>';
Yes. The "if ($i == $page)" code is used to determine if the current tab (etc page 2) is the active/selected one. Not sure how you would write that in Bootstrap yet as I am not that familiar with it.Change this?
PHP:echo '<select name="newspage" onchange="location = this.options[this.selectedIndex].value;">'; for ($i = 0; $i < $page_amount; $i++) { if ($i == $page) { echo '<option value="index.php?page='.$i.'" selected>Page '.$i.'</option>'; } else { echo '<option value="index.php?page='.$i.'">Page '.$i.'</option>'; } } echo '</select>'; } else { echo '<p>No news exist.</p>';