10 Replies - 963 Views - Last Post: 18 January 2011 - 05:38 AM Rate Topic: -----

#1 Tassaduq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-January 11

Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 03:15 AM

Hi this is my first post. I am making an application in C#. In which is use post and get functions to send variables of a form. eg a .php page. var1 = user var2 = password
I am able to get name fields from the website and use it to login and also manage cookies. but my problem comes when i get some field, which are correct but still don't get sing in. here is an example of a page http://forum.example...profile;u=15063 I can log in to this page easy, by using its field names i.e user and passwrd.
but here s an other page and when i use post method from my application i don't get sing in.
http://cstrike.examp...?showuser=81129
can any one tell me the difference b/w the submit buttons in both webpages. They should work alike but why dont they.
note i am not using webbrowser. I am using simple request to the servers. I even tried using variables in the url address of the browser but no luck.
I am gonna need all the help i can get.:)

Is This A Good Question/Topic? 0
  • +

Replies To: Need help with submit buttons and post and get functions.

#2 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,000
  • Joined: 10-May 07

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 03:18 AM

Why would you post under html/css for a C# project?

We can't help you if you don't supply the code.
Was This Post Helpful? 0
  • +
  • -

#3 Tassaduq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-January 11

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 03:25 AM

View Postno2pencil, on 18 January 2011 - 03:18 AM, said:

Why would you post under html/css for a C# project?

We can't help you if you don't supply the code.

Thanks for a fast reply. I have worked with C# it dont have any error the thing is i have never worked with post and get methods and dont know how they work. I only know how to submit variables on simple form using the web browser. Same thing is used in c#. I can login easy in the first site but i dont get loged in the second site, even y posting the variables in the browser. How do these buttons work. I have been working on it from 4 days with no luck.
I had read a forum about some tool in Firefox called temperer which can tell what the button do or how it forms data to be sent in the browser but i did not understand it.
I want to know how the both buttons work in both of the abouve sites?
Was This Post Helpful? 0
  • +
  • -

#4 Tassaduq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-January 11

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 03:37 AM

this is the first web page : http://forum.paintballcabarete.com/index.php?action=profile;u=15063
This is the second one : http://cstrike.vladislavovo.org/hl/forums/index.php?act=Login&CODE=00


Both the pages have login field. with different name first i fetch the name of the fields the i post them to log in, in c#. First one login's but the second one don't why?
eg of code
     string username = "Clarencervhx";
           string password = "gzVNhnDNwMGp"; 
           HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://forum.paintballcabarete.com/index.php?action=profile;u=15063");
           request.Method = "POST"; 
           using (StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.ASCII)) { 
               writer.Write("user=" + username + "&passwrd=" + password); 
           }
           HttpWebResponse response = (HttpWebResponse)request.GetResponse();

THIS RESULTS IN A SUCCESS.


this is for second site
     string username = "Clarencervhx";
           string password = "gzVNhnDNwMGp"; 
           HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://forum.paintballcabarete.com/index.php?action=profile;u=15063");
           request.Method = "POST"; 
           using (StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.ASCII)) { 
               writer.Write("UserName=" + username + "&PassWord=" + password); 
           }
           HttpWebResponse response = (HttpWebResponse)request.GetResponse();

THIS RESULTS as a Fail.

Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,000
  • Joined: 10-May 07

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 03:39 AM

But for what language you using GET? In PHP the 2nd example will pull the variable showuser into the GET array.

<?php
echo $_GET['showuser']; // will display 81129
?>



So again, I'm not really sure why you posted this in HTML/CSS, & I'm not sure what you are trying to do since there is no code. I mean, I know what you are saying, but I'm not really following.
Was This Post Helpful? 0
  • +
  • -

#6 Tassaduq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-January 11

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 03:46 AM

OK now my question will be. How the pagese i have posted manage login? How and in what pattern do they send login info. If i know what they send via url for example i know the first website do it like this
http://forum.paintballcabarete.com/index.php?action=login2&user=Clarencervhx&passwrd=gzVNhnDNwMGp


but how do the other site do the login. If i know how it do it then so can i do it.
My main question is how do Browser manage these logins and what is needed to do it like the browser.
Was This Post Helpful? 0
  • +
  • -

#7 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,000
  • Joined: 10-May 07

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 03:53 AM

If it's pulled in a GET array, as the example you posted here, then it's server side code.

You can send it two variables, user & passwrd.

It will pull them in as :

<?php
echo $_GET['user']; // prints Clarencervhx
echo $_GET['passwrd']; // prints gzVNhnDNwMGp
?>



