autmated login

For discussion of the Poker Mavens server module and other administration topics
Kent Briggs
Site Admin
Posts: 5880
Joined: Wed Mar 19, 2008 8:47 pm

Re: autmated login

Post by Kent Briggs »

antmar904 wrote:ok so i tried changing the port to port 80 in the api.php, port forwarding and on the server side AND using sessionkey.php then sessionkey3.php and they both came back with the connection failed but when i us the login.htm is works fine.
The login.htm sample doesn't make any API calls. It just passes the login credentials in the URL itself. Ask your PHP host if they are blocking all outgoing connections using Curl.
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

hi kent, i tried using port 80 i made the changes on the server (file port 80) in the api and in the sessionkey3.php file and im still getting the connection failed error.

for the server i am using a vps

is there something that i am missing?
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

[quote="antmar904"]hi kent, i tried using port 80 i made the changes on the server (file port 80) in the api and in the sessionkey3.php file and im still getting the connection failed error.

for the server i am using a vps

is there something that i am missing?

when i change the file port on the server to port 80, then try to connect to the server using http://ipaddress:80 it does not connect.
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

ok so after using port 80 i figured out it was a firewall issue.

i am not able to log in using the sessionkey3.php but now i am getting a : Warning: Cannot modify header information - headers already sent by.

sorry i am not a developer, any help will be much appreciated.

i am using the default sessionkey3.php file with no modifications except of course for the server ip and port.
Kent Briggs
Site Admin
Posts: 5880
Joined: Wed Mar 19, 2008 8:47 pm

Re: autmated login

Post by Kent Briggs »

antmar904 wrote:but now i am getting a : Warning: Cannot modify header information - headers already sent by.
If you use use any PHP header() functions, they have to come before you output any other text.
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

kent thank you for your reply but i am using the default sessionkey3.php file alone with no other html code.

again i am no web developer so the vocabulary might be difficult.

here is the default sessionkey3.php file that you have posted on your api page:

the only thing i change was the server ip and port.

is there anything else that i have to change?

thank you again for being so patient with me. :)

Code: Select all

<html>
<body>
 
  <?php

    $server = "http://127.0.0.1:8087";   // set your url here
    include "API.php";  // $pw and $url set in this file

    if (isset($_POST["Login"]))
    {
      $player = $_POST["Player"];
      $password = $_POST["Password"];
      $params = "Password=$pw&Command=AccountsPassword" . "&Player=" . urlencode($player) . "&PW=" . urlencode($password);
      $api = Poker_API($url,$params,true);
      if ($api["Result"] != "Ok") die($api["Error"] . "<br/>" . "Click Back Button to retry.");
      if ($api["Verified"] != "Yes") die("Password is incorrect. Click Back Button to retry.");
      $params = "Password=$pw&Command=AccountsSessionKey&Player=" . urlencode($player);
      $api = Poker_API($url,$params,true);
      if ($api["Result"] != "Ok") die($api["Error"] . "<br/>" . "Click Back Button to retry.");
      $key = $api["SessionKey"];
      header("Location:" . $server . "/?LoginName=" . $player . "&SessionKey=" . $key);
      exit;
    }
  ?>

  <h3>Poker Login</h3>
  <form method="post">
    <table>
      <tr>
        <td>Player Name:</td>
        <td><input type="text" name="Player"></td>
      </tr>
      <tr>
        <td>Password:</td>
        <td><input type="password" name="Password"></td>
      </tr>
      <tr>
        <th colspan="2"><input type="submit" name="Login" value="Login"></th>
      </tr>
    </table>
  </form>

</body>
</html>
Kent Briggs
Site Admin
Posts: 5880
Joined: Wed Mar 19, 2008 8:47 pm

Re: autmated login

Post by Kent Briggs »

antmar904 wrote:kent thank you for your reply but i am using the default sessionkey3.php file alone with no other html code.
Try removing all the blank lines in the code and see if that makes any difference.
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

thank you kent for your help,

i just removed all white spaces and i am getting the same error.

here is what the code looks like:

Code: Select all

<html>
<body>
<h3>Poker Login</h3>
<form method="post">
<table>
<tr>
<td>Player Name:</td>
<td><input type="text" name="Player"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="Password"></td>
</tr>
<tr>
<th colspan="2"><input type="submit" name="Login" value="Login"></th>
</tr>
</table>
</form>
</body>
</html>
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

[quote="antmar904"]thank you kent for your help,

i just removed all white spaces and i am getting the same error.
antmar904
Posts: 30
Joined: Sun Oct 07, 2012 7:24 pm

Re: autmated login

Post by antmar904 »

ignore the code i posted above sorry.
Post Reply