2

I'm using cURL to get some data and I'm passing some POST values to it. Here is the code:

$ch=curl_init();

curl_setopt($ch, CURLOPT_URL, "http://wwwsomesite.com/getdat.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "value=123465790");
curl_exec($ch);
curl_close($ch);

The cURL request is returning the entire HTML code of the result page.

What I want is that the page and all its assets (icons/logos) to load in an iframe-like component.

I am unable to feed the data to AngularJs.

How can this be achieved?

MeanGreen
  • 3,098
  • 5
  • 37
  • 63
krv
  • 2,830
  • 7
  • 40
  • 79
  • All you are showing is making cURL call ... where's the php output code? What does `unable to feed the data to angular` mean? There is no angular code here. – charlietfl Jul 31 '15 at 14:11
  • sorry..there is no code because i didn't know how to go about doing it. But got this working using the srcdoc attribute of iframe.. – krv Jul 31 '15 at 14:15

1 Answers1

0

The iFrame can be loaded via POST request using a form, you can create programatically a form with all the values that you need.

https://stackoverflow.com/a/20354786/2044583

Community
  • 1
  • 1
Danyel Cabello
  • 777
  • 6
  • 7