Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member digitalalias's Avatar
    Join Date
    Jun 2003
    Location
    Hollywood, FL, USA
    Posts
    9
    Member #
    1860
    I'm having a problem getting values from a drop-down menu from one page to another. I have a login.htm, the informationg gets sent to a validate_login.php from there is the home page of the user. This requires a drop-down menu so that the user can choose their predesigned group (not messing up anything, and not having to type so much).

    I have to test the validate_login.php with a text box because the value in the drop-down menu will not pass. I don't get it. I'm POSTing the information and I'm retrieving with $_POST[]; Everything is fine, but the value in the drop-down menu.

    Thanks for ANY help, time is at hand.

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    can't really advise too well without seeing the script, but here are a few things that could be your problems:
    1: not setting values in your options?
    Code:
    <select>
        <option value="THIS_IS_YOUR_VALUE">This is your display</option>
    </select>
    2: select not within your form?
    PHP Code:
    <form method="post" action="<?php $PHP_SELF?>">
      <select />
    </form>
    3: not retrieving value properly?
    PHP Code:
    //You have?
    $_POST[user_group];

    //Should be:
    $_POST["user_group"]; 
    iono... why don't you post your code so we can take a better look?

  4. #3
    Junior Member digitalalias's Avatar
    Join Date
    Jun 2003
    Location
    Hollywood, FL, USA
    Posts
    9
    Member #
    1860
    Hey Transio,

    Thanks for responding so quickly, I greatly appreciate it. The funny thing is it works now; weird. I went to PHP's website to research the problem some more and when I took off the "textbox" and put back the "select" object it seemed to work, so I must have missed something the first time. This is what I'm using.

    Code:
    <select name="group_id" id="group_id">
       <option value="fmp">FMP Staff</option>
       <option value="provider">Provider</option>
    </select>
    I think the problem was the "name" and "id" properties. I must have missed them or not configured them properly.

    SOLUTION: I just saw it while I was writing this. I'm using Dreamweaver so when it generates the select object it puts a "select#" for the id. That was probably the reason. It needed to be changed to the name value of my "name" property for the select.

    note: I went to check out your website and I got some broken links. Basically on all the pages. I would love to see your portfolio. Thanks again.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:54 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com