Jump to content
emanuelx

http post jquery

Recommended Posts

emanuelx

Eu tenho andado na net a fazer umas pesquisas, mas não tenho conseguido nada, por exemplo é possivél fazer um http post, e depois gravar o conteudo("html") numa variavél?

Este é o código em php, mas eu não quero fazer em php, por causa do ip.

Porque se eu usar este código fica o ip da máquina e não do cliente.

 $postdata = http_build_query(
		 array(
			   'hash' => $hash,
			   'confirm' => 'submitButton'
			  )
	);
echo " postdata  $postdata \n";
$opts = array('http' =>
array(
	'method'  => 'POST',
	'header'  => 'Content-type: application/x-www-form-urlencoded',
	'content' => $postdata
)
);
echo " opts $opts \n";
$context  = stream_context_create($opts);
echo " context  $context \n";
$result = file_get_contents($url, false, $context);

Edited by emanuelx

com calma e sem stresses

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

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.