If it doesn't need to be permanent, use a form, then access the variable by $_GET['var'] or $_POST['var']. You can even save it to the user's $_SESSION. If it needs to be permanent, use a database..don't have a user edit your PHP
You can also use something like jQuery to append data to a div container, example:
HTML:
<input id="input_form_id" type="text"/>
<button id="add_ip">Add</button>
<div id="ip_addresses"></div>
Jquery:
$("#add_ip").click(function() {
var ip = $("#input_form_id").val();
$("#ip_addresses").append(ip + "<br/>");
});
Jsfiddle: http://jsfiddle.net/hvBwK/