arianhojat Posted October 11, 2007 Share Posted October 11, 2007 i have a php page which reads GET parameters and if one of the variables is set, then use cURL fucntions to transfer those variables to another webpage. but instead of seeing 'http://intranetServer:8080/reports/view.jsp' in URL, i see 'readParameters.php' still which disturbs me. Anyway way to make it so both content AND URL changes (right now the content on the page is correct)? //readParameters.php if($_GET['action']=='completed') { $url = 'http://intranetServer:8080/reports/view.jsp'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// Follow any Location headers curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);// dont echo output $postfields = $_GET; //tranfser the GET parameters to this jsp page via POST now curl_setopt($ch, CURLOPT_POST, 1);// Alert cURL to the fact that we're doing a POST, and pass the associative array for POSTing. curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $output = curl_exec($ch); curl_close($ch); } Quote Link to comment https://forums.phpfreaks.com/topic/72831-make-curl-so-url-it-lands-on-is-the-actual-url-trying-to-post-to/ Share on other sites More sharing options...
sKunKbad Posted October 11, 2007 Share Posted October 11, 2007 From my curl posting experience, I don't think it's possible for you to see the url of the script processing the post variables. If you hadn't set return transfer then you would have been redirected, and you would have seen it, but since you are trying to stay on the same page it isn't going to work like that. Quote Link to comment https://forums.phpfreaks.com/topic/72831-make-curl-so-url-it-lands-on-is-the-actual-url-trying-to-post-to/#findComment-367473 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.