Jump to content

Simple Dom Parser


bigt95nt0110

Recommended Posts

Below there are two blocks of code that allow user to login to a secure site. NOTE: both blocks are striped down for simplicity.Block 1 is a stripped down form where the username and the password are explicitly assigned in "value=" assignment. When exexecuted  every thing works fine and the user is taken to the appropriate page. However if block 2 is executed the user is presented with a another login page.Can anyone point me in the right direction??Thanks   //Block 1<body><form action="https://www.mystuff.org/login" method="get" name="login">	<input type="text" id="inputEmailHandle" name="inputEmailHandle" value="mememe@gmail.com">			<input id="inputPassword" type="password" name="inputPassword" autocomplete="off" value="123">	<label> </label> 	<button type="submit">Log In</button></form></body>//BLOCK 2<body><?phpinclude('simple_html_dom.php')$url="https://www.mystuff.org/login?inputEmailHandle=mememe%40gmail.com&inputPassword=123";    $html= file_get_html($url);?></body>
Link to comment
Share on other sites

Below there are two blocks of code that allow user to login to a secure site. NOTE: both blocks are striped down for simplicity.Block 1 is a stripped down form where the username and the password are explicitly assigned in "value=" assignment. When exexecuted  every thing works fine and the user is taken to the appropriate page. However if block 2 is executed the user is presented with a another login page.Can anyone point me in the right direction??Thanks   //Block 1<body><form action="https://www.mystuff.org/login" method="get" name="login">	<input type="text" id="inputEmailHandle" name="inputEmailHandle" value="mememe@gmail.com">			<input id="inputPassword" type="password" name="inputPassword" autocomplete="off" value="123">	<label> </label> 	<button type="submit">Log In</button></form></body>//BLOCK 2<body><?phpinclude('simple_html_dom.php')$url="https://www.mystuff.org/login?inputEmailHandle=mememe%40gmail.com&inputPassword=123";    $html= file_get_html($url);?></body>

 

https://www.mystuff.org/login?inputEmailHandle=mememe%40gmail.com&inputPassword=123

 

I don't recommend to use any account information on URL, because all the links will be saved on history and its high security risk. Do logins with POST method instead.

Link to comment
Share on other sites

If the site sets a cookie, like a session, then that cookie would be set on the server and not the client. So, when the browser pulls up that page they don't have a login session. I assume you're trying to log the user in automatically by sending a request to the other server with the username and password in the URL. That's fine, but that request is being sent from the server, not the browser, so the browser is not going to have an active session on the other server. If that's what you're trying to do when you should probably look into cURL for better cookie handling. There could still be other factors that would stop it, like if the cookie is somehow tied to the IP address.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...