Jump to content

Problem with HTTP connection


Recommended Posts

Hey, my script connects to my localhost, but I have problem with sending Cookie data :) It's my autoit code:

$objHTTP = objCreate( "Microsoft.XMLHTTP" )

$objHTTP.open ( "POST", "http://localhost/cookie.php", false )

$objHTTP.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" );
$objHTTP.SetRequestHeader( "Cookie", "test=Hey!" );
                
$objHTTP.send ( "test=Hey!" )

MsgBox(0, "Result", $objHTTP.responseText )

Its my PHP code:

<?php

echo 'Post data: ' . $_POST['test'] . "\r\n";
echo 'Cookie data: ' . $_COOKIE['test'];

?>

That's result:

Posted Image

Why I don't get my Cookie data in my PHP script? :/

Link to comment
Share on other sites

Hey, my script connects to my localhost, but I have problem with sending Cookie data :) It's my autoit code:

$objHTTP = objCreate( "Microsoft.XMLHTTP" )

$objHTTP.open ( "POST", "http://localhost/cookie.php", false )

$objHTTP.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" );
$objHTTP.SetRequestHeader( "Cookie", "test=Hey!" );
                
$objHTTP.send ( "test=Hey!" )

MsgBox(0, "Result", $objHTTP.responseText )

Its my PHP code:

<?php

echo 'Post data: ' . $_POST['test'] . "\r\n";
echo 'Cookie data: ' . $_COOKIE['test'];

?>

That's result:

Posted Image

Why I don't get my Cookie data in my PHP script? :/

Try this:

$objHTTP = objCreate( "MSXML2.ServerXMLHTTP" )

$objHTTP.open ( "POST", "http://localhost/cookie.php", false )

$objHTTP.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" );
$objHTTP.SetRequestHeader( "Cookie", "test=Hey!" );

$objHTTP.send ( "test=Hey!" )

MsgBox(0, "Result", $objHTTP.responseText )

So, what did I change?

♡♡♡

.

eMyvnE

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...