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 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.
autmated login
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: autmated login
Re: autmated login
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?
for the server i am using a vps
is there something that i am missing?
Re: autmated login
[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.
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.
Re: autmated login
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.
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.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: autmated login
If you use use any PHP header() functions, they have to come before you output any other text.antmar904 wrote:but now i am getting a : Warning: Cannot modify header information - headers already sent by.
Re: autmated login
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.
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>
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: autmated login
Try removing all the blank lines in the code and see if that makes any difference.antmar904 wrote:kent thank you for your reply but i am using the default sessionkey3.php file alone with no other html code.
Re: autmated login
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:
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>
Re: autmated login
[quote="antmar904"]thank you kent for your help,
i just removed all white spaces and i am getting the same error.
i just removed all white spaces and i am getting the same error.
Re: autmated login
ignore the code i posted above sorry.