Angelo Kreikamp Angelo Kreikamp - 9 months ago 62
PHP Question

php syntax error while creating an email in directadmin by api

I'm trying to create an email into DirectAdmin by API
but my codes give back a syntax error on line 10 but i don't see anything wrong with that line.

$sock = new HTTPSocket;
$sock->set_login('mijndomein','mijn 1337 ww');

if(!empty($_POST['user']) && !empty($_POST['passwd']) is_numeric($_POST['quota'])) {
echo $sock->result;

if(eregi('error=0', $sock->result)){
echo '<p>Email adress is aan gemaakt<br />
username: '.$_POST['user'].'<br />
password: '.$_POST['passwd'].'<br />
Quota: '.$_POST['quota'].'<br />
POP3 server:<br />
SMTP server:*</p>';

Answer Source

You missed logical operator within if statement

if(!empty($_POST['user']) && !empty($_POST['passwd']) is_numeric($_POST['quota'])){

should be

if(!empty($_POST['user']) && !empty($_POST['passwd']) && is_numeric($_POST['quota'])){