Hello all , I am creating a word file named salaryslip using php with fopen(). $f=fopen("NewSalarySlip/SalarySlip_$employid.doc","w") or die("Can't open file"); Code (markup): onrunning this above code on localhost a new word file salaryslip is creating well. But on running it on Server , error msg "Can't open file" is displayed . if i use mysql_error() like- $f=fopen("NewSalarySlip/SalarySlip_$employid.doc","w") or die(mysql_error()); Code (markup): then no error message is alerted & blank is displayed after submit. Please help me to create that new word file successfully on Server also . any suggestions will be appreciated. Thanks & regards.
mysql_error() only works when your interacting with the database, using file open is not a database interaction. Do you have error reporting turned on? Place this at the top of your php file and run it again and see what it says:
Thanks cshwebdev for attending my problem. on using the code ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); Code (markup): at the top of my php file i am getting error msg as :- Notice: Undefined variable: employid , Notice: Undefined variable: employname, .................... ..................... all the variables used for empinfo like empid,empname,etc.. are alerting as "Notice: Undefined variable: " and also some alert as "Undefined index" is also showing for some lines. Please help & guide ahead to resolve this problem. Thanks.