pintu1228 Posted May 15, 2023 Share Posted May 15, 2023 Hi, so I have created a frontend page to allow user to select from dropdown list. Depending on dropdown textfields are shown to have them enter values. These 6 PDFs have different pages at the end of each of them (the first 5-6 pages are all the same in them and then the last 7 pages are all different based on which dropdown list is selected). My question is what is the best way to code this: Should I create 6 versions of the php file and call them based on what dropdown list selection is made? Should I keep 1 php file and then check what selection is made (using if statements) and generate PDF? Wouldn't I have lots of repetition if I choose this method since in my code there is lots of formulas. If someone can point me to how to accomplish either of these, that would be great. Quote Link to comment https://forums.phpfreaks.com/topic/316318-dropdown-list-selection-to-generate-pdfs/ Share on other sites More sharing options...
requinix Posted May 15, 2023 Share Posted May 15, 2023 One of those options is significantly less complicated than the other, and the outcome is the same. Quote Link to comment https://forums.phpfreaks.com/topic/316318-dropdown-list-selection-to-generate-pdfs/#findComment-1608422 Share on other sites More sharing options...
pintu1228 Posted May 16, 2023 Author Share Posted May 16, 2023 Can you provide which one is best to use and where I can find some examples to mimic my code? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/316318-dropdown-list-selection-to-generate-pdfs/#findComment-1608446 Share on other sites More sharing options...
requinix Posted May 16, 2023 Share Posted May 16, 2023 I'm confident that the less complicated one is the better solution. In terms of code, all you need is something that can tell what option the user selected, and something that can do what it needs to do to give the user the PDF they requested. Try writing the code yourself. If you have problems getting it to work then post what you have with a description of what you're trying to do and what problem(s) you're having with it. 1 Quote Link to comment https://forums.phpfreaks.com/topic/316318-dropdown-list-selection-to-generate-pdfs/#findComment-1608447 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.