I've always avoided using frames up til now, but I've recently had to implement a form spell checker script on a site I'm working on, and it's causing me grief. The code for the actual display is as follows:
The problem I'm getting is that the text displayed (i.e., the bit being checked) refuses to fill the window properly. Instead it forms one long line of text so that it has to be scrolled along. I've tried turning scrolling off, but it still displays in the same way - the only difference is that you can't read the rest of it. I've also tried adding frameset cols with a fixed width, but to no effect. The most frustrating thing is that as it loads, the text displays as I'd like it to, fitting nicely into the popup window, but then changes its mind. If anyone has any thoughts or suggestions, I would really appreciate the help!
spellchecktest.php:
if (!isset($reason)) { echo "\n\n"; } else { // add stuff to make word red, etc. if($reason == "alldone") { echo "
The spell checker has completed. Please close this window.
if(isset($OrigionalText)) { // let's start to check the next word if (isset($CurrentWordStart) && $CurrentWordStart == "0" && isset($CurrentWordEnd) && $CurrentWordEnd == "0") { $thestartpos=0; $OrigionalText=str_replace("\\'","'",$OrigionalText); $WorkingText=str_replace("\\'","'",$WorkingText); $OrigionalText=str_replace("\\\"","\"",$OrigionalText); $WorkingText=str_replace("\\\"","\"",$WorkingText); $OrigionalText=str_replace("\\\\","\\",$OrigionalText); $WorkingText=str_replace("\\\\","\\",$WorkingText); } else { $thestartpos=$CurrentWordEnd; $OrigionalText=urldecode($OrigionalText); $WorkingText=urldecode($WorkingText); $IgnoreList=urldecode($IgnoreList); $OrigionalText=str_replace("\\'","'",$OrigionalText); $WorkingText=str_replace("\\'","'",$WorkingText); $OrigionalText=str_replace("\\\"","\"",$OrigionalText); $WorkingText=str_replace("\\\"","\"",$WorkingText); $OrigionalText=str_replace("\\\\","\\",$OrigionalText); $WorkingText=str_replace("\\\\","\\",$WorkingText); }
// do requested functions here if need be switch ($spellaction) { case "change" : $changinglength=$CurrentWordEnd-$CurrentWordStart; $WorkingText=substr_replace($WorkingText,$ChangeToWord, $CurrentWordStart, $changinglength); $WorkingText=str_replace("\\'","'",$WorkingText); $WorkingText=str_replace("\\\"","\"",$WorkingText); $WorkingText=str_replace("\\\\","\\",$WorkingText); $CurrentWordEnd=strlen($ChangeToWord)+$CurrentWordStart;
// let's go back and check it again $thestartpos=$CurrentWordStart; break;
case "changeall" : $strbeforestart=substr($WorkingText,0,$CurrentWordStart); $findwordoffset=strlen($CurrentFormWord)-strlen($ChangeToWord);
// break into final word check array $textcheckarray=explode("~~SPLSPACE~~",$texttocheck); $textcheckarraymax=count($textcheckarray); $textcheckarraycounter=0;