I have a database for reviews, and from it I am able to call a mini index of it's content, listing only the date of the review and the author. I currently have a 'review icon' which links to the main review on another page via the review's id in the datebase. ie fanreviewid.php where id is replaced by the numerical equivalant in the database.
Anyway, what I was wondering is rather than actually manually having to create this fanreviewid.php page, if there was a way that I could automatically create the page to a set template and by using the same input that's used when the review is initially entered into the database.
So, if I were to enter the details of a 3rd review, when hitting sumbit, the information woud be 1) stored in the database, 2)automatically create a page called fanreview3.php.
I have in the past used the following script to directly write files to localhost, and I am wondering if this is perhaps somewhere I can start to build up from. However, I am unsure about what MySQL commands should be entered and where, if it is at all possible this way! Here's the code:
<?php
$filename = "localhost\\new\\newfile.txt";
$file = fopen( $filename, "w" );
fwrite( $file, "This text appears in my new file \n\n" );
fclose( $file );
?>
<html>
<head>
<title>Writing a new file</title>
</head>
<body>
<?php
if( file_exists( $filename ) )
{
$file_length = filesize( $filename );
$msg ="File created at $filename ";
$msg.="containing $file_length bytes";
echo( $msg );
}
else { echo( "Unable to create file" ); }
?>
</body>
</html>
Can anyone help?