This is my code:
<html>
<head>
</head>
<?php
$seta=$POST['set'];
$namea=$POST['name1'];
$setservicea=$_POST['setservice'];
$combined=$seta." ".$namea." ".$setservicea;
echo stripslashes($combined);
$filename="root/UMThesis/qwerty.txt";
$file = fopen($filename, "w");
$text=stripslashes($combined);
fputs($file, $text);
fclose($file);
?>
<body>
</body>
</html>
The POST variables are form previous form.
I am trying to write the variable $combined into the qwerty.txt.
Lets say $combined is aa bb "cc". I want this to be in the text file but I got an error and it is:
Warning: fopen(root/UMThesis/qwerty.txt): failed to open stream: No such file or directory in /www/htdocs/main/testmenu1.php on line 15
Warning: fputs(): supplied argument is not a valid stream resource in /www/htdocs/main/testmenu1.php on line 17
Warning: fclose(): supplied argument is not a valid stream resource in /www/htdocs/main/testmenu1.php on line 18
Why is this so? I am new at this. Hope someone can help.
Thanks in advance.
James