I'm not sure I know what you mean, I've only been using php for a week now, but love it:
Here is the code I use for generating the index.php files:
<?
if(!file_exists("$Formusername"))
{
(mkdir("$Formusername", 0777));
}
else
{
print("<p>Error in script setup. Please notify the website administrator.");
}
$contents = ("\n<head>\n<META NAME='DESCRIPTION' CONTENT TYPE='text/html'>
</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 .= ("<?if($Template) {\n\n\$db = @mysql_connect('the ip', 'user');
if (!\$db) { echo('<P>Unable to connect to the database server at this time.</P> '); exit();}
mysql_select_db('Marketplace_International',\$db);
if (! @mysql_select_db('Marketplace_International') ) { echo( '<P>Unable to locate the database ' . 'database at this time.</P>' ); exit();}
\$query = 'SELECT Bin_data,Filetype from Template WHERE Id=(\$Template)';
\$result = @(\$query);
\$data = @MYSQL_RESULT(\$result,0,'Bin_data');
\$type = @MYSQL_RESULT(\$result,0,'Filetype');
echo (\$data);
mysql_close();
};?>");
$contents .=("\n</body>\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);
}
?>
now here is what the generated file looks like:
<head>
</head>
<body>
<input type='hidden' name='Formusername' value='<?php echo($Formusername);?>'>
<input type='hidden' name='Template' value='<?php echo($Template);?>'>
<?
$db = @mysql_connect('the IP', 'user');
if (!$db) { echo('<P>Unable to connect to the database server at this time.</P> '); exit();}
mysql_select_db('Marketplace_International',$db);
if (! @mysql_select_db('Marketplace_International') ) { echo( '<P>Unable to locate the database ' . 'database at this time.</P>' ); exit();}
$query = 'SELECT Bin_data,Filetype from Template WHERE Id=($Template)';
$result = @($query);
$data = @MYSQL_RESULT($result,0,'Bin_data');
$type = @MYSQL_RESULT($result,0,'Filetype');
echo ($data);
mysql_close();?>
</body>
what happens is that I just get a blank white screen in the browser. Is this because I didn't use the eval() function ? Am I on the right track or making a new path?
I really appreciate your help, Thanks,
Steve