Forum Moderators: coopster
<?
//
// Start file creation
//$fp = fopen($user . '.php', 'w');
$content ='<? $layer03_id = imageCreateFromgif($layer03);
$layer02_id = imageCreateFromgif($layer02);
// get layer03 size
$layer03_X = ImageSX($layer03_id);
$layer03_Y = ImageSY($layer03_id);
// get layer02 size
$layer02_X = ImageSX($layer02_id);
$layer02_Y = ImageSY($layer02_id);
// use a background image
$layer01image = imageCreateFromgif($layer01);
// merge the two together with alphablending on!
ImageAlphaBlending($layer01image, true);
imagecopy($layer01image, $layer03_id, 0, 0, 0, 0, $layer03_X, $layer03_Y);
// merge third file
ImageAlphaBlending($layer01image, true);
imagecopy($layer01image, $layer02_id, 0, 0, 0, 0, $layer02_X, $layer02_Y);
header("Content-type: image/gif"); Imagegif($layer01image);
// destroy the memory
ImageDestroy($layer01image);
ImageDestroy($layer03_id);
ImageDestroy($layer02_id);?>';
fwrite($fp, $content);
fclose($fp);
?>
Sends it exactly this way. I want it to use the value of each variable instead of sending the variable itself. ie; it sends the word $layer01 instead of sending moo.gif
I have tried taking out the <? and?> within $content but there is still no luck. All the variables are defined also.
Any help? or am I as bad at describing this as I think?
eg.
$test = 'hello';
echo '$test'; //outputs $test
echo "$test"; //outputs hello
echo $test; //outputs hello
So you'll probably need to concatenate some strings and do something like:
$content = '<? $layer03_id = imageCreateFromgif(' . $layer03 . ');';
which will output to the file:
<? $layer03_id = imageCreateFromgif(thisVarValue);
Hope this helps :)