Jump to content

[SOLVED] Form to create array


newbtophp

Recommended Posts

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);
}

?>

Link to comment
https://forums.phpfreaks.com/topic/174184-solved-form-to-create-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.