I have this writing to an index.php file:
$contents = ("\n<head>\n</head>\n\n<body>\n<input type='hidden' name='Formusername' value='<?php echo($Formusername);?>'>\n<input type='hidden' name='Template' value='<?php echo($Template);?>'>\n\n");
$contents .= ("<?\n\n echo("\$db = @mysql_connect('the IP ', 'user');\n;
if (!\$db) { (<P>Unable to connect to the database server at this time.</P> ); exit();}\n\n");?>\n\n
$fp = fopen("/home/supracore/public_html/smac/test1/$Formusername/index.php","w+");
chmod ("/home/supracore/public_html/smac/test1/$Formusername/index.php", 0777);
if ($fp)
{
fwrite($fp, $contents);
fclose($fp);
}
but when I view the index.php file it looks like this:
<head>
</head>
<body>
<input type='hidden' name='Formusername' value='<?php echo(wa);?>'>
<input type='hidden' name='Template' value='<?php echo(1);?>'>
<?
echo('Resource id #1 = @mysql_connect('the ip ', 'user');
if (!Resource id #1) { echo('<P>Unable to connect to the ' . 'database server at this time.</P>' ); exit();}')
?>
Notice how $db turns into "Resource id #1" in the output. Why does this happen?
Thanks