I have a database in which i upload images as blobs , anyway there was a need that the database should remember the path.
I use php3.0.16 in my server so using the [$filename_name] would only return to me the name of the file that i wanted to upload and not the whole path.
So i wanted a way to read the textfield's value. So i figured to use javascript.
This is what i did so i could pass the textfield value from my javascript function to my php.
<script language=javascript type="text/javascript">
function validForm()
{
var str = document.form1.filename.value;
var str2 = document.form1.filename2.value;
document.form1.t.value = str;
document.form1.t2.value = str2;
}
</script>
</head>
<body>
<form name="form1" enctype="multipart/form-data" action=http://myserver.server.gr/test.php3 method=post>
<input type="file" name="filename" size="50">
<br>
<input type="file" name="filename2" size="50">
<br>
<input type="hidden" name="t">
<input type="hidden" name="t2">
<br>
<input type="submit" name="submit" value="Ok" onClick=validForm()>
<input type="reset" name="Submit2" value="Reset">
</form>
</body>
<?
echo stripslashes($t);
echo "<br>";
echo stripslashes($t2);
?>
The only way i found is to pass the result in hidden field so that Php could use it as it.
I post this hoping that might help others.
If you know a better way plz reply.