shweta.trivedi Posted June 30, 2015 Share Posted June 30, 2015 When I am trying to add client using WHMCS External API - this does not return me client_id nor any error message, this is because at the same time I called a hook to add client for my other application where I need to redirect the page. <?php function funConnect_mantis_client($vars) { $url = 'http://nliventech.net/bugtracking/connect_mantis.php?sername='.$vars['email'].'&email='.$vars['email'].'&realname='.$vars['firstname']." ".$vars['lastname'].'&password='.$vars['password'].'&password_verify='.$vars['password'].'&enabled=1&access_level=25' ; echo '<meta http-equiv="refresh" content="0;url='.$url.'" target="_blank" />'; } add_hook("ClientAdd",1,"funConnect_mantis_client"; ?> I want CLIENTID as well as this redirection. Is this this possible ? How can i do this? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 30, 2015 Share Posted June 30, 2015 why don't you use cURL call instead of redirection? 0 Quote Link to comment Share on other sites More sharing options...
shweta.trivedi Posted June 30, 2015 Author Share Posted June 30, 2015 Hi, can you give me example? why don't you use cURL call instead of redirection? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 30, 2015 Share Posted June 30, 2015 if you need to send these parameters to the mentioned URL from action hook, you can do it like below: <?php function hook_createRemoteUser($vars){ $url = 'http://nliventech.net/bugtracking/connect_mantis.php?'; $url .= 'sername='.urlencode($vars['email']).'&email='.urlencode($vars['email']); $url .= '&realname='.urlencode($vars['firstname']).' '.urlencode($vars['lastname']); $url .= '&password='.urlencode($vars['password']).'&password_verify='.urlencode($vars['password']); $url .= '&enabled=1&access_level=25'; curlCall($url, array(), array()); } add_hook("ClientAdd", 1, "hook_createRemoteUser"); 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.