newbtophp Posted September 14, 2009 Share Posted September 14, 2009 I need help im trying to create a form which will write to a file and create an array to a variable from the contents of the form fields. The array would look like: $LOGIN_INFORMATION = array( 'me' => 'admin', 'admin' => 'pass' ); The form would be like?: <form action='baby.php' method='post' name='Form'> <input type="text" name="LOGIN_INFORMATION[]" size="25"><BR> <input type="text" name="LOGIN_INFORMATION[]" size="25"><BR><BR> <input name="submit" type="submit" value="Submit"> </form> <?php if(!empty($_POST["submit"])) { $out='<?php $LOGIN_INFORMATION ="'. (isset($_POST["LOGIN_INFORMATION"])? $_POST["LOGIN_INFORMATION"]:'') .'"; ?>'; file_put_contents("config.php",$out); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/174184-solved-form-to-create-array/ 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.