Ok
Many thanks for your info for my understanding
Please note I have developed two files code you file links as fallows:
www.hazratsultanbahu.com/loginmail/index.php www.hazratsultanbahu.com/loginmail/logway.php
When I try to log in then following error coming on as fallows:
Fatal error: Call to a member function on a non-object in /home/hazratsu/public_html/loginmail/index.php on line 58
Please help how I problem can be solved?
You can send me mail to:
atco@hazratsultanbahu.com
File no one index.php code as fallows:
<?php
/*
This is the example script for cpmail class
*/
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Web Mail Log in</title>
</head>
<body>
<p><b><font size="5">Web Mail Log in</font></b></p>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table border="0" width="52%" style="border-collapse: collapse">
<tr>
<td colspan="2">
<p align="left"><b>login Email Account</b></td>
</tr>
<tr>
<td width="78">
<p align="right">Username:</td>
<td><input type="text" name="euser" size="20"></td>
</tr>
<tr>
<td width="78">
<p align="right">Password:</td>
<td><input type="password" name="epass" size="20"></td>
</tr>
<tr>
<td width="78"> </td>
<td><input type="submit" value="login Account" name="login"></td>
</tr>
</table>
</form>
<p> </p>
<?php
if(isset($_POST['login'])){
//include class file
require_once('logway.php');
/*
instanceiate class & pass two arguments cpanelusername, cpanelpassword,yourdomainname,cpanelskin
See following URL to know how to determine your cPanel skin
http://www.zubrag.com/articles/deter...panel-skin.php
if you don't pass cpanelskin argument, default will be x
*/
//call login function and you have to pass two arguments as follows:
//emailid, password
echo $cpanel->login($_POST['euser'],$_POST['epass']);
}
?>
</body>
</html>
file logway.php codes as fallows:
<?php
/*
This class is an extension of script made by
www.zubrag.com. You can access the original link from here
http://www.zubrag.com/scripts/cpanel...il-account.php
Class Name: cpmail
Clas Title: cPanel Mail Accounts Creator
Purpose: login cPanel email account without loggin in to cPanel.
Version: 1.0
Author: Md. Zakir Hossain (Raju)
URL:
http://www.rajuru.xenexbd.com
Company: Xenex Web Solutions
URL:
http://www.xenexbd.com
License: GPL
You can freely use, modify, distribute this script. But a credit line is appreciated.
Installation:
see example.php for details
*/
//definding main class
class cpmail{
//declare public variables
var $cpdomain; // hazratsultanbahu.com:2095
var $cpskin; // x
//defining login
function cpmail($cpdomain,$cpskin='x'){
$this->cpdomain=$cpdomain;
$this->cpskin=$cpskin;
// See following URL to know how to determine your cPanel skin
//
http://www.zubrag.com/articles/deter...panel-skin.php
}
//now login email account, function takes two arguments
/*
$euser = email id
$epass = email password
*/
function login($euser,$epass){
$path="http://".$euser.":".$epass."@".$this->cpdomain.":2095/frontend/";
$f = fopen($path,"r");
if (!$f) {
return('Cannot login email account. Possible reasons: "fopen" Wrong user name or password Try again!, or may account not exists');
}
//return success
}
}
?>
Enclose your code in code, php or html tags! It is absolutely unreadable! - Read the Posting Guidelines before you show any code in this forum! Ronald :cool: