I'm planing to create a component out of WHMCS for Joomla.
My component is com_whmcs381. In Joomla directory /components/com_whmcs381/whmcs381.php is as following.
<?php
$pathshow=$_GET['pathshow'];
$username = $_POST['username'];
$password = $_POST['password'];
$rememberme = $_POST['rememberme'];
switch ($task) {
[indent]default:
case 'normal':
[indent]$local="http://www.slesolutions.com/xxxxxxxx/components/com_whmcs381/whmcs/";
$string=$local.$pathshow;
//require($string);
include($string);
break;[/indent]
case 'form':
[indent]$local="http://www.slesolutions.com/xxxxxxxx/components/com_whmcs381/whmcs/";
$command="?username=";
$command .=$username;
$command .="&password=";
$command .=$password;
//$command .="&rememberme=";
//$command .=$rememberme;
$string=$local.$pathshow.$command;
include($string);
break;[/indent]
[/indent]
}
?>
I planed to grab the WHMCS site by include() to the Joomla site.
It was working with links 100%,(<a href="...)
index.php?option=com_whmcs381&task=normal&pathshow=
but when it comes to user login it falis.
index.php?option=com_whmcs381&task=form&pathshow=
as WHMCS wants to send data to dologin.php
index.php?option=com_whmcs381&task=form&pathshow=dologin.php
WHMCS is not throwing incorrect user information warning, So I assume that my code is successfully authenticating WHMCS, but it fail to create session(I'm not sure here).
So i checked it with a test.php
<?php
session_start();
foreach ($_SESSION as &$value){
[indent]echo $value;
echo '<br />';[/indent]
}
foreach ($_COOKIE as &$value){
[indent]echo $value;
echo '<br />';[/indent]
}
unset($value);
return "";
?>
When I access test.php directly (http://www.slesolutions.com/xxxxxxxx/components/com_whmcs381/whmcs/)
it gives me no sessions related to WHMCS login.
And through Joomla (index.php?option=com_whmcs381&task=normal&pathshow=test.php) gives me a blank joomla page.
Does anyone have any idea to improve from here.
My knowledge on PHP and Joomla is not good but I keep doing things so feel free to correct me.
Tnx ppl.
U'