----- Original Message ----- 
  From: hareram 
  To: vchkpw@inter7.com 
  Sent: Wednesday, June 04, 2008 6:30 AM
  Subject: [vchkpw] Fw: [qmr] adding domian and users using php


  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

          <form name="userform" action="form2.php" method="POST" >
          <table align="center" width="20%" cellpadding="0" cellspacing="1" 
                  <tr bgcolor="9999ff">
                          <td align="center"><font color="white"><b>Domain 
Entry Form</b></font></td>
                  <tr bgcolor="ffffff">
                          <td>Domain   :&nbsp;&nbsp;&nbsp;&nbsp;<input 
type='text' name='domain'></td>
                  <tr bgcolor="ffffff">
                          <td>Password :&nbsp;<input type='text' 
                  <tr bgcolor="ffffff">
                          <td align="center"><input type='submit' 

  2. form2.php

                  echo "in form2...";
                $domain = $_POST['domain'];
                $pwd = $_POST['pwd'];

                  $resultd= exec("/home/vpopmail/bin/vadddomain $domain $pwd");
                  if (isset($resultd))
                          echo "success-domain";
                          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


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.



Reply via email to