Ok i have a little problem, i am new to PHP and am trying to add a <div> message class to the 3 or 4 $msg outputs i have in the code below. Now when i upload this file to my server i get the following error message come up "Parse error: syntax error, unexpected T_STRING in /home/username/public_html/dir/create.php on line 45" whitch is " $msg = "<div class="error">Email password does not match</div>"; " whitch was the first $msg output i wanted to test my new <div> class on. Can anyone help me with this?
<?php
include("./xmlapi.php"); //XMLAPI cpanel client class
// Default whm/cpanel account info
$ip = "localhost"; // should be WHM ip address
$account = "username"; // cpanel user account name
$passwd ="password"; // cpanel user password
$port =2083; // cpanel secure authentication port unsecure port# 2082
$email_domain = 'domain.com'; // email domain (usually same as cPanel domain)
$email_quota = 10; // default amount of space in megabytes
/*************End of Setting***********************/
function getVar($name, $def = '') {
if (isset($_REQUEST[$name]))
return $_REQUEST[$name];
else
return $def;
}
// check if overrides passed
$email_user = getVar('user', '');
$email_pass = getVar('pass', $passwd);
$email_vpass = getVar('vpass', $vpasswd);
$email_domain = getVar('domain', $email_domain);
$email_quota = getVar('quota', $email_quota);
$msg = '';
if (!empty($email_user))
while(true) {
if ($email_pass !== $email_vpass){ //check password
$msg = "<div class="error">Email password does not match</div>";
break;
}
$xmlapi = new xmlapi($ip);
$xmlapi->set_port($port); //set port number. cpanel client class allow you to access WHM as well using WHM port.
$xmlapi->password_auth($account, $passwd); // authorization with password. not as secure as hash.
// cpanel email addpop function Parameters
$call = array(domain=>$email_domain, email=>$email_user, password=>$email_pass, quota=>$email_quota);
$xmlapi->set_debug(0); //output to error file set to 1 to see error_log.
$result = $xmlapi->api2_query($account, "Email", "addpop", $call ); // making call to cpanel api
//for debugging purposes. uncomment to see output
//echo 'Result\n<pre>';
//print_r($result);
//echo '</pre>';
if ($result->data->result == 1){
$msg = $email_user.'@'.$email_domain.' account created';
} else {
$msg = $result->data->reason;
break;
}
break;
}
?>
<html>
<body>
<?php echo ''.$msg.''; ?>
<h1>Create Your New Mailbox</h1>
<form name="frmEmail" method="post">
<table width="400" border="0">
<tr><td>Username:</td><td><input name="user" size="20" type="text" /></td></tr>
<tr><td>Password:</td><td><input name="pass" size="20" type="password" /></td></tr>
<tr><td>Verify Password:</td><td><input name="vpass" size="20" type="password" /></td></tr>
<tr><td colspan="2" align="center"><hr /><input name="submit" type="submit" value="Create Email" /></td></tr>
</table>
</form>
</body>
</html>