I do have classes. I have it all set up to do this, but I am having a little problem with the strings actually executing before they are fwrited to the variables.
php page.
Here is install.
php (only the strings siteurl and password are being utilized) (variables.txt is a blank text file):
- PHP: Select all
<?php
if($_POST['Submit']){
$open = "variables.txt";
$fh = fopen($open, 'a') or die("can't open file");
$siteurl1 = $_POST['siteurl'];
fwrite($fh, "$siteurl = '".$siteurl1."';\n");
$password1 = $_POST['password'];
fwrite($fh, "$password = '".$password1."';\n");
fclose($fh);
echo "Changes Saved.";
}else{
echo "<form action='".$PHP_SELF."' method='post'>Web Site URL (i.e. http://www.yoursite.com)<input id='siteurl' name='siteurl' type='text'><br>Make up a password <input id='password' name='password' type='text'><br><br><table cellpadding='0' cellspacing='0'><tr><td valign='top'>Page 1 without extension (i.e. home)<input id='page1' name='page1' type='text'><br>Page 2 without extension (i.e. about)<input id='page2' name='page2' type='text'><br>Page 3 without extension (i.e. history)<input id='page3' name='page3' type='text'><br>Page 4 without extension (i.e. directions)<input id='page4' name='page4' type='text'><br>Page 5 without extension (i.e. gallery)<input id='page5' name='page5' type='text'><br>Page 6 without extension (i.e. products)<input id='page6' name='page6' type='text'><br>Page 7 without extension (i.e. downloads)<input name='page7' type='text'><br>Page 8 without extension (i.e. forums)<input name='page8' type='text'><br>Page 9 without extension (i.e. prices)<input name='page9' type='text'><br>Page 10 without extension (i.e. contact)<input name='page10' type='text'></td><td valign='top'><br>Name of image folder 1 (i.e. art)<input name='pics1directory' type='text'><br>Name of image folder 2 (i.e. people)<input name='pics2directory' type='text'><br>Name of image folder 3 (i.e. places)<input name='pics3directory' type='text'></td></tr></table><input name='Submit' type='submit' value='Submit' /></form>";
}
?>
However, when I run install.
php, the resulting variables.txt file contains this:
- Code: Select all
= 'http://www.danedesigns.com';
= 'great';
It shows that the text I want (which is wrapped in quotes, so should not be executing), is in fact executing before it is written to the page.