Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error message

Status
Not open for further replies.

tanveer91

Programmer
Nov 13, 2001
31
GB
Hi there,

For some reason i keep getting the following error message on my web browser, whenever i try to call a php file by submitting a standerd web form......Any idea what it means, its driving me nuts!!!

Fatal error: input in flex scanner failed in /home/httpd/html/sandalrugby/results on line 1
 
Flex, is the scanner for sintaxe. have you got a stange char in the beggining of the script.

Another thing that can be, is that it requires .php extensions. But i do not think so.
Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Thanks for the advice 'anakin'.....still can't find any problems with my script..........here's my code on file 'ref.htm':

<?php
include ('top.htm');
$matchdate = '$Match_year$Match_month$Match_day';
$date2 = date(&quot;Ymd&quot;);

$fp=fopen(&quot;results/$matchdate&quot;, &quot;w&quot;);

$string='<tr>
<td valign=top align=left>
<font size=3 type=arial><b>
$Match_day/$Match_month/$Match_year
</b></td>
<td valign=top align=left>
<font size=3 type=arial><b>
$Comp
</b></td>
<td valign=top align=left>
<font size=3 type=arial><b>
$Venue
</b></td>
<td valign=top align=left>
<font size=3 type=arial><b>
Sandal <i>$Sandal -- $Opps</i> $Verses
</b></td>
</tr>';

fputs($fp, $string);
fclose($fp);

$handle=opendir('results');

while (($file = readdir($handle))!==false) {

if ($file <= $date2) {
include(&quot;results/$file&quot;);
}
}
closedir($handle);
// include 'tail.htm';
?>


 
You have too many errors.

First a .htm file? the server is configured to run PHP with .htm files?

Second when you use:
$var= 'balbalabaa $othervar jhfdakf'

it will not replace $othervar with the value of $othervar, instead will copy the string $othervar to the output. To replace the varname by the value, you must use double quotes (&quot;) instead of single ones (').

other thing, check the result of the opendir command and add another condition to the if just before the include command is_file($file) to include ONLY files, skipping the (.) and (..) entries and other dirs that you can have in there.

other $file <= $date2 are you comparing filenames with dates? or the filenames are dates? if so, you must use yyyy-mm-dd date format. Any one else with produce strange results.


If this will not help, say more about the error.

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top