Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Drop down list with anchors

Featured Replies

This should be simple but I'm not quite there.

 

I want to create a drop down list to link to sections on the same page.

 

Here is what I have so far:

function make_genera_pulldown() {

// Make the genre array:
$genera = array (1 => '', 'ACOUSTIC', 'ALTERNATIVE', 'BLUES ROCK', 'DRUM AND 
BASE', 'ELECTRO', 'EMO', 'EXPERIMENTAL', 'FOLK', 'FUNK', 'GARAGE', 'GOTHIC', 'GRUNGE', 'HARDCORE', 
'HIP-HOP',  'INDIE', 'JAZZ', 'MAGOO', 'METAL', 'NEW WAVE', 'POWERPOP', 'PROGRESSIVE', 'PUNK', 'RNB',
'SKA', 'WRONGPOP');
// Make the genre pull-down menu:
echo '<select name="genera">';
foreach ($genera as $key => $value) {
	echo '<option><a href="#'.$value.'">'.$value.'</a></option>'; 
}
echo '</select>';
}



?>

Genre: 
<?php   make_genera_pulldown(); ?>






require_once (MYSQL); // Connect to the db.

	$q = "SELECT band_id, genera, band_name, music_description FROM band_members ORDER BY genera , band_name";
	$r = mysqli_query($dbc, $q);

$currentGenre = '';
while ($messages = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
   if ($currentGenre != $messages['genera']) {
       echo "<a name=\"{$messages['genera']}\"><h2>{$messages['genera']}</h2></a>\n";
       $currentGenre = $messages['genera'];
   }
echo "<a href=bandinfo.php?id={$messages['band_id']}><h5>     ".stripslashes($messages
['band_name'])."</h5></a><br />          ".stripslashes($messages['music_description'])." <br /><br />\n";
}

mysqli_free_result ($r); // Free up the resources.	

mysqli_close($dbc); // Close the database connection.




 

But it not quite working yet.

 

Thanks for any help...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.