String problems

Hi Clifton,
I am making a system to allow students to create a personal folder system required by my program. I have a problem. Encrypted passwords cannot be saved to files. I ask the user for a password (twice) and then encrypt it using pgStringEncrypt (base64) with or without encodeURIComponent. The result is undefined. If I don't encrypt the password, the file is written correctly using XMLHttpRequest and the PHP file below.
I have used this PHP file regulary and until now I haven't seen this type of problem.
I am making a system to allow students to create a personal folder system required by my program. I have a problem. Encrypted passwords cannot be saved to files. I ask the user for a password (twice) and then encrypt it using pgStringEncrypt (base64) with or without encodeURIComponent. The result is undefined. If I don't encrypt the password, the file is written correctly using XMLHttpRequest and the PHP file below.
- Code: Select all
<?php
$err = 0;
if ( isset($_POST['endPath']) ) {
$filePath = $_POST['endPath'];
}
$serverPath=$_SERVER['DOCUMENT_ROOT'].'/programs/';
$err = 0;
if ( isset($_POST['mydata']) ) {
$err = file_put_contents( $serverPath.$filePath, $_POST['mydata'] );
if ( $err === false ) $err = 0;
}
echo $serverPath.$filePath;
?>
I have used this PHP file regulary and until now I haven't seen this type of problem.