Page 1 of 1
Prolly something dumb
Posted: Tue Mar 23, 2004 9:02 am
by ol4pr0
Code: Select all
<?
$dir = "/usr/local/apache/htdocs/system/files";
<script language=javascript>
file = "<?php echo $uploaded; ?>"; // this part does echo the file_name
alert("We are now going to check " +file);
</script>
<?
/* here my problem starts
*
* Respuesta: Error: No se encontrĂ³ el archivo $dir/$uploaded
* We couldnt find the file $dir/$uploaded
*/
$txt = new Java('txtFile', '$dir/$uploaded');
$answer = $txt->validar(True);
echo ("<font color=000000>Respuesta: $answer<br /><font />");
break;
}
?>
I prolly missed something here .. i am just to blind to see it
Posted: Tue Mar 23, 2004 9:04 am
by malcolmboston
whats the error message?
Posted: Tue Mar 23, 2004 9:12 am
by ol4pr0
error: Respuesta: Error: No se encontrĂ³ el archivo $dir/$uploaded
* We couldnt find the file $dir/$uploaded
$dir / $uploaded somehow doesnt return path/example.txt
which it should since it automatcly checks a file after its being uploaded using a j++ class.
Posted: Tue Mar 23, 2004 9:14 am
by malcolmboston
just something to check
personally i have PHP pages and scripts seperate
so
dir structure is like this:
index.php || login.php || handlers(directory)
are you definiely pointing to the correct file (from the correct directory otherwise the path would be wrong
just trying to eliminate the obvious
Re: Prolly something dumb
Posted: Tue Mar 23, 2004 9:18 am
by redmonkey
ol4pr0 wrote:Code: Select all
<?
$txt = new Java('txtFile', '$dir/$uploaded');
?>
Should your variables be enclosed in double quotes?
Posted: Tue Mar 23, 2004 9:19 am
by ol4pr0
Thanks ill mess with it somehow...
Posted: Tue Mar 23, 2004 9:24 am
by ol4pr0
any idea why the fepo.txt gets changed in fepo/txt ? using the code above
fepo.txt <-----
Warning: java.lang.ClassNotFoundException: 'txtFile', 'fepo/txt' <--in /usr/local/apache/htdocs/system/upload.php on line 168
Fatal error: Call to a member function on a non-object in /usr/local/apache
Re: Prolly something dumb
Posted: Tue Mar 23, 2004 9:35 am
by ol4pr0
redmonkey wrote:ol4pr0 wrote:Code: Select all
<?
$txt = new Java('txtFile', '$dir/$uploaded');
?>
Sorry that is what it just wont do.. i dont get it.. since the following does return the file name
Code: Select all
<?
echo $uploaded; // will echo -> fepo.txt
echo $dir // will echo -> /usr/local/apache/htdocs/system/files
// wich is all correct
$txt = new Java('txtFile', '$dir/$uploaded'); // this wont anymore.
?>
edit :
Code: Select all
// this will return it all fine.
$dir = "/usr/local/apache/htdocs/system/files";
$txt = new Java('txtFile', $dir/$uploaded); // line 167
My errors now :
Warning: Division by zero in line 167
Warning: java.lang.IllegalArgumentException: argument type mismatch line 167
Division by zero?
Posted: Tue Mar 23, 2004 9:46 am
by redmonkey
What I meant was, should it not be..
Code: Select all
$txt = new Java('txtFile', "$dir/$uploaded");
or...
Code: Select all
$txt = new Java('txtFile', "{$dir}/{$uploaded}");
Posted: Tue Mar 23, 2004 9:56 am
by ol4pr0
That indeed did the trick.
Now i really do need some reading up on why i needed to use the double quotes to make it to work.
Posted: Tue Mar 23, 2004 3:25 pm
by m3mn0n
Click the first link in my signature.