Jump to content
Sign in to follow this  
Metuzaleh

Problem with HTTP connection

Recommended Posts

Metuzaleh

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? :/

Share this post


Link to post
Share on other sites
BrettF
trancexx

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.