Jump to content

Current file info


shamuraq

Recommended Posts

Hi guys,

 

I'm trying to script a PDF conversion tool for every of my pages. When i try to echo the page/file name to the PDF script using $_SERVER['PHP_SELF'],$_SERVER['QUERY_STRING'], $_SERVER['SCRIPT_FILENAME'], $_SERVER['SCRIPT_NAME'] etc. it keeps returning "index.php". Is there anyway i can point directly to the files that i placed the button for pdf conversion?

 

Thanx

Link to comment
https://forums.phpfreaks.com/topic/154695-current-file-info/
Share on other sites

If you are looking for the previous page you can use $_SERVER['HTTP_REFERER'] but as php.net say it's unreliable :

 

The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

http://www.php.net/manual/en/reserved.variables.server.php

 

You should store in a database the pdf file name and use a post form with a id of the row.

Link to comment
https://forums.phpfreaks.com/topic/154695-current-file-info/#findComment-813695
Share on other sites

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.