ASAAKI
03-12-2003, 11:56 PM
The site I'm working on is mainly an Arabic-teaching site. It has lessons, vocabulary lists, grammar charts, etc.
I've got an Admin Control Panel, and one of the options is to 'Add New Lesson'.
When adding a lesson the user gets to choose whether they want to add any vocabulary associated with the current lesson or not. If yes, then the user is asked for the number of new vocabulary words. This number gets stored in $no_vocabs and reaches the next page via the query string. According to this number, a loop "(for $i=0; $i<no_vocabs; $i++)..." generates, for each vocabulary word to be entered, a separate row of 10 textboxes (for the word itself, its root meaning, and 8 different versions of the same root word...Arabic can get complicated, you see :D). The textboxes are named according to another loop within the main loop. For example, if the user chooses to enter 3 vocabulary words, the next page will display 3 rows of 10 textboxes each, that's 30 boxes in all. The textboxes, through the second loop will be named like '0vcell0', '0vcell1', '0vcell2', '0vcell3'...until '0vcell9', and then onto the next row: '1vcell0', '1vcell1', '1vcell2', ..., then the next row, until the last cell in the last row, '2vcell9'.
So the user enters the words, and submits the form, to go to the next page, 'addLesson2.php'.
Everything works fine and dandy up till here.
The problem arises in 'addLesson2.php', when it's time to access all the values in the textboxes on the previous page. They're all in the querystring, '0vcell0=whatever&0vcell1=whateverelse', etc etc. To access them I've used this loop:
for($j=0;$j<$no_vocabs;$j++){
for($k=0;$k<10;$k++){ //for the ten textboxes
"$".$j."vcell".$k = $_GET[$j."vcell".$k];
}
}
So that if $j is currently '1' and $k is, say, '5', then the statement should produce this: $1vcell5.
But it doesn't work, I get this error:
Fatal error: Maximum execution time of 30 seconds exceeded in c:\phpdev\www\addlesson2.php on line 75
I'm not very old at php (help...i'm a newbie!j/k :D), so i might be just doing something ridiculous here.
I've got an Admin Control Panel, and one of the options is to 'Add New Lesson'.
When adding a lesson the user gets to choose whether they want to add any vocabulary associated with the current lesson or not. If yes, then the user is asked for the number of new vocabulary words. This number gets stored in $no_vocabs and reaches the next page via the query string. According to this number, a loop "(for $i=0; $i<no_vocabs; $i++)..." generates, for each vocabulary word to be entered, a separate row of 10 textboxes (for the word itself, its root meaning, and 8 different versions of the same root word...Arabic can get complicated, you see :D). The textboxes are named according to another loop within the main loop. For example, if the user chooses to enter 3 vocabulary words, the next page will display 3 rows of 10 textboxes each, that's 30 boxes in all. The textboxes, through the second loop will be named like '0vcell0', '0vcell1', '0vcell2', '0vcell3'...until '0vcell9', and then onto the next row: '1vcell0', '1vcell1', '1vcell2', ..., then the next row, until the last cell in the last row, '2vcell9'.
So the user enters the words, and submits the form, to go to the next page, 'addLesson2.php'.
Everything works fine and dandy up till here.
The problem arises in 'addLesson2.php', when it's time to access all the values in the textboxes on the previous page. They're all in the querystring, '0vcell0=whatever&0vcell1=whateverelse', etc etc. To access them I've used this loop:
for($j=0;$j<$no_vocabs;$j++){
for($k=0;$k<10;$k++){ //for the ten textboxes
"$".$j."vcell".$k = $_GET[$j."vcell".$k];
}
}
So that if $j is currently '1' and $k is, say, '5', then the statement should produce this: $1vcell5.
But it doesn't work, I get this error:
Fatal error: Maximum execution time of 30 seconds exceeded in c:\phpdev\www\addlesson2.php on line 75
I'm not very old at php (help...i'm a newbie!j/k :D), so i might be just doing something ridiculous here.