954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

500 internal server error on fopen?

Well, I have no idea whats going on... But here is the problem:

I have these files:

$file2 = "password_protect.php";
$newfile = $newDir . "/password_protect.php";
if (!copy($file2, $newfile)) {
    echo "Creation failed.";
}
else{
chmod($newfile, 0777);
chmod("passProcess.php", 0777);
echo "Step 1/2 completed."
?>
<form action="passProcess.php?var=Users/<?PHP echo $projectname  ?>/" method="post">
New password: <input type="text" name="addition"/><br/>
<input type="submit"/>
</form>
<?php
}
<?php 
 echo $_GET['var'] . ""; 
 echo $_POST['addition']; 
 $File = "creativecodingstudios.com/connect/" . $_GET['var'];
 $Handle = fopen($File, 'a'); 
 $Data = "$password = " . $_POST['addition']; 
 fwrite($Handle, $Data); 
 print "Data Added"; 
 fclose($Handle); 
 ?>


But on the second code, I get a 500 error. Why?

CreativeCoding
Light Poster
40 posts since Mar 2010
Reputation Points: 33
Solved Threads: 1
 

Hello CreativeCoding

I have read your post but i can not understand what are you truing to do?
Do you want to write password in file ($File)?

Is the $newDir path is correct?
Have you specify what $newDir contain?

chintan@dani
Light Poster
39 posts since Jul 2010
Reputation Points: 11
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: