weemikey Posted May 30, 2007 Share Posted May 30, 2007 Hi all! I've been using this site as a reference while building my first-ever php/mysql site. I know database concepts fairly well, but php is new to me so I'm going in blind. I'm making a contact manager and the client wants to be able to use checkboxes to select email addresses on MULTIPLE pages within the system, then have them output somewhere locally as a CSV list. I can get a single page to at least store the selected addresses in a variable, but I don't know what path to take in terms of storing and concatenating addresses from different pages. I've tried a temp table, but I never even got the syntax for creating it correctly. I thought cookies would be the answer, but I get all kinds of "header can't be sent" errors. I now understand that there are places where you can set cookies and places you can't. In the interest of full disclosure, I'm basing my system on one I found in a book. Each page is a php file that creates a big text variable of html mixed with the dynamic stuff, then at the end I just echo the giant variable. I see lots of different approaches to programming this stuff, so I hope I'm not stuck in 1978 with this method. All I'm looking for is the direction an experienced programmer might take. Just pseudo code or something like it. Any thoughts are much appreciated. Thanks! weemikey Quote Link to comment https://forums.phpfreaks.com/topic/53495-new-guy-with-an-exporting-question-sort-of/ Share on other sites More sharing options...
gabeg Posted May 30, 2007 Share Posted May 30, 2007 You can use output buffering to set a cookie from within any part of the script. Personally, I would use a mix of javascript and cookies to store the information to the cookie as soon as the checkbox is checked. when the user is done checking what they need, all the information is already stored in the variable Quote Link to comment https://forums.phpfreaks.com/topic/53495-new-guy-with-an-exporting-question-sort-of/#findComment-264411 Share on other sites More sharing options...
AndyB Posted May 30, 2007 Share Posted May 30, 2007 I'd use a SESSION array to hold a list of the email addresses selected. That's all you ever need. When it's time to output the results, process the session array as you see fit. Quote Link to comment https://forums.phpfreaks.com/topic/53495-new-guy-with-an-exporting-question-sort-of/#findComment-264421 Share on other sites More sharing options...
weemikey Posted May 30, 2007 Author Share Posted May 30, 2007 Hey! Thanks for the quick replies! So, AndyB, is the SESSION array like a global? I mean, in the sense that I can access it wherever I am? Could you maybe link to an example or something for me to refer to? Thanks a million!!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/53495-new-guy-with-an-exporting-question-sort-of/#findComment-264424 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.