joeholdcroft Posted May 6, 2006 Share Posted May 6, 2006 Is there a way to make a form input into a permanent variable, that can then be used on any other pages as long as the file they're stored in is included.For example:An installation file: the first page is where the user would input their MySQL Host, Username, Password and Database. Then I want the page to save this information to a config.php file, which can then be included on all the pages that need to correspond with the database using this information. Then on the second installation page, the tables would be inserted to the database, ect.Just the only thing i'm not sure how to do is the permanent variable storing, how would I go about this?Many thanks!! :) Quote Link to comment Share on other sites More sharing options...
Allen4172 Posted May 6, 2006 Share Posted May 6, 2006 You'd want something like this:[code]<form action="form.php" method="post"><p><input type="text" name="host" /><p><input type="text" name="user" /><p><input type="text" name="password" /><p><input type="submit" value="hit it!" /></form><?php$host = $_POST['host'];$user = $_POST['user'];$password = $_POST['password'];?>[/code] Quote Link to comment Share on other sites More sharing options...
joeholdcroft Posted May 6, 2006 Author Share Posted May 6, 2006 Thanks. Yeah I know that much, but then how do i store those variables in another file permanently? Quote Link to comment Share on other sites More sharing options...
Michael4172 Posted May 7, 2006 Share Posted May 7, 2006 Why not just use fopen, fputs to write to the external file? The above method already means you have them stored in variables.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.