Jump to content

External login....Is it really that complicated?


HostStratus

Recommended Posts

I've been digging through threads for days and I still can't find the snippets I'm looking for.

 

My current external login form looks like this:

<div id="login-popup">
	<span class="login-pop-up-icon"></span><div>Client Login</div>
	<form action="login.php" method="POST">
		<input type="text" placeholder="username" name="username" required>
		<input type="password" placeholder="password" name="password" required>
		<input type="submit" value="login">
		<div><a href="recover.php">forgot password?</a></div>
	</form>

 

 

I want to make this login work just like the standard login, where it logs the user in and directs them to the client area. And if they're already logged in then how can I make it redirect them to the client area?

 

I hate to be spoon fed, but I've spent hours going through other examples of snippets and such and I just can't seem to find what I'm looking for.

 

Thanks in advance guys!

Link to comment
Share on other sites

My Check code looks like:

<?php

require("https:/clients.hoststratus.com/dbconnect.php"); // You may have to change the path here

 

if ($_SESSION['uid']) {

echo "whmcs user logged in";

} else {

echo "whmcs user not yet login";

}

?>

And I get this PHP error:

[16-Nov-2013 00:28:54] PHP Warning: require(https:/clients.hoststratus.com/dbconnect.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/stratus/public_html/index.php on line 102

Link to comment
Share on other sites

require("https:/clients.hoststratus.com/dbconnect.php");

You should be using a relative URI for this, and even if allowed to use an absolute external one, "https:/" is improperly formatted. It requires 2 "//".

 

Use this instead:

require("/home/stratus/public_html/clients/dbconnect.php"); 

Link to comment
Share on other sites

They are on different servers, as they are two different sites. I can not link to a relative URL obviously...

Probably should have mentioned that. ;)

When an external login is mentioned about WHMCS, that generally means external to WHMCS, not the entire domain/server.

Are you trying to use one WHMCS install for two different domains here?

Link to comment
Share on other sites

apologies if i'm missing something here, but have you tried the Clients Login integration code from the admin area?

 

Utilities -> Integration Code

 

Not sure if a mod deleted my reply or what.

 

I have already figured this out brian, that part was fairly simple for me. The issue im having now is getting an output on the external site based on whether the user is logged in on the WHMCS site.

 

- - - Updated - - -

 

Probably should have mentioned that. ;)

When an external login is mentioned about WHMCS, that generally means external to WHMCS, not the entire domain/server.

Are you trying to use one WHMCS install for two different domains here?

 

one WHMCS install for two different domains...? Umm, no? Sorry, that doesn't make a whole lot of sense. Not sure what exactly you mean. I have one WHMCS install, one WHMCS domain and an external homepage that I want to be able to determine whether the user is logged in or not to the WHMCS site.

Link to comment
Share on other sites

one WHMCS install for two different domains...? Umm, no? Sorry, that doesn't make a whole lot of sense. Not sure what exactly you mean. I have one WHMCS install, one WHMCS domain and an external homepage that I want to be able to determine whether the user is logged in or not to the WHMCS site.

I wonder where I got that idea from...oh, right:

They are on different servers, as they are two different sites.

 

Good luck puzzling this out.

Link to comment
Share on other sites

I wonder where I got that idea from...oh, right:

 

 

Good luck puzzling this out.

 

Sorry, wasn't trying to be rude, but was just very confused what you meant. I said the two sites were on different servers, but there is not actually 2 different WHMCS installations or anything. Just one external site, and 1 WHMCS installation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated