im trying to use select boxes to pick the page to write variable to. here is sample soding im useing that is not working right. i know im doing something very wrong because its creatingweird files like ''; and "; and ".."
- this is in the form that is sending the vars to the write file below.
<td width="56%">
<select name="menu1">
<option name="config.php" value="<?php echo ("$file"); ?>" selected>config.php</option>
<option value="<?php echo 'config2.php'; ?>" selected>config2.php</option>
</select>
</td>
here is the write file that is suposed to be putting the set vars in the selected file
<?php
$fo = fopen("$file", "w");
$sphp = "<?php\n";
$ephp = "?>\n";
if($reset == NULL){
#dbaccess
$hostD = "\$host = '$host';\n";
$userD = "\$user = '$user';\n";
$passD = "\$pass = '$pass';\n";
$dbD = "\$db = '$db';\n";
$tableD = "\$table = '$table';\n";
$guserD = "\$guser = '$guser';\n";
$gpassD = "\$gpass = '$gpass';\n";
#main config
$titleD = "\$title = '$title';\n";
$headD = "\$head = '$head';\n";
$bgD = "\$bg = '$bg';\n";
$textD = "\$text = '$text';\n";
$linkD = "\$link = '$link';\n";
$borderD = "\$border = '$border';\n";
$sizeD = "\$size = '$size';\n";
$fontD = "\$font = '$font';\n";
#css config
$hovorD = "\$hovor = '$hovor';\n";
$fbackD = "\$fback = '$fback';\n";
$fsizeD = "\$fsize = '$fsize';\n";
$sborderD = "\$sborder = '$sborder';\n";
$sbackD = "\$sback = '$sback';\n";
#ip banning
$ip1D = "\$ip1 = '$ip1';\n";
$ip2D = "\$ip2 = '$ip2';\n";
$ip3D = "\$ip3 = '$ip3';\n";
$ip4D = "\$ip4 = '$ip4';\n";
$ip5D = "\$ip5 = '$ip5';\n";
#footer-do not erase...
$footD = "\$foot = '$foot';\n";
}
#writing
fwrite($fo, $sphp);
fwrite($fo, $hostD);
fwrite($fo, $userD);
fwrite($fo, $passD);
fwrite($fo, $dbD);
fwrite($fo, $tableD);
fwrite($fo, $guserD);
fwrite($fo, $gpassD);
fwrite($fo, $titleD);
fwrite($fo, $headD);
fwrite($fo, $bgD);
fwrite($fo, $textD);
fwrite($fo, $linkD);
fwrite($fo, $borderD);
fwrite($fo, $sizeD);
fwrite($fo, $fontD);
fwrite($fo, $hovorD);
fwrite($fo, $fbackD);
fwrite($fo, $fsizeD);
fwrite($fo, $sborderD);
fwrite($fo, $sbackD);
fwrite($fo, $ip1D);
fwrite($fo, $ip2D);
fwrite($fo, $ip3D);
fwrite($fo, $ip4D);
fwrite($fo, $ip5D);
fwrite($fo, $ephp);
#close file
fclose($fo);
?>
im sure its a simple mistake or something but if you see what im doing wrong please tell me.