Communicating with website

11/05/2017 19:50 LogLoft420#1
Hello, I was wondering how could I make (C# prefered or C++ program), to login to website and make some action, and then log off.
So I found following lines in website I need:
type: "POST",
url: "index.php?a=login",
data: "pw="+$('#lpw').val()+"&un="+$('#lun').val(),

when I try doing that manually in my broswer: [Only registered and activated users can see links. Click Here To Register...]

nothing happens, website just reloads its homepage... is there something wrong that I'm doing with this url or whut o.O?
Regards...
11/05/2017 21:26 Shawak#2
Your request type is wrong. By visiting the link you are performing a GET request and not a POST one. Read more about request types [Only registered and activated users can see links. Click Here To Register...].
11/05/2017 23:12 LogLoft420#3
Quote:
Originally Posted by Shawak View Post
Your request type is wrong. By visiting the link you are performing a GET request and not a POST one. Read more about request types [Only registered and activated users can see links. Click Here To Register...].
Thanks for sharing, but after reading that I still have hard time understanding why it won't work.
So lets say we don't know if site uses urlencode, so I'm trying all the possibilities...:

HTML Code:
<?php
$var="a=login pw=myusername un=mypassword";
echo $var."<br>";
$var2=urlencode($var);
echo "<br>
<a href='demo-urldecode.php?$var'> This link does not use urlencode and post data as it is</a><br>";
echo "<br>
<a href='demo-urldecode.php?$var2'> This link does use urlencode and then post data</a><br>";
?>
How am I suppost to find out what $var to use just looking at the GET method?
Tried these:
$var="a=login pw=myusername un=mypassword";
$var="a=login&pw=myusername&un=mypassword";

Any hints?
11/05/2017 23:51 Shawak#4
Use [Only registered and activated users can see links. Click Here To Register...].
11/06/2017 11:48 LogLoft420#5
Quote:
Originally Posted by Shawak View Post
Use [Only registered and activated users can see links. Click Here To Register...].
But doesn't that require edits on website side? I don't own the website btw. I'm just a client.
11/06/2017 15:07 Shawak#6
It doesn't. Since you are using C# you can do something similar to this: [Only registered and activated users can see links. Click Here To Register...]
12/07/2017 02:22 Onkelmat#7
At first you should go with HTTPTrace (Chrome) and check the sent data.
Then tell us the language you´re coding in.