[CODE=php]
<?php ?>
<html>
<head>
<script language="javas cript">
function getpath()
{
var pname = document.form1. fr.value;
return pname;
}
</script>
</head>
<body>
<form enctype="multip art/form-data" name="form1" action="filerea d.php" method="POST">
<input type="file" name="fr" id="fr"> <br><br>
<input type="submit" name="submit" value="Read" >
</form>
<?php
if(isset($_POST['submit']))
{
//$myfile="E:\sac hins\projects\m e\myfile.txt"; -This is static path
$myfile= $_FILE["fr"]; //i want value of fr which is input file type
echo $myfile;
$fr=fopen($myfi le,"r");
while (!feof($fr))
{
echo fgets($fr). "<br />";
}
?>
</body>
</html>
[/CODE]
i am trying with above code to get the value input in file type in php code
and not able to get this thing.
i know how to take path in javascript
but don't know how to pass that value to php code
Please help me...
<?php ?>
<html>
<head>
<script language="javas cript">
function getpath()
{
var pname = document.form1. fr.value;
return pname;
}
</script>
</head>
<body>
<form enctype="multip art/form-data" name="form1" action="filerea d.php" method="POST">
<input type="file" name="fr" id="fr"> <br><br>
<input type="submit" name="submit" value="Read" >
</form>
<?php
if(isset($_POST['submit']))
{
//$myfile="E:\sac hins\projects\m e\myfile.txt"; -This is static path
$myfile= $_FILE["fr"]; //i want value of fr which is input file type
echo $myfile;
$fr=fopen($myfi le,"r");
while (!feof($fr))
{
echo fgets($fr). "<br />";
}
?>
</body>
</html>
[/CODE]
i am trying with above code to get the value input in file type in php code
and not able to get this thing.
i know how to take path in javascript
but don't know how to pass that value to php code
Please help me...
Comment