Jump to content

Redirect and insert referral header


Plaindonut

Recommended Posts

I'm looking how to insert a referral header and redirect to another website so that website see me as if I was coming from another domain... This is as far as I have gotten but it does not redirect me, it just posts to the other website... I feel so close, I just need someone to push me over the plank...

 

<?php

$opts = array('http'=>array('method'=>"POST",

'header'=>"Referer: http://referrerURL \r\n"));

$context = stream_context_create($opts);

$fp = fopen('http://sitetosendReferralInfoto.com','r',false,$context);

fpassthru($fp);

fclose($fp);

?>

 

My problem is that i have a web page that authenticates via referral URL which is poor security practices... this I know. So I want to pass a user through a php script that redirects to this security page and insert the correct referral URL to allow it to pass through just to prove the security issue needs to be addressed. The code above works but it remains on my script domain and I want it to pass all the way through to the domain that is checking the referral. 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.