Hello,
I am a C++ coder who is new to php so please excuse my n00bness.
I have a form which I am then passing into a MySQL database via a php script. I am also using fwrite to try and create a .php site out of the variables entered into the form. Everything is working fine and I have managed to do this with a .html site but when I try to pass php into fwrite it doesn't work.
example code
$newhtml = fopen("backup/$v_uniquename.php", "w");
fwrite($newhtml, '
<html code here>
');
works like a charm but when I use something like (just an example)
$newhtml = fopen("backup/$v_uniquename.php", "w");
fwrite($newhtml, '
<?php
while($row = mysql_fetch_array($result_date)){
$date = $row['1'];
$team1 = $row['2'];
$team2 = $row['3'];
?>
');
I get errors and I am assuming it is because I am passing using ' ' within the php code within a fwrite function. Is this correct? and is there a work around way to make a php page using this method or something similar.