Jump to content

Hi need help with dropdown menu


desiinusa123

Recommended Posts

Hi I am newbie here...I am new to php. i HAVE A QUESTION REG THIS DROP DOWN, which is in .html and while action takes place it takes me to process1.php

 

.HTML CODE

students:

    <label>

    <select name="students" size="1" id="students">

        <option value="Freshman">FreshMan</option>

        <option value="Sophomore">Sophomorer</option>

        <option value="Junior">Junior</option>

        <option value="Seniorr">Senior</option>

    </select>

    </label>

how can I implement php code to select ONLY one of those items....

I need u r guidance or any reference

THnaks in adv

 

Link to comment
https://forums.phpfreaks.com/topic/122603-hi-need-help-with-dropdown-menu/
Share on other sites

If you are using MySQL, you would do something like this to insert data:

<?php

$db = mysql_connect("myhost", "blahlogin", "blahpw");

if (!$db)
   {
   die('Could not connect:'.mysql_error);
   }

mysql_select_db("dbname",$db);

$sql = "INSERT INTO tableA (fieldA, fieldB, fieldC)
VALUES ('$_REQUEST[fieldA]',
'$_REQUEST[fieldB]',
'$_REQUEST[fieldC]')";

if (!mysql_query($sql,$db))
    {
    die('Error: '.mysql_error());
    }
mysql_close($db);

?>

 

Does that help?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.