Jearb
01-25-2010, 08:55 PM
<?php
$fileName = "z" . $_POST['Keyword'] . ".txt";
$file = fopen($fileName,"w");
fwrite($file,$string);
$string = "Name: ". $_SESSION['name'] . "\nGender: " . $_SESSION['gender'] . "\nClass: " . $_SESSION['class'] . "\nGauld: " . $_SESSION['gold'] . "\nLocation: " . $_SESSION['location'] . "\nStrength: " . $_SESSION['str'];
fclose($file);
?>
All of the variables are pre-set. However, when I run the source, it creates a file but does not write to it. I am confused.
Is there something I'm doing wrong?
$fileName = "z" . $_POST['Keyword'] . ".txt";
$file = fopen($fileName,"w");
fwrite($file,$string);
$string = "Name: ". $_SESSION['name'] . "\nGender: " . $_SESSION['gender'] . "\nClass: " . $_SESSION['class'] . "\nGauld: " . $_SESSION['gold'] . "\nLocation: " . $_SESSION['location'] . "\nStrength: " . $_SESSION['str'];
fclose($file);
?>
All of the variables are pre-set. However, when I run the source, it creates a file but does not write to it. I am confused.
Is there something I'm doing wrong?