But anymore than this is impossible to know what the server does, without access to the PHP code.
Was This Post Helpful? 0
  • +
  • -

#8 Tassaduq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-January 11

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 04:02 AM

Have you seen the second site. I dont know where do the subit request goes. Is there a way to replicate the login process. I dont understand the difference b/w the both submit button in both sites.
How do we know what they are doing. They only submit two variables to the website. i know that the first one is using post. I second one i have tried to use get. I uploaded the variables also, but it all works for the first site only.
This site don't even say like user name not valid or any thing
http://cstrike.vladislavovo.org/hl/forums/index.php?act=Login


Can you look into the submit button of the above site, and tell how it is working.
I had used post and get functions before but i have never used submit buttons.
Was This Post Helpful? 0
  • +
  • -

#9 Tassaduq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-January 11

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 04:26 AM

View Postno2pencil, on 18 January 2011 - 03:53 AM, said:

If it's pulled in a GET array, as the example you posted here, then it's server side code.

You can send it two variables, user & passwrd.

It will pull them in as :

<?php
echo $_GET['user']; // prints Clarencervhx
echo $_GET['passwrd']; // prints gzVNhnDNwMGp
?>



But anymore than this is impossible to know what the server does, without access to the PHP code.



https://addons.mozilla.org/en-US/firefox/addon/tamper-data/

I am going to use this software to find out what is going on in the singin process. but i dont really understand any thig about those submit buttons :(
Was This Post Helpful? 0
  • +
  • -

#10 Tassaduq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-January 11

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 04:41 AM

View PostTassaduq, on 18 January 2011 - 04:26 AM, said:

View Postno2pencil, on 18 January 2011 - 03:53 AM, said:

If it's pulled in a GET array, as the example you posted here, then it's server side code.

You can send it two variables, user & passwrd.

It will pull them in as :

<?php
echo $_GET['user']; // prints Clarencervhx
echo $_GET['passwrd']; // prints gzVNhnDNwMGp
?>



But anymore than this is impossible to know what the server does, without access to the PHP code.



https://addons.mozilla.org/en-US/firefox/addon/tamper-data/

I am going to use this software to find out what is going on in the singin process. but i dont really understand any thig about those submit buttons :(

HI again I was able to take this info out of the site it is using GET in the following way

16:36:32.912[705ms][total 1274ms] Status: 200[OK]
GET http://cstrike.vladislavovo.org/hl/forums/index.php?&UserName=Clarencervhx&PassWord=gzVNhnDNwMGp&x=22&y=12 Load Flags[LOAD_DOCUMENT_URI  LOAD_INITIAL_DOCUMENT_URI  ] Content Size[-1] Mime Type[text/html]
   Request Headers:
      Host[cstrike.vladislavovo.org]
      User-Agent[Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100105 Firefox/3.6]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Accept-Language[en-us,en;q=0.5]
      Accept-Encoding[gzip,deflate]
      Accept-Charset[ISO-8859-1,utf-8;q=0.7,*;q=0.7]
      Keep-Alive[115]
      Connection[keep-alive]
      Referer[http://cstrike.vladislavovo.org/hl/forums/index.php?act=Login&CODE=01]
      Cookie[session_id=75f28d1e66e6c16af0a229c59b2ddfed; ipb_stronghold=3b35578dcc64120a9241c89ff60da771; member_id=81129; pass_hash=be7fdcb75410996b9e7a29bffcb42477; coppa=0; anonlogin=-1]
   Response Headers:
      Date[Tue, 18 Jan 2011 11:38:46 GMT]
      Server[Apache/2.2.12 (Ubuntu)]
      X-Powered-By[PHP/5.2.10-2ubuntu6.7]
      Set-Cookie[pass_hash=be7fdcb75410996b9e7a29bffcb42477; expires=Tue, 25-Jan-2011 11:38:47 GMT; path=/; httponly
session_id=75f28d1e66e6c16af0a229c59b2ddfed; path=/; httponly]
      Content-Encoding[gzip]
      Vary[Accept-Encoding]
      Keep-Alive[timeout=15, max=99]
      Connection[Keep-Alive]
      Transfer-Encoding[chunked]
      Content-Type[text/html]




Was This Post Helpful? 0
  • +
  • -

#11 Fungle  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 256
  • View blog
  • Posts: 337
  • Joined: 06-March 10

Re: Need help with submit buttons and post and get functions.

Posted 18 January 2011 - 05:38 AM

I think this should be moved into the PHP Help forum, Or the ASP.NET forum, It does not fit in with the HTML and CSS forum very much.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1