forms - php exec change password in file -


i'm trying make simple input form change password in config file. believe pretty close after trying hour exec line below correct believe need help.

# password in conf file # $password = '12345';   <?php  if(isset($_request['new_pass'])){     exec('sed -i '.escapeshellarg('s/\$password=.*/\$password=\'".$_request['new_pass'].'\'/g')." include/conf.php");     echo 'password changed'; } ?>  <form method="get" action="<?php echo $_server['php_self']; ?>">     <input type="text" name="new_pass" maxlength="59">     <input type="submit" name="submit" value="submit" /> </form> 

i'm ' quotations tripping me up.

when in doubt, @ syntax highlighting.

exec('sed -i ' . escapeshellarg('s/\$password=.*/\$password=\''.$_request['new_pass'].'\'/g')." include/conf.php"); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -