Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 536
  • Last Modified:

auto save the link from the browser

Hi
i have  a report that prints each month to the screen automatically ,
can the link be saved automatically then it will be putting on the body of the email to be send  to the customer...
0
asaidi
Asked:
asaidi
  • 2
  • 2
1 Solution
 
Ray PaseurCommented:
The current link address (URL) is usually available in these two variables:

$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

I say "usually" because not every PHP installation is the same.  You should try echoing those out to the browser output stream to see if they contain what you expect.  If you've got the information you need in there, you can depend on these variables.  You may also find interesting information in $_SERVER['HTTP_REFERER'] but in my experience this is less dependable because individuals can access scripts directly (perhaps from bookmarks) and when the access is direct, the HTTP_REFERER may be blank.
0
 
Olaf DoschkeSoftware DeveloperCommented:
It's unclear what you want.

There are many kinds of reports you could do with or without PHP into Word, PDF, Excel, etc. besides of course simply outputting a html page.

And what link do you want to save where? into what? Into favorites of the browser? Into the report itself?

How is email involved at all? Is the report automatically mailed? Or is that the step missing?

Bye, Olaf.
0
 
asaidiAuthor Commented:
Hi Olaf
normally this report will be send automatically by  email to the customer..
i thought we could not do an automatic send then i want to save the result from the browser to my c:
then write an email script and put the link saved into body of email ,then the customer can only click on the link and he get the result..then if he wants to print it he can do..
0
 
Ray PaseurCommented:
I think you can send the URL of a page or create a link to the page using the variables shown above.  Install and run this script to check the values:

<?php phpinfo();

Open in new window

0
 
Olaf DoschkeSoftware DeveloperCommented:
Well, do you have control about the php script at all?

If the link you have creates a page your customers want to see and print, and you have control over that php script and can change it, you can instead send the output of the script as an html mail to a customer.

If you the script isn't yours, but the link is displaying the page for anyone, not depending on login or cookies, simply send the link over for a customer to go there and print it.

But to get the page yourself and save it to mail it would be an overhead in any situation, won't it?

Bye, Olaf.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now