Luke commented on a Page, mIRC auto connect script generator for PHP  -  Jul 19, 2010

Well, I have edited again, the only thing I'm struggling on is if you press add channel button all the information you have added in other channel boxes are lost

Here is the updated code, I will also update it at the top

<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'];
$chan1 = $_POST['chan1'];
$chan2 = $_POST['chan2'];
$chan3 = $_POST['chan3'];
$chan4 = $_POST['chan4'];
$chan5 = $_POST['chan5'];
$extra = $_POST['extra'];
?>
<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 "&nbsp;|&nbsp;"; echo $extra; } ?> } 
}

on *:START: { 
  /server <?php echo $networkad; ?>
<?php echo "\r\n"; ?>}
</textarea>

<?php
}
if ($_POST['add'] == $null) {
?>
<h2>Auto Connect Script Generator for mIRC</h2>
<form action='index.php' method='POST'>
 <table border='0'>
 <tr><td>Network Name:</td> <td>&nbsp;&nbsp;<input type='text' name='network'></td></tr> 
 <tr><td>Network Address:</td> <td>&nbsp;&nbsp;<input type='text' name='networkad'></td></tr> 
  <tr><td>Nick:</td> <td>&nbsp;&nbsp;<input type='text' name='nick'></td></tr> 
  <tr><td>Nickserv Password:</td> <td>&nbsp;&nbsp;<input type='password' name='nickpass'></td></tr> 
  <tr><td>Channels to Join (One in each box):</td><td> <div id="text"> </div> <br><input type="button" onclick="addInput()" name="add" value="Add another channel" /> (You will loose all current channels added sofar) 
 <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>&nbsp; <textarea rows='6' cols='35' name='extra'></textarea></td></tr>
  <tr><td><input type="submit" name="add" value="Submit"></td></tr>
</form>
<?php
}
?>
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.