Can't update a document: T_ENCAPSED_AND_WHITESPACE error
Posted: Fri Feb 29, 2008 8:46 am
I am trying to update the variable values in a vars.php document by completely rewriting it. Everything seems ok, but I get an error when I submit the form and execute the update.php. Error code is:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/myname/public_html/sys/update.php on line 6
code of update.php:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/myname/public_html/sys/update.php on line 6
code of update.php:
Code: Select all
<?
//Update vars
$vars_file=fopen("vars.php","w");
fwrite($vars_file,"<?$duration1=$_POST['dura1'];$location1=$_POST['tech1'];$duration2=$_POST['dura2'];$location2=$_POST['tech2'];$duration3=$_POST['dura3'];$location3=$_POST['tech3'];$duration4=$_POST['dura4'];$location4=$_POST['tech4'];$duration5=$_POST['dura5'];$location5=$_POST['tech5'];$duration6=$_POST['dura6'];$location6=$_POST['tech6'];$duration7=$_POST['dura7'];$location7=$_POST['tech7'];$duration8=$_POST['dura8'];$location8=$_POST['tech8'];$duration9=$_POST['dura9'];$location9=$_POST['tech9'];$duration10=$_POST['dura10'];$location10=$_POST['tech10'];$duration11=$_POST['dura11'];$location11=$_POST['tech11'];$duration12=$_POST['dura12'];$location12=$_POST['tech12'];?>");
fclose($vars_file);
?>