im writing a program that will look through a directory on a server, find all files in the directory with the extension .chr, open each one indivudually, then output a line on a table from each .chr file (flatfile database)......
I've added a search form on a script you get to before this one...... this script should read the inputs from the search and only display lines that match the filters.....
The way I am doing this is....
<<Code to open each .chr file>>
<<Code to split fields into variables>>
if ($input{'chkonline'} eq 'checked'){
if ($status1 eq 'Online'){
}
<<Code to Execute if $status1 = "Online" (Displays the line on the table>>
}
<<Close the file>>
The only important thing here is the if then statement, its the only thing giving me the problem.... what its doing is...... (take this for reference so I can explain... use the comments next to the lines to distinguish what part im talking about)
-----------
if ($input{'chkonline'} eq 'checked'){ # START IF 1
if ($status1 eq 'Online'){ # START IF 2
} # END IF 1
<<<CODE TO DISPLAY LINE>>>
} # END IF 2
----------
what thats susposed to do, is.... if in the previous form, leading to this script the checkbox "chkonline" is checked, then it should execute the next if statement (if ($status1 eq 'Online')) this should effect the <<CODE TO DISPLAY>>... this should be like saying, if the status is online then display the line... otherwise go to the next file.....
Now, what it is really doing is reading it like this...
-----------
if ($input{'chkonline'} eq 'checked'){ # START IF 1
if ($status1 eq 'Online'){ # START IF 2
} # END IF 2
<<<CODE TO DISPLAY LINE>>>
} # END IF 1
----------
(The end brackets are switched as to what if statement it belongs to) so basically, what this is doing, is, if the checkbox, chkonline is checked then go on... and if status is "online" then ____ (nothing... it ends here since its using the first end bracket belong to this statement)...
So instead of saying if the status is online show it.... its reading it as, if chkonline is checked then show it
Hope my explination makes sense.... i tried my best hehe... hard to explain that
I've added a search form on a script you get to before this one...... this script should read the inputs from the search and only display lines that match the filters.....
The way I am doing this is....
<<Code to open each .chr file>>
<<Code to split fields into variables>>
if ($input{'chkonline'} eq 'checked'){
if ($status1 eq 'Online'){
}
<<Code to Execute if $status1 = "Online" (Displays the line on the table>>
}
<<Close the file>>
The only important thing here is the if then statement, its the only thing giving me the problem.... what its doing is...... (take this for reference so I can explain... use the comments next to the lines to distinguish what part im talking about)
-----------
if ($input{'chkonline'} eq 'checked'){ # START IF 1
if ($status1 eq 'Online'){ # START IF 2
} # END IF 1
<<<CODE TO DISPLAY LINE>>>
} # END IF 2
----------
what thats susposed to do, is.... if in the previous form, leading to this script the checkbox "chkonline" is checked, then it should execute the next if statement (if ($status1 eq 'Online')) this should effect the <<CODE TO DISPLAY>>... this should be like saying, if the status is online then display the line... otherwise go to the next file.....
Now, what it is really doing is reading it like this...
-----------
if ($input{'chkonline'} eq 'checked'){ # START IF 1
if ($status1 eq 'Online'){ # START IF 2
} # END IF 2
<<<CODE TO DISPLAY LINE>>>
} # END IF 1
----------
(The end brackets are switched as to what if statement it belongs to) so basically, what this is doing, is, if the checkbox, chkonline is checked then go on... and if status is "online" then ____ (nothing... it ends here since its using the first end bracket belong to this statement)...
So instead of saying if the status is online show it.... its reading it as, if chkonline is checked then show it
Hope my explination makes sense.... i tried my best hehe... hard to explain that