Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2006
    Posts
    176
    Thanks
    14
    Thanked 1 Time in 1 Post

    Notice: Undefined offset: 1

    Hi,

    I am collecting data within a form. The select option is generated by a php/mysql loop:
    PHP Code:
    ("<option>" $row['provId'] .":".$row['provname'] ."</option>"   
    I am trying to split this data with my php process file:

    PHP Code:
    list($provId,$provname) = explode(':',$_POST['provider']); 
    This won't work in IE and returns a $provId value of '0' every time along with the notice:
    "Undefined offset: 1"


    Thanks,

    Andy

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,122
    Thanks
    2
    Thanked 327 Times in 319 Posts
    You need a value="..." parameter, otherwise nothing is sent to the server - http://w3schools.com/tags/tag_option.asp
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •