On Friday 28 March 2003 18:26, Diksha Neel wrote: > i have a simple program to open and write a file. > but the file is not getting created. > can anyone please spot the mistake? > giving the code below.
Turn on FULL error reporting so you can what errors (if any) there are in your code. > <?php > echo"hi?how are u doing??"; > $fp = fopen ("sandrew.html", "w"); > string="<html><head><title>hi</title></head><body>i am > > fine</body></html>"; > $contents=fwrite($fp,string); You need to use $string. > echo "'$contents'"; > fclose($fp); > ?> -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* A computer lets you make more mistakes faster than any other invention, with the possible exceptions of handguns and Tequilla. -- Mitch Ratcliffe */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php