I like to say hi, and i am a total noob 🙂 i requesting if possible some help from some of you if possible.
I am running a windows server as a testing site.
I am trying to make a installer script that a user can enter a name into a submittion area, and then that data being written into a config.php file, but as a string vaule so it would read $sqluser = "there text they entered"
But each time i try i get the first part ok, but no text they have submitted is place within the file.
here is the script i have used so far.
Any help would be very greatful
Thanks again and nice to meet you all
install.php = code
<?php
print "<form action='installer.php' method='post'>";
print "Enter a username:<br>";
print "<input type='text' name='user' size='20'><br>";
print "Enter a Password:<br>";
print "<input type='password' name='pass' size='20'><br>";
print "Enter a SQL Database:<br>";
print "<input type='text' name='data' size='20'><br>";
print "<input type='submit' name='submit' value='submit'></form>";
$data = '<?
$sqluser = "'.$_POST['user'].'";
$sqlpass = "'.$_POST['pass'].'";
$sqldata = "'.$_POST['data'].'";
?>';
$file = "nbs-conf.php";
$open = fopen($file, "w");
if($open) {$writetofile = fwrite($open, $data);}
fclose($open);
?>
For the installer.php script = code
<?php
print_r($_POST);
?>
And the congif when i run this script ends up like = code
<?
$sqluser = "";
$sqlpass = "";
$sqldata = "";
?>