Parse contents of users file into a dynamic drop down

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phub11
    New Member
    • Feb 2008
    • 127

    Parse contents of users file into a dynamic drop down

    Hi,

    I've found a great website which can extract data from a MySQL database and populate chained drop downs. (http://www.noboxmedia. com/20/massive-ajax-countryarea-drop-down-list/)

    I'd like the option of a user "dynamicall y" uploading their Excel file, extracting certain data, and including their data in the drop downs too. All this without the users data needed to be stored on the server longer than necessary.

    The only way I can see how to do this is use PHP to read the Excel file (via phpexcelreader) , MySQL to create a temporary table uisng this data, PHP to set global variables based on the users data in the table, and finally reload the original webpage with the addition page content taken from the global variables.

    This seems a bit too complex. Does anyone know of an easier way - or even better - a web site which has an example?!

    Thanks!
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Originally posted by phub11
    The only way I can see how to do this is use PHP to read the Excel file (via phpexcelreader) , MySQL to create a temporary table uisng this data, PHP to set global variables based on the users data in the table, and finally reload the original webpage with the addition page content taken from the global variables.

    This seems a bit too complex. Does anyone know of an easier way - or even better - a web site which has an example?!
    An alternative would be to avoid creating the table in MySQL. Just use PHP to generate the options for the drop down or use XML/JSON and echo the results. Then return this as a result to an Ajax request. As for the actual upload, this isn't really possible with Ajax, but you can use iframes to achieve the same effect.

    Comment

    • phub11
      New Member
      • Feb 2008
      • 127

      #3
      Thanks for the reply!

      I stumbled upon an iframes example - but from what i've heard, iframes can act funny with certain browsers. I was hoping to avoid that.

      Thanks again!

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        This one seems to work pretty well.

        Comment

        • phub11
          New Member
          • Feb 2008
          • 127

          #5
          Thanks for the suggestion...

          That site was one of the first I looked at - and although it uses Iframes, you are right, as it seems to work on IE6, FF2, and Safari.

          I guess Iframes are supported better than I was lead to believe.

          Cheers!

          Comment

          Working...