Hi,
I have a list of data text files, which I use to generate a query. I have setup a form using:
<form action="./generate.php" method="get">
<select name="file">
<option value=http://www.phpbuilder.com/board/archive/index.php/"data1.txt">Data File #1</option>
...
</select>
When I select, lets say, select Data File #1 and click submit. It passes the var, file=data1.txt, to generate.php, but it doesn't work. I get the error code "Waring Supplied argument is not a valid File_Handle resource in..." for the last two lines below:
$FileName = $file;
if (!file_exists($FileName))
{
echo "<h1>$datafile<P>File Not Found?</h1>";
}
else {
echo $datafile;
@ $dataFile = fopen($FileName, "r");
set_time_limit(1000000);
while (!feof($dataFile)) {
$getData = fgets($dataFile, 4096);
......
I know if I set the name manually in generate.php ($FileName), the script it will work fine. But when I use the form, I get the error message. I have tried using data1.txt with out the extension (data1) but that didn't do anything either.
Any ideas??
Thanks!
I have a list of data text files, which I use to generate a query. I have setup a form using:
<form action="./generate.php" method="get">
<select name="file">
<option value=http://www.phpbuilder.com/board/archive/index.php/"data1.txt">Data File #1</option>
...
</select>
When I select, lets say, select Data File #1 and click submit. It passes the var, file=data1.txt, to generate.php, but it doesn't work. I get the error code "Waring Supplied argument is not a valid File_Handle resource in..." for the last two lines below:
$FileName = $file;
if (!file_exists($FileName))
{
echo "<h1>$datafile<P>File Not Found?</h1>";
}
else {
echo $datafile;
@ $dataFile = fopen($FileName, "r");
set_time_limit(1000000);
while (!feof($dataFile)) {
$getData = fgets($dataFile, 4096);
......
I know if I set the name manually in generate.php ($FileName), the script it will work fine. But when I use the form, I get the error message. I have tried using data1.txt with out the extension (data1) but that didn't do anything either.
Any ideas??
Thanks!