troubleshooting Question

cURL to view remote page

Avatar of nbcit
nbcit asked on
PHP
5 Comments1 Solution1211 ViewsLast Modified:
I have a fairly simple cURL call that should display a frameset on a remote server. It's returning the frameset but trying to serve it as if it was local. As the frame source is relative and not absolute, I get 'Page cannot be displayed' errors. I have no access to the remote server (it's an API).

I just want the remote server to display the frameset.

I've tried
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
and
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
and
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);



--
Example additional post vars are below

Array
(
    [aid] => 123123
    [assign] => TestAssign
    [ctl] => Test101
    [diagnostic] => 0
    [encrypt] => 0
    [fcmd] => 2
    [fid] => 7
    [gmtime] => 20080410164
    [oid] => 64484479
    [tem] => instructoremail@domain.com
    [uem] => useremail@gmail.com
    [ufn] => bob
    [uln] => bobble
    [upw] => bob123
    [utp] => 1
    [md5] => 39ccc119fee92ae9042938f29ef30975
)
$ch = curl_init('https://www.turnitin.com/api.asp');
	curl_setopt($ch, CURLOPT_POSTFIELDS, $apivalues );
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	//curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
	curl_setopt($ch, CURLOPT_HEADER, 1);//retrieve headers
 
	$data = curl_exec($ch);
	curl_close($ch);
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros