Hello,
I'm beginner to php (actually i'm java/jsp developer),
What i'm trying to do is Accept parameters from the HTML file and write them to a newly created file using php,
I wrote following script but it doesn't work,
for passing parameters to the php script I'm using following HTML file,
post.html
I want to create file named "ID" at server side and append the "data" to the file.
help me.
regards,
Nitin Sawant
I'm beginner to php (actually i'm java/jsp developer),
What i'm trying to do is Accept parameters from the HTML file and write them to a newly created file using php,
I wrote following script but it doesn't work,
Code:
<?php
$uploaddir = '/var/www/vhosts/nitinsawant.com/subdomains/httpdocs/files/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
?>
post.html
Code:
<html> <head>Post data...</head> <body> <form action="post.php" method="POST"> ID: <input type="text" name="ID"/><br/> Data: <textarea cols=35 rows=15 name="data"></textarea> <br/> <br/> <input type="submit" value="submit" /> </form> </body> </html>
help me.
regards,
Nitin Sawant
Comment