Split a Large File
There could be a situation where you want to split a big file that has 10000's of records which we want to split into files of 100 lines. Say in my case, I got a file with 2000 mail IDs of the customer and want to split it into files of 200, so that I can send mails for that 200 mail IDs (a limitation of our shared hosting).So I came up with the following solution:
Here is the sample page to invoke the function:
Chained Combo Box
Another one was PHP/MySQL/Ajax Chained Combo Box.Every one of us has reached the scenario where the values of combo box need to be changed depending upon the previous combo box selection.
It's been easier if we include Ajax in this as it just deprecated the page loading for such simple thing. Ok, let's have a look at the code:
index.php
getText.php
dbcommon.php (simple file which has all the MySQL connection details)
ajax.js, the magic file which is responsible for the chained combo box functionality
Table structure that used in this sample
That's it. You're good to go. This approach is much cleaner instead of using plain PHP/MySQL.
Sometimes it looks like PHP/MySQL will be OK for a task, but after going for some time, you feel awkward afterward. So instead, separate things and give some of them to Ajax so that it'll take care of best part of the functionality with ease.
The easiest way for you to run this code is, simply copy all code to corresponding files and create the table. Open the index.php file, that's it.