RE: [PHP-DB] <TEXTAREA in and out of the db>

From: Date: Tue, 06 Nov 2001 16:26:45 +0000
Subject: RE: [PHP-DB] <TEXTAREA in and out of the db>
Groups: php.db 
Request: Send a blank email to php-db+get-14062@lists.php.net to get a copy of this message
To make it a bit clearer: this is the editit.php (only edited it to translate the dutch out of it :P) <HTML> <HEAD> <TITLE>File <?php print($best); ?></TITLE> </HEAD> <BODY> <?php $pad="/home/user1/$best"; $inhoud = file($pad); /* while(list ($line_num,$line) = each($inhoud)) { echo htmlspecialchars($line) ."<BR>\n"; } */ print("<FORM METHOD=\"POST\" ACTION=\"applyedit.php?best =$best\">"); print("<TEXTAREA ROWS=40 COLS=80 NAME=content>"); while(list ($line_num,$line) = each($inhoud)) { print(htmlspecialchars($line) . "\n"); } print("</TEXTAREA>"); print("<BR>"); print("<INPUT TYPE=SUBMIT VALUE=\"Save\">"); print("</FORM>"); ?> </BODY> </HTML> -------------------------------------------------------------------------------------------------------------------------------- This works fine it seems, the text appears in the textare... so that was not the problem. The problem arises with the next script, where $content does not appear to have any text in it... applyedit.php <HTML> <HEAD> <TITLE>File <?php print($best); ?></TITLE> </HEAD> <BODY> <?php $pad="/tmp/$best"; if(file_exists($pad)) { print("$pad had to be deleted first.<BR>"); /* safety measure, fopen($blah, "w") ought to create a new file */ unlink($pad); } $fp=fopen($pad,"w"); print("Content:<BR>"); print("$content"); /* there's nothing printed, so I assume $content is empty */ fputs($fp,htmlspecialchars($content) . "\n"); /* even htmlspecialchars() does not put anything in the file $content is really empty? */ fclose($fp); ?> /* this part is not so interesting, just some aid in browsing *. Completed saving.<BR> Click <A HREF= "http://starting.page.org/update.html">here</A> to go back to the update page.<BR> Or click <A HREF="http://starting.page.org">here</A> to go to the main site. <BR> </BODY> </HTML> ----------------------------------- I hope that clears it a bit up... so you can enlighten me :) TIA Michiel Lange

« previous php.db (#14062) next »