Jump to content

[SOLVED] Get value of page from another url


trampolinejoe

Recommended Posts

Hey Guys,

 

I need to do the following,

 

I need to:

a) post a form to another domain,

b) grab the contents of the result of that domain

c) set it to a variable without leaving the page

 

I have no idea at all where to start.

 

Please help.

 

 

OK so I fixed my code from earlier, I was calling the wrong function.

To pass data you just change the array $data to accommodate your variables and their values.

<?php
$data = array ('foo' => 'bar', 'bar' => 'baz');
$data = http_build_query($data);

$context_options = array (
        'http' => array (
            'method' => 'POST',
            'header'=> "Content-type: application/x-www-form-urlencoded\r\n"
                . "Content-Length: " . strlen($data) . "\r\n",
            'content' => $data
            )
        );

$context = stream_context_create($context_options)
$fp = file_get_contents('https://url', FALSE, $context);
?>

Now try grabbing the page and do a var_dump() on $fp see if that spits out the information for the page if it does then you just have to isolate the fingerprint and you can do whatever you need to from there.

G'day Wolf!

 

Good to see you again!

 

I have it so close to working now!

 

ok, now! to finsh it off I need to be able to post the following variables to the page so that it can create the key.

 

<input type="hidden" name="EPS_TIMESTAMP" value="<?php echo $timestamp; ?>">
<input type="hidden" name="EPS_MERCHANT" value="ID893240">
<input type="hidden" name="EPS_PASSWORD" value="XXXX">
<input type="hidden" name="EPS_REFERENCEID" value="<?php echo $referenceid; ?>">
<input type="hidden" name="EPS_AMOUNT" value="<?php echo $amount; ?>">

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

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.