Jump to content

how to get current url behind authentication


dflow

Recommended Posts

hi

 

im building my backoffice and i want to save php files as html files, store them and eventually send them as attachment and set their names according to the passed url parameters.- now this part i am able to get correctly,

 

what i am having difficult is getting the specific url of a record:

for example :

"http://user:[email protected]/backoffice/Service_Voucher.php?RID=373&SupID=12&PID=431&LN=Nussbaum";

 

this is the script i made:

<?php

echo "Removed Slashes: ";

// Remove those slashes

if(get_magic_quotes_gpc())

echo stripslashes($_POST['question']);

else

echo $_POST['question'];

?>

<?php

//url vars:

$urlRID = $_GET['RID'];

$urlSupID = $_GET['SupID'];

$urlPID = $_GET['PID'];

$domain  = "http://user:[email protected]";

 

// submit query to search engine

$url_contents  = "http://" . $domain . $_SERVER['REQUEST_URI'];

 

 

$query_file_content = file_get_contents($url_contents, "r") or die("cannot open url");

 

// save results to a local file

// depending on how your server is configured you may need to give queryfiles folder 777 permission

// could aslo use another file mode to create file i.e. w+

$filenameSV = 'SV_';

$filenameLN = $_GET['LN'];

$filenameRID = $_GET['RID'];

$filetype = '.htm';

 

 

$file = fopen('../backoffice/createdfiles/'.$filenameSV.''.$filenameLN.''.$filenameRID.''.$filetype.'', 'w+');

 

fwrite ($file, $query_file_content);

 

fclose($file);

 

echo "Your Search Has Been Saved To: ";

?>

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.