Skip to content
View in the app

A better way to browse. Learn more.

MSFN

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.

Need Help In Php

Featured Replies

Hi,

I need some help. i have a page with a list box containing id. when i choose a id i have to show the info belongs to the id in the same page. the info are in the database with the id. I m using php and javascript

I think u understand the prob, if not, inform me.

Thanks


Hi

You can try something like this. Now remember this is only a quick sketch to get you on the right track.

<html-code-design>

<?
// Connect to the database
mysql_connect('server', 'username', 'password');
mysql_select_db('database');

// Only when the form is submitted and id is number only
if ($_SERVER['REQUEST_METHOD'] == 'POST' && preg_match('^[0-9]+$', $_POST['infoID'])
{   $result = mysql_query('SELECT infoTitle, infoText FROM infos WHERE infoID=$_POST['infoID'] LIMIT 1');
    if (mysql_num_rows($result) > 0)
    {   $row = mysql_fetch_assoc($result);
         echo '<b>'.$row['infoTitle'].'</b><br />';
         echo $row['infoText'];
     }
     else
     {    echo 'Unknown ID';
     }
}
?>
<form name="infoForm" action="" method="post">
<select name="infoID" size="1">
  <?
  $result = mysql_query('SELECT infoID, infoTitle FROM infos ORDER BY infoTitle');
  while ($row = mysql_fetch_assoc($result))
  {   echo '<option value="'.$row['infoID'].'">'.$row['infoTitle'].'</option>';
  }
  ?>
</select>
</form>

<?
// Closes the database
mysql_close();
?>

I hope i've understood it correctly

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

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.