----- Original Message -----
From: hareram
To: [email protected]
Sent: Wednesday, June 04, 2008 6:30 AM
Subject: [vchkpw] Fw: [qmr] adding domian and users using php
Hi
iam trying to use PHP front end application to create a users
i have other applications, when i creating the users, i need to create on
other application too
so we are developping one time register kind of application.
I have created 2 files
1. form1.php
<HTML>
<BODY>
<form name="userform" action="form2.php" method="POST" >
<table align="center" width="20%" cellpadding="0" cellspacing="1"
bgcolor="9999ff">
<tr bgcolor="9999ff">
<td align="center"><font color="white"><b>Domain
Entry Form</b></font></td>
</tr>
<tr bgcolor="ffffff">
<td>Domain : <input
type='text' name='domain'></td>
</tr>
<tr bgcolor="ffffff">
<td>Password : <input type='text'
name='pwd'></td>
</tr>
<tr bgcolor="ffffff">
<td align="center"><input type='submit'
value='Submit'></td>
</tr>
</table>
</form>
</BODY>
</HTML>
2. form2.php
<?php
echo "in form2...";
$domain = $_POST['domain'];
$pwd = $_POST['pwd'];
$resultd= exec("/home/vpopmail/bin/vadddomain $domain $pwd");
if (isset($resultd))
{
echo "success-domain";
}
else
{
echo "fail-domain";
}
?>
but i always get sucess
but i dont see any errors in httpd log
and i dont see domain added.
any suggestion, what iam doing wrong
hare
Not a complete php expert, but I believe $resultd is always going to be set
because vaddomain always returns some sort of result or error. I forget the
output at this point, but there is a specific string that is spit out when the
domain is added successfully. I would probably parse for that as for success
and then echo $resultd in the else statement. There is also a great PEAR module
that has been created that lets you create an object to work with vpopmaild.
May take a little extra work to setup, but probably worth it in the long wrong.
All the hard stuff has been done for you.
Brian
!DSPAM:4846a7ac32356309920482!