Finally got round to updating the script now keeps the all the data you have added already when you click the "Add another channel" button also added a simple check to see if all of the fields have data in them.
<head>
<script language="javascript">
var y = document.getElementById("nextID");
var field = y.value;
y.value++;
function addInput() {
document.getElementById('text').innerHTML += "#<input type='text' value='' name='field[]' /><br />";
}
</script>
</head>
<?php
//Please do not remove the next line
// Script by Luke - http://lukeg.me.uk/
if ($_POST['add']) {
$nick = $_POST['nick'];
$nickpass = $_POST['nickpass'];
$network = $_POST['network'];
$networkad = $_POST['networkad'];
$extra = $_POST['extra'];
if (!$nick || !$nickpass || !$network || !$networkad || !$_POST['field']) {
die ("<h3>You must fill in all the fields</h3>");
}
?>
<h3>Copy and paste the following script into a the remotes tab in the script editor(Alt + r)</h3>
<textarea rows='10' cols='120'>
on *:CONNECT: {
if ($network == <?php echo $network; ?>) { /nick <?php echo $nick; ?> | /ns identify <?php echo $nickpass; ?> | /join <?php foreach($_POST['field'] as $value) { echo "#".$value.","; } ?> <?php if($extra) { echo " | "; echo $extra; } ?> }
}
on *:START: {
/server <?php echo $networkad; ?>
<?php echo "\r\n"; ?>}
</textarea>
<?php
}
if ($_POST['add'] == $null || $_POST['add-chan']) {
?>
<h2>Auto Connect Script Generator for mIRC</h2>
<form action='scriptirc.php' method='POST'>
<table border='0'>
<tr><td>Network Name:</td> <td> <input type='text' name='network' value="<?php echo $_POST['network']; ?>"></td></tr>
<tr><td>Network Address:</td> <td> <input type='text' name='networkad' value="<?php echo $_POST['networkad']; ?>"></td></tr>
<tr><td>Nick:</td> <td> <input type='text' name='nick' value="<?php echo $_POST['nick']; ?>"></td></tr>
<tr><td>Nickserv Password:</td> <td> <input type='password' name='nickpass' value="<?php echo $_POST['nickpass']; ?>"></td></tr>
<tr><td>Channels to Join (One in each box):</td><td>
<?php foreach($_POST['field'] as $value) { echo "#<input type='text' value='".$value."' name='field[]'><br>"; } ?>
<div id="text"> </div> <br><input type="submit" onclick="addInput()" name="add-chan" value="Add another channel" />
<input type="hidden" id="nextID" value="1" /></td></tr>
<tr><td>Extra Commands? (Separated by |): <br><small>Ex. /mode $me +x | /join #chan</small></td>
<td> <textarea rows='6' cols='35' name='extra' value="<?php echo $_POST['extra']; ?>"></textarea></td></tr>
<tr><td><input type="submit" name="add" value="Submit"></td></tr>
</form>
<?php
}
?>