ok, let's look at the html for createing a new package in WHM
*note - I cut out all the extra html other than just the basic form for ease of reading.
PHP Code:
<form method=POST action="/scripts2/addpkg" name="mainform">
<input type="text" name="name">
<input type="text" name="quota">Mega Bytes</td>
<input value="1" type="checkbox" checked name="hasshell"></td>
<input value="unlimited" type="text" name="maxftp"></td>
<input type="text" value="unlimited" name="maxpop"></td>
<input value="unlimited" type="text" name="maxlst"></td>
<input type="text" value="unlimited" name="maxsql"></td>
<input type="text" name="maxsub" value="unlimited" ></td>
<input type="text" name="maxpark" value="0" >
<input type="text" name="maxaddon" value="0" ></td>
<input value="1" type="checkbox" name="ip">
<input value="1" type="checkbox" checked name="cgi">
<input value="1" type="checkbox" checked name="frontpage"></td>
<input type="text" name="bwlimit" value="unlimited"> MegaBytes</td>
<select name="cpmod">
<option value=NO>NO</option>
<option value=YES>YES</option>
<option value=advanced>advanced</option>
<option value=tree>tree</option>
<option value=y>y</option>
<option value=monsoon>monsoon</option>
<option value=default selected>default</option>
<option value=iconic>iconic</option>
<option value=mailonly>mailonly</option>
<option value=x>x</option>
<option value=x2>x2</option>
<option value=xmail>xmail</option>
<option value=cclpanel>cclpanel</option>
<option value=bluetrix>bluetrix</option>
<option value=bluelagoon>bluelagoon</option>
<option value=vertex>vertex</option> </select>
<select name="featurelist">
<option value="testlist">testlist</option>
<option value="default" selected>default</option>
</select>
</form>
now, we know we are going to call the whmreq function
PHP Code:
function whmreq ($request,$host,$user,$accesshash,$usessl) {
so we need to format everything from the form above into the $request string and then call the function
you will have a script that ends up looking like this:
PHP Code:
$request = "/scripts2/addpkg?name".$_POST['name'].""a=".$_POST['quota']...........conintue for each parm
you get the idea. for each form field append the name and value to the request string. As you can see from the $_POST I am assuming you have a php page where you are getting all the post values from a html form
once you have the request string formated you can call whmreq function
does that help?