Poddy Posted June 14, 2008 Share Posted June 14, 2008 Hi i need on submit of a form to add some variables to 2 files: the things i need to add is: $cockpit = $row['cockpit']; $take += $takeoff; where $cockpit,$take and $takeoff need to be replace from a variable whose called $short. i'm having problem combining it into a single string so i can insert it properly. i also need to insert $avg_take = $take / $numrows; echo "Takeoff Avrage: $avg_take"; at avg2.php i am stuck at this, any help is appriciated $file=fopen("avg1.php","r+"); $text = fread($file,13421772); $var = "$$short = $row['$short'];$short1 += $short;"; $text = $text . $var; echo $text; fwrite($file, $text); fclose($file); $file=fopen("avg2.php","r+"); $text = fread($file,13421772); $var = "$ avg_" . $short . "= " . $short . " / $numrows";echo "Takeoff Avrage: $avg_$short"; $text = $text . $var; echo $text; fwrite($file, $text); fclose($file); } Link to comment https://forums.phpfreaks.com/topic/110208-string-playing-with-fwrite-problems/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.