469,271 Members | 1,250 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Parse contents of users file into a dynamic drop down

127 100+
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 "dynamically" 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!
Mar 22 '08 #1
4 1489
acoder
16,027 Expert Mod 8TB
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.
Mar 22 '08 #2
phub11
127 100+
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!
Mar 22 '08 #3
acoder
16,027 Expert Mod 8TB
This one seems to work pretty well.
Mar 23 '08 #4
phub11
127 100+
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!
Mar 23 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Mong | last post: by
19 posts views Thread by mart2006 | last post: by
2 posts views Thread by Jim in Arizona | last post: by
6 posts views Thread by mcgrew.michael | last post: by
10 posts views Thread by mart2006 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.