Jump to content

string playing with fwrite problems


Poddy

Recommended Posts

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.