php - How to write data into .txt file in codeigniter -


i have folder in assets name login.my doubt how set path.

$data=$id.'~'.$expense_type.'~'.$amount.'~'.$exp_date.'<br>';  $todate= date('y-m-d'); echo $todate; if ( ! write_file('.../assets/login/log_'.$todate.'.txt', $data)) { echo 'unable write file'; } else {  echo 'file written!'; } 

no problem data path wrong set

my path 'localhost/project/pro/application/assets/login/(specific .txt file)'

output unable write file

use apppath. path application folder

if ( ! write_file(apppath."assets/login/log_$todate.txt", $data)) 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